I would like to create a text file from the AS400, I need to be able to have a header line followed by line details. It's a Purchase Order which I need to email as a text file. What is the best way of doing this?
Software/Hardware used:
ASKED:
December 9, 2008 6:58 PM
UPDATED:
December 10, 2008 8:31 PM
I recommend just writing to a regular externally described file, and then copying that database file to the IFS with the CPYTOIMPF (copy to import file) command. That way, your RPG program doesn’t have to anything extra, since a lot of the functionality you’d want is already built into CPYTOIMPF. You can chose for the fields in the record to be delimited, or just be in a fixed record length, among several other options.
You could proceed with emailing from there, depending on the level of automation you’d want (such as if it’s a one time or recurring process).