Use the following sample CL program to convert an AFP report to a PDF with the CNVNUM and CPYAFPPDF commands:
PGM                                           
                                                     
/******************************************************/   
/* Declare Spool File Retrieval Variables          */   
/******************************************************/   
       DCL        VAR(&NEWSPOOL) TYPE(*CHAR) LEN(10) 
       DCL        VAR(&NEWJOB) TYPE(*CHAR) LEN(10)   
       DCL        VAR(&NEWUSER) TYPE(*CHAR) LEN(10)  
       DCL        VAR(&NEWNBR) TYPE(*CHAR) LEN(6)    
       DCL        VAR(&NEWSPNM) TYPE(*CHAR) LEN(6)   
                                                     
/******************************************************/   
/* Run Report Program                                  */ 
/* SAMPLE COMMAND BELOW                  */
/*Use your generation command here  */
/******************************************************/   
        CALL PGM(RPT100)    
                                                     
/******************************************************/   
/* RETREIVE SPOOL ATTRIBUTES FROM NEW SPOOL FILE      */   
/* TO GET THE ACTUAL PAGE COUNT ON THE NEW FILE       */   
/******************************************************/   
       CNVNUM     SPLF(RPT100P) JOB(*) SPLNBR(*LAST)
                    RTNSPLF(&NEWSPOOL) RTNJOBNAME(&NEWJOB)
                    RTNJOBUSER(&NEWUSER) RTNJOBNUM(&NEWNBR)
                    RTNSPLNUM(&NEWSPNM)              

/******************************************************/      
/* Convert report to PDF         */      
/******************************************************/      
CPYAFPPDF FILE(&NEWSPOOL)  +
                    JOB(&NEWNBR/&NEWUSER/&NEWJOB) +     
                    SPLNBR(&NEWSPNM)

       ENDPGM
Still have questions? We can help. Submit a case to technical support

Last Modified On:
You don't have the appropriate permissions.
No, open a new Support Case