BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
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
ScottH_SAS
SAS Employee
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 551 views
  • 0 likes
  • 3 in conversation