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
SAS Super FREQ
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
SAS Super FREQ
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 931 views
  • 0 likes
  • 3 in conversation