The SAS Output Delivery System and reporting techniques

generate PDF FILES for eac value of BYGROUP

Reply
N/A
Posts: 0

generate PDF FILES for eac value of BYGROUP

Could you please help me in generating separate PDF files for each value of BYGROUP using SASV8.2?

Eg: the variable CLTDEPT has values ABB, AZA, WYE etc..

ABB should be in PDF file1, AZA in PDF file2 and WYE in PDF file3.

Please find below the sample code.
DATA WORK.PFILE ( KEEP = INLINE DATABASE BILLCODE REPTYPE SEQNO JOB);
INFILE INTERM;
PROC SORT DATA = WORK.PFILE ;                    
 BY CLTDEPT BILLCODE DATABASE JOB REPTYPE SEQNO;
FILENAME PROJECT 'UNRM.CCCCCC.PDF';
ODS PDF FILE=PROJECT;                           
OPTIONS PS=96;                                    
DATA _NULL_;                                      
    FILE PRINT;                                   
    SET WORK.PFILE;                               
    FORMAT   INLINE $CHAR133.;                    
    INFORMAT INLINE $CHAR133.;                    
IF SUBSTR(LEFT(INLINE),1,5)='* * *' THEN PUT _PAGE_;
    PUT @1 INLINE $CHAR133.;                      
        RUN;                                          
ODS PDF CLOSE;            
                        
PS: In SAS V9 we can use NEWFILE option to create separate PDF files. Is there any way in SAS 8.2? Can we use macros to generate separate PDF files? Is so how?
SAS Super FREQ
Posts: 8,864

Re: generate PDF FILES for eac value of BYGROUP

Posted in reply to deleted_user
Hi:
NEWFILE= did not work for PDF in SAS 8.2 (or it was experimental).

So, SAS Macro would be the correct way to create your files. Since it looks like you are on a mainframe system, I would also recommend that you convert your program to use the FILE PRINT ODS syntax, instead of FILE PRINT and PUT statements.

Your best bet for a quick answer to this question is to contact Tech Support. They can help with macro code AND with the syntax for ODS. The reason I suggest this is that PUT _PAGE_ in SAS 8.2 did not work exactly the same way with ODS as it did to the OUTPUT window or LISTING FILE (or SYSOUT).

For information on contacting Tech Support, go to: http://support.sas.com/techsup/contact/index.html

cynthia
SAS Employee
Posts: 50

Re: generate PDF FILES for eac value of BYGROUP

Posted in reply to deleted_user
This is a Good news / Bad news type of answer.

First the bad news ...

I can't think of a way to do what you want in 8.2. Newfile became experimental in the 9.1 release.

now the good news....

Contact Technical Support as they might know of a way to code a macro to help you get around it in 8.2
Ask a Question
Discussion stats
  • 2 replies
  • 129 views
  • 0 likes
  • 3 in conversation