csvibm-midrangecontrol-language

iSeries Export to CSV


Is there an iSeries command to export the data in a table to CSV format?

I know about the Windows utilities, but since this needs to be run automatically I need to run this from a CL program.


Solution

  • You can use CPYTOIMPF and specify the TOSTMF option to place a CSV file on the IFS. Example: CPYTOIMPF FROMFILE(DBFILE) TOSTMF('/outputfile.csv') STMFCODPAG(*PCASCII) RCDDLM(*CRLF)