I have created a printer file (PRTF) and written an RPG program that uses the PRTF and generates a spool file. I want to copy the spool file to IFS so that from IFS I can download/email the spool file to the authorized person. I would appreciate it if anyone could help me with the steps to copy the spool file to IFS.
We can copy the spool file to IFS in three steps.
Step 1: Create a dummy physical file named PF1 in the QTEMP library using the CRTPF command.
CRTPF FILE(QTEMP/PF1) RCDLEN(200)
Step 2: Copy the spool file to the physical file using the command CPYSPLF.
CPYSPLF FILE(SpoolfileName) TOFILE(QTEMP/PF1)
JOB(JobNumber/JobUser/JobName) SPLNBR(1)
Step 3: Copy the physical file to the ifs using the CPYTOIMPF command.