Coping Mainframe Report File to ODS PDF file -- Problem with output PDF page formatting

Accepted Solution Solved
Reply
New Contributor C
New Contributor
Posts: 2
Accepted Solution

Coping Mainframe Report File to ODS PDF file -- Problem with output PDF page formatting

The input report file is 133 bytes with carriage control in position 1.

The output PDF doesn't appear to preserve the original spacing and formatting as the data does not line up under the column headers.

1JOB NAME: PXASDR86 Our Company RUN DATE: 2013/05/03 - 04:06:14

GENERIC : PLUSDR0B SALARY DEFERRAL EXTRACT REPORT PAGE: 1

PLAN : 999999 - The Big CHEESE USA INC. 401(K) PLAN
REG/DIV : MS/NU
0PARTICIPANT NAME EMPL NUM SOURCE AMOUNT ELIG DATE DFRL DATE DFRL TIME
0999-99-9999 GREEN, George  A - EMPLOYEE PRE TAX 3.0% 02/25/13 03/28/13 00:23
0999-99-9999 THOMAS, EDWIN ANTWAIN A - EMPLOYEE PRE TAX 3.0% 02/25/13 03/28/13 00:23

Here is my SAS

FILENAME OUTPDF "PASTEST.P105914.PDF2"                               

  DISP=NEW UNIT=TEMP RECFM=VB LRECL=259 BLKSIZE=27998;                

ODS LISTING CLOSE;                                                   

                                                                      

OPTIONS ORIENTATION=LANDSCAPE;                                       

                                                                      

DATA SASWORK.TRP;                                                    

    INFILE TRPDATA;                                                   

    INPUT @1 SALRPT $133.;                                            

    PUT _INFILE_;                                                     

    ODS PDF FILE=OUTPDF NOTOC PDF;                                    

