Hi Everyone,
I have been sucessful converting both flat files(sys/36 files) and external described files to .csv files and then sending them to various sites via email or FTP using commands in a CL program. Some sites require "true" .xls files. I know that there is software that can be purchased to do this, my client already has it. However, I would like to know if I can do it directly on the 400. Here are the commands I use to convert an external defined file to .csv
1.) Copy data file into a source file to add delimiters.
CPYTOIMPF FROMFILE(QS36F/WBDATA) TOFILE(QS36F/WBSRC) MBROPT(*REPLACE) RCDDLM(*EOR) DTAFMT(*DLM) STRDLM(*DBLQUOTE) FLDDLM(',')
2.) Then copy the source file which now contains data and delimiters into a stream file on the IFS
CPYTOSTMF FROMMBR('/QSYS.LIB/QS36F.LIB/WBSRC.FILE/WBSRC.MBR') TOSTMF('/FLTRNSFR/WBSRC.CSV') STMFOPT(*REPLACE) DBFCCSID(*FILE) STMFCODPAG(00819) ENDLINFMT(*CRLF)
This works fine. To make it convert to a .xls file is it simply a matter of changing the file extension and stmfcodpag? Is so, what is the code? Or else how is it done?
Thanks for your help.
ldb
I have been sucessful converting both flat files(sys/36 files) and external described files to .csv files and then sending them to various sites via email or FTP using commands in a CL program. Some sites require "true" .xls files. I know that there is software that can be purchased to do this, my client already has it. However, I would like to know if I can do it directly on the 400. Here are the commands I use to convert an external defined file to .csv
1.) Copy data file into a source file to add delimiters.
CPYTOIMPF FROMFILE(QS36F/WBDATA) TOFILE(QS36F/WBSRC) MBROPT(*REPLACE) RCDDLM(*EOR) DTAFMT(*DLM) STRDLM(*DBLQUOTE) FLDDLM(',')
2.) Then copy the source file which now contains data and delimiters into a stream file on the IFS
CPYTOSTMF FROMMBR('/QSYS.LIB/QS36F.LIB/WBSRC.FILE/WBSRC.MBR') TOSTMF('/FLTRNSFR/WBSRC.CSV') STMFOPT(*REPLACE) DBFCCSID(*FILE) STMFCODPAG(00819) ENDLINFMT(*CRLF)
This works fine. To make it convert to a .xls file is it simply a matter of changing the file extension and stmfcodpag? Is so, what is the code? Or else how is it done?
Thanks for your help.
ldb
Comment