Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
I am trying to send an iseries DB file to another server in text, non-iseries on our system network.
Here is my code - why am I getting that error message and am I even using the right process?
CPYTOSTMF FROMMBR('XXXXXJRT5') TOSTMF('\\pcts080157.amre.com\AS400Logs\xxxxxjrt5.txt') STMFOPT(*ADD) STMFCODPAG(*PCASCII)
Object not a QSYS.LIB object. Object is /XXXXXJRT5.
Object not copied. Object is XXXXXJRT5.
Thanks in advance!
That stmt would copy it to the IFS, not to another system.
Why not just FTP it? FTP would handle the EBCDIC to ASCII conversion.
Ok , Bob, that is what I will do.
THanks!
Like Bob said, FTP can handle it directly.
For reference, the FROMMBR is the IFS name, '/QSYS.LIB/somelib.LIB/XXXXXJRT5.FILE/XXXXXJRT5.MBR'.
If your file has packed or binary fields, you can't really FTP as text, and CPYTOSTMF won't work either. You'll need CPYTOIMPF.
1. The CPYTOSTMF command only works on source files or some like defined file.
2. You need to define the FROMMBR using the IFS style naming convention.
3. You cannot use the \\server target for the copy, but you can use the /QNTC/server style target if you have NetServer running and defined to your local network properly.
CPYTOSTMF FROMMBR('/qsys.lib/mylib.lib/mysrcf.file/mymbr.mbr')
TOSTMF('/QNTC/otherserver/othershare/filename.txt')
STMFOPT(*ADD) STMFCCSID(*PCASCII)
The CPYTOIMPF works as well
CPYTOIMPF FROMFILE(MYLIB/MYFILE)
TOSTMF('/QNTC/otherserver/othershare/filename.txt')
RCDDLM(*CRLF) DTAFMT(*FIXED)