• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Can a table conversion output the flat file to the user specified path?

Vijay Ch

Member
Hello JDE List,

I have a table conversion which outputs the flat file to the export folder. Each time I run the TC, data gets appended in the flat file. I would want to rename the flat file after each run so that the data is stored in a separate file for each run. I don't have direct access to the export folder to rename the flat file. Is there a way to create the flat file in user specified path rather than creating in the export folder? If this is not possible, can the flat file be renamed in the export folder using a system function or a business function and copied to a user specified location?
 

Rauf

VIP Member
Vijay,

I did the same a couple of months ago.

We can achieve this using the BF "Execute External Program".
1. Generate the data to a common file such as OutPut.txt
2. Copy OutPut.txt to OutPut_100.txt (ie by concatenating a Batch Number with the file name)
3. Delete the OutPut.txt file.

All these operations can be done "copy", "del" commands passing to the BF.
 

peterbruce

Legendary Poster
Vijay,

Use a wrapper UBE to call the TC. When the TC has completed you can use business functions to copy or move and/or rename the file to where ever you want, provided JDE has access. The TC would always write to the same filename. Then the wrapper UBE would copy/move/rename it. The new file location could be entered as a processing option for the UBE or hardcoded (not recommended I don't like hardcoding on principle) and the new filename could be created using runtime data, such as the date and time.
 

jolly

Reputable Poster
There seems to be (yet another) annoying "feature" in TCs: Output Column variables (OC) have non local scope. If the OC is assigned a value in one record-is-fetched event, it retains that value in the next event if it is not otherwise assigned.

So if you have a large number of OCs that are conditionally assigned in ER rather than mapped from the input record, you need to set them all to blank to prevent "fall throughs".

Just another reason why I usually avoid TCs and read/write flat files with BSFNs instead.
 
Top