The SAS Output Delivery System and reporting techniques

Output Proc Report to different text files

Reply
N/A
Posts: 0

Output Proc Report to different text files

I can only get my proc reports to go the the SASLIST in a batch mode. i would like to send each report to a different flat file.
Contributor
Posts: 49

Re: Output Proc Report to different text files

Try PROC PRINTTO with a fileref.
SAS Super FREQ
Posts: 8,743

Re: Output Proc Report to different text files

Hi:
OR, as an alternative to PROC PRINTTO, you could use:
[pre]
filename myoutfile 'xxxxxxx.yyyyy.zzzzzz.txt'; (z/OS) OR
filename myoutfile '/usr/bin/usr001/zzzzz.txt'; (UNIX) OR
filename myoutfile 'c:\temp\zzzzz.txt'; (Windows)

ODS LISTING FILE=myoutfile;
...code...
ODS LISTING;
[/pre]
cynthia
Contributor
Posts: 49

Re: Output Proc Report to different text files

True. I'm just so used to using PROC PRINTTO (spot the V6 programming traits) .... habit I guess. I think ODS is a far neater statement though.
N/A
Posts: 0

Re: Output Proc Report to different text files

i don't think these examples work for IBM Mainframe
SAS Super FREQ
Posts: 8,743

Re: Output Proc Report to different text files

Well, in fact they do. You might need to change your JCL and add a DD statement if you were allocating in batch.
[pre]
//MYOUTFIL DD DSN=XXXXXX.YYYYYY.ZZZZZZ.TXT,DISP=(NEW,CATLG),
// DCB=(.......),UNIT=SYSDA
[/pre]

then in your SAS code, you would have:
[pre]
ODS LISTING FILE=MYOUTFIL;
...sas code...
ODS LISTING;
[/pre]
OR
[pre]
PROC PRINTTO PRINT=MYOUTFIL; RUN:
...sas code...
PROC PRINTTO; RUN;
[/pre]

Where MYOUTFIL is the same as the DD name for the new sequential file that you would allocate. Then, you would have to use NDM or some other utility to FTP the output to a different platform. Or write the output to an AIX partition that the users could get to. Please take my JCL with a huge, gynormous grain of salt. My JCL days were back in the 80s. I know that there's a bunch in DCB like DSORG, and LRECL, but I just can't pull them out of my neurons right now.

cynthia
N/A
Posts: 0

Re: Output Proc Report to different text files

the proc printto worked but the ODS didn't
Ask a Question
Discussion stats
  • 6 replies
  • 122 views
  • 0 likes
  • 3 in conversation