Flat File Output


Active Member
Hi List,
I have a situation where I need to read 2 JDE tables as input, 1 header table and 1 detail table. The output is going to be a flat (foreign?) file with multiple formats. I can't seem to find out how to define the flat file to JDE. I do not want to create a JDE table and go through all the dd stuff involved with creating a JDE table.

Which JDE tool is better to use in this case, Table Conversion or Report Writer?

We're an AS400 shop using JDE 7333 SP 16.

Any suggestions on how to approach this? Thanks in advance.


Active Member

you can just write it to a externally defined file and then do a cpyf to a
PF you created without a dds (crtpf lib/file RCDLEN(1234) ) OR, you can
do output to a PF using a INTERNALLY defined file and using either O specs
OR a data structure then just move the structure to the output field
before writing...

.csv's are also easy to write in RPG if you need to...

Don in DC


On Tue, 25 Sep 2001, karenet wrote:

Frosty the Coder

Legendary Poster
Table Conversions are tough to work with.
On the 400, I've never been able to see network
drives. If you change the file names, you lose
your ER (this _may_ have been fixed by now).

Using RDA for a UBE, you can, at the section,
select DATABASE OUTPUT. Create a report variable
and string (concat) your data to it. This RV
is referenced by the DB OUTPUT.

When the record is complete the ube will
output to the file as well as writing to
the report. You can always suppress
the report if you wish.

Gene Piekarski, Jr

AS/400, B733, SP11.2, NT client
AS/400, B733, SP14, W2000 client
XE, SP13


Active Member
In a UBE you are must more flexible with e.g. file names. There are a number of standard business functions you can use to open the flat file, write lines to the file, close the flat file, etc.


B7332 / XE / NT4 / SQL 7 / VisualStudio 6 SP5
Discover how to build no-code data integrations and business process automations.


Hello there,

If you need to create a flat file in multiple formats, you can also accomplish it by writing a UBE and concatenating all values to one large string.
This string can be written to file by B34A1010, which contains 3 functions:

1. Open flat file - This will return a pointer (use GENLNG). Use this one at the Initialize Section event.

2. Write one Line to flat file - Use your string and the pointer mentioned above as input.

3. Close flat file. To release the flat file from being in use, you have to call this fonction at the end of your UBE. "After last object printed" probably is the event you want to do this on.

You can easily create a PO template where you can specify the filename (NFLF) that you pass to the fuctions mentioned above. This will keep the path far more flexible in comparison to the path used by TC's (losing ER - still not fixed yet).

Good luck,

Marcel Dusée
[email protected]

- B7332 W2K SQLServer2000
- XE W2K SQLServer2000
- XE AS/400