BookmarkSubscribeRSS Feed
AnnaShami
Fluorite | Level 6

Hi,

I am trying to save my log and ouput programmitcally to a file using following codes, as this used to work just fine on PC SAS:

I don't see any error as such or notes, but still I don't see any file created at the specified location:


OUTFILE       "C:\output.lst";

LOGFILE       "C:\log.log"

'OUT; FILE OUTFILE';

'LOG; FILE LOGFILE';


Thanks

Aruna

4 REPLIES 4
AnnaShami
Fluorite | Level 6


Looks like part of it didn't copy over ..here is the whole code:

FILENAME OUTFILE       "C:\output.lst";

FILENAME LOGFILE       "C:\log.log"


DM 'OUT; FILE OUTFILE';

DM 'LOG; FILE LOGFILE';

Tom
Super User Tom
Super User

That would only work while running interactively so that Display Manager is running. If you are running a batch program or submitting to an execution server then there is no display manager to run the DM comands.

You could use

PROC PRINTTO log = "C:\log.log" print = "C:\output.lst";

run;

But you would need to run that BEFORE the code runs, not after.

AnnaShami
Fluorite | Level 6

Thanks Barnipaz and Tom.

We have EG SAS on the server. Does that mean the codes I had initially won't work on the server?

Second, I tried Printto it worked 🙂

Thanks

Barnipaz
Obsidian | Level 7

You could check the proc printto.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 1116 views
  • 9 likes
  • 3 in conversation