RUN;                                                                 

    PROC PRINT DATA=SASWORK.TRP NOOBS                                 

    STYLE={RULES=NONE FRAME=VOID CELLSPACING=0};  /*TURNS OFF THE GRID

RUN;                                                                 

                                                                      

ODS _ALL_ CLOSE;                                                     

ODS LISTING;                                                         

                                                                      

DATA _NULL_;                                                         

    SET;                                                              

    FILE OUTFILE;                                                     

RUN;                                                                 


Accepted Solutions
Solution
‎05-23-2013 11:27 AM
New Contributor C
New Contributor
Posts: 2

Re: Coping Mainframe Report File to ODS PDF file -- Problem with output PDF page formatting

This is what we got to work

//STEP02   EXEC SAS,OPTIONS='MPRINT',WORK='30,90',REGION=4M           

//SASAUTOS DD DISP=SHR,DSN=TRPTEST.ALL.SASMAC                         

//         DD DISP=SHR,DSN=TRPPROD.ALL.SASMAC                         

//INPPDF   DD DSN=PASTEST.P105914.DFRL.REPT,DISP=SHR                  

//OUTPDF   DD DSN=PASTEST.SASPDF.TEMP2,                               

//            DISP=(,CATLG,CATLG),                                    

//            DCB=(LRECL=259,RECFM=VB,BLKSIZE=27998),                 

//            SPACE=(TRK,(1,1),RLSE),                                 

//            UNIT=DISK                                               

//SASWORK  DD DSN=PASTEST.SASWORK.SASWORK,                            

//            DISP=(NEW,CATLG,DELETE),                                

//            UNIT=DISK,VOL=SER=PROD01,                               

//            SPACE=(CYL,(75,5),RLSE)                                 

//SASLIST  DD SYSOUT=*                                                

//SYSIN    DD *                                                       

  PROC TEMPLATE;                                                      

  DEFINE STYLE STYLES.CUSTOM_SDB_PDF;                                 

  PARENT=STYLES.PRINTER;                                              

  REPLACE FONTS / 'DOCFONT' = ("COURIER",9PT);                        

*The following suppresses the grid from appearing on the SAS PDF report

  STYLE TABLE FROM OUTPUT /RULES = NONE CELLPADDING = 0PT            

                          CELLSPACING = 0 PT BORDERWIDTH = 0 PT;      

  END;                                                                

  RUN;                                                                

                                                                      

  OPTIONS NONUMBER NODATE PAGENO=1 ORIENTATION=LANDSCAPE LS=164 PS=60;

  ODS LISTING CLOSE;ODS NORESULTS;                                    

  ODS PDF FILE=OUTPDF NOTOC STYLE=STYLES.CUSTOM_SDB_PDF;              

                                                                      

  DATA SASWORK.TRP;                                                   

      INFILE INPPDF;                                                  

      INPUT @1 CNTL   $CHAR1.                                         

            @2 REST   $CHAR132.;                                      

        PUT _INFILE_;                                                 

  RUN;                                                                

*to allow page breaking when the mainframe carriage control column #1 is a "1" (indicating print on new page)  this extra code was written and to be used in the PROC REPORT step                                                                   

  DATA SASWORK.FINAL;                                                 

    SET SASWORK.TRP;                                                  

       IF (CNTL = '1') THEN                                           

       DO;                    

        PGBRK + 1;                                         

       END;                                                

       ELSE                                                

       DO;                                                 

        PGBRK + 0;                                         

       END;                                                

  RUN;              

                                      

* write ODS PDF file to OUTPDF DD statement in JCL -- NOHEADERS requested on the PDF's print report 'COLUMN headers'                                                           

  PROC REPORT DATA=SASWORK.FINAL OUT=OUTPDF NOWD NOHEADER  

*the next line fixes the alignment problem where the lines having leading spaces  weren't being carried forward on to the PDF file.  ASIS says to use input as is on the input file versus wiping out the blanks and left justifying.

   STYLE(COLUMN)={ASIS=ON};  

* the next line suppresses the printing of "The SAS System" title on the PDF report                            

    TITLE '               ';                               

    COLUMNS CNTL REST PGBRK;                               

    DEFINE CNTL  / DISPLAY NOPRINT;                        

    DEFINE REST  / DISPLAY;        

* the next two lines of code does a page advance breaks on the PDF report file and each report section prints on a separate page.                        

    DEFINE PGBRK / GROUP NOPRINT;                          

    BREAK AFTER PGBRK  / UL PAGE;                          

  RUN;                                                     

                                                           

  ODS _ALL_ CLOSE;                                         

  ODS LISTING;                                             

/*                                                        

View solution in original post


All Replies
N/A
Posts: 1

Re: Coping Mainframe Report File to ODS PDF file -- Problem with output PDF page formatting

The issue is with the font conversion, the MF font is being translated to Arial and creates the mismatch.  You'll need to create a style and change docfont to 'Lucida Console', 9pt. 

Solution
‎05-23-2013 11:27 AM
New Contributor C
New Contributor
Posts: 2

Re: Coping Mainframe Report File to ODS PDF file -- Problem with output PDF page formatting

This is what we got to work

//STEP02   EXEC SAS,OPTIONS='MPRINT',WORK='30,90',REGION=4M           

//SASAUTOS DD DISP=SHR,DSN=TRPTEST.ALL.SASMAC                         

//         DD DISP=SHR,DSN=TRPPROD.ALL.SASMAC                         

//INPPDF   DD DSN=PASTEST.P105914.DFRL.REPT,DISP=SHR                  

//OUTPDF   DD DSN=PASTEST.SASPDF.TEMP2,                               

//            DISP=(,CATLG,CATLG),                                    

//            DCB=(LRECL=259,RECFM=VB,BLKSIZE=27998),                 

//            SPACE=(TRK,(1,1),RLSE),                                 

//            UNIT=DISK                                               

//SASWORK  DD DSN=PASTEST.SASWORK.SASWORK,                            

//            DISP=(NEW,CATLG,DELETE),                                

//            UNIT=DISK,VOL=SER=PROD01,                               

//            SPACE=(CYL,(75,5),RLSE)                                 

//SASLIST  DD SYSOUT=*                                                

//SYSIN    DD *                                                       

  PROC TEMPLATE;                                                      

  DEFINE STYLE STYLES.CUSTOM_SDB_PDF;                                 

  PARENT=STYLES.PRINTER;                                              

  REPLACE FONTS / 'DOCFONT' = ("COURIER",9PT);                        

*The following suppresses the grid from appearing on the SAS PDF report

  STYLE TABLE FROM OUTPUT /RULES = NONE CELLPADDING = 0PT            

                          CELLSPACING = 0 PT BORDERWIDTH = 0 PT;      

  END;                                                                

  RUN;                                                                

                                                                      

  OPTIONS NONUMBER NODATE PAGENO=1 ORIENTATION=LANDSCAPE LS=164 PS=60;

  ODS LISTING CLOSE;ODS NORESULTS;                                    

  ODS PDF FILE=OUTPDF NOTOC STYLE=STYLES.CUSTOM_SDB_PDF;              

                                                                      

  DATA SASWORK.TRP;                                                   

      INFILE INPPDF;                                                  

      INPUT @1 CNTL   $CHAR1.                                         

            @2 REST   $CHAR132.;                                      

        PUT _INFILE_;                                                 

  RUN;                                                                

*to allow page breaking when the mainframe carriage control column #1 is a "1" (indicating print on new page)  this extra code was written and to be used in the PROC REPORT step                                                                   

  DATA SASWORK.FINAL;                                                 

    SET SASWORK.TRP;                                                  

       IF (CNTL = '1') THEN                                           

       DO;                    

        PGBRK + 1;                                         

       END;                                                

       ELSE                                                

       DO;                                                 

        PGBRK + 0;                                         

       END;                                                

  RUN;              

                                      

* write ODS PDF file to OUTPDF DD statement in JCL -- NOHEADERS requested on the PDF's print report 'COLUMN headers'                                                           

  PROC REPORT DATA=SASWORK.FINAL OUT=OUTPDF NOWD NOHEADER  

*the next line fixes the alignment problem where the lines having leading spaces  weren't being carried forward on to the PDF file.  ASIS says to use input as is on the input file versus wiping out the blanks and left justifying.

   STYLE(COLUMN)={ASIS=ON};  

* the next line suppresses the printing of "The SAS System" title on the PDF report                            

    TITLE '               ';                               

    COLUMNS CNTL REST PGBRK;                               

    DEFINE CNTL  / DISPLAY NOPRINT;                        

    DEFINE REST  / DISPLAY;        

* the next two lines of code does a page advance breaks on the PDF report file and each report section prints on a separate page.                        

    DEFINE PGBRK / GROUP NOPRINT;                          

    BREAK AFTER PGBRK  / UL PAGE;                          

  RUN;                                                     

                                                           

  ODS _ALL_ CLOSE;                                         

  ODS LISTING;                                             

/*                                                        

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 1267 views
  • 0 likes
  • 2 in conversation