BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
6 REPLIES 6
LawrenceHW
Quartz | Level 8
Try PROC PRINTTO with a fileref.
Cynthia_sas
Diamond | Level 26
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
LawrenceHW
Quartz | Level 8
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.
deleted_user
Not applicable
i don't think these examples work for IBM Mainframe
Cynthia_sas
Diamond | Level 26
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
deleted_user
Not applicable
the proc printto worked but the ODS didn't

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1739 views
  • 0 likes
  • 3 in conversation