Subscribe to keep this site alive! Under new management but as always, still 100% FREE. Anyone with the IBM i is a friend of ours.
The Challenge We want to bring down the comm session to a text file in the PC workstation so they can forward it as a readable EDI file Or to bring the comm session file to the IFS to be brought somewhere in the network.
The Solution: The SSNCPYPRT API report brings the comm session to a file 135 bytes long by default this is how to correct it.
1. Display the comm session to determine the length of it. It ca only be 80 or 132.
2. Create a temporary file to receive the SSNCPYPRT report with the length established in step 1
==>CRTPF FILE(QTEMP/TARGETFILE)
RCDLEN(132)
3. Run the SSNCPYPRT command with the file you created in step 2 as target.
==> SSNCPYPRT COMMNBR(2930000032)
OUTPUT(*OUTFILE)
TGTFILE(QTEMP/TARGETFILE)
4. Copy the file that contains the report to a stream file in the IFS specifying the target in TOSTMF.
==> CPYTOSTMF FROMMBR('/QSYS.lib/QTEMP.lib/targetfile.file/targetfile.mbr')
TOSTMF('/NancyIFS/targetTextfile.txt')
STMFOPT(*REPLACE)
STMFCCSID(*PCASCII)
ENDLINFMT(*FIXED)
5. Download the file (if needed), or move to another IFS location.
Also available on mass execution of these steps : Mass Sending of Communication Sessions to Text Files
OR Ask us to convert your ED816 report to a EDI Readable File HERE
Do you have a new CHALLENGE? Let us know HERE.