1) Create a file to transfer the spool file data on the source system. RCDLEN is (at least) 1 char larger than width of report.
? CRTPF FILE(library/file) RCDLEN(length)
2) Save the spool file data to the transfer file on the source system.
? CPYSPLF FILE(splfname) TOFILE(library/file) JOB(jobnbr/user/jobname) SPLNBR(splfnbr) CTLCHAR(*FCFC) MBROPT(*REPLACE)
3) Send the transfer file from the source system to the target system via FTP, SAVF transfer, etc.
4) Set printer file to have the proper attributes (QSYSPRT for standard 132 char or less, otherwise create a printer file with the correct PAGESIZE and OVRFLW) and copy the spool file data to it from the transfer file.
? OVRPRTF FILE(prtf) OUTQ(outq) FORMTYPE(formtype) USRDTA(userdata) HOLD(hold) SAVE(save) SPLFNAME(splfname) CTLCHAR(*FCFC)
? CPYF FROMFILE(library/file) TOFILE(prtf)
SNDNETSPLF can be used if SNA Distribution Services is configured. This is what option 1=Send does from a WRKSPLF list.
More often nowadays, SNDTCPSPLF can be used to copy a spooled file to an output queue on another AS/400. The receiving system needs to have the proper server started – STRTCPSVR *LPD — in order to get the request across. The command can also send spooled files to other kinds of systems including PCs.
If automation is needed, remote output queues work through the same LPR/LPD protocol that is used by SNDTCPSPLF.