BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ivy
Quartz | Level 8 Ivy
Quartz | Level 8

Hello,

I output my log to an external log file and reset to the default SAS log at end of program.

proc printto new log="&logref" print="&lstref";
run;

proc printto;

run;

I am wondering whether I can review the external log file in SAS log window at end of the program. Import external log ? 

Thanks

Ivy

 

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12

How about these ways.

 

1. Use the X command to open the log file in a different application.

 

x "notepad &logref";

 

2. Save the log file with DM statement instead of PROC PRINTTO.

proc printto new print="&lstref";
run;


DM "LOG; FILE ""&logref"" ";/* at end of program */

This does not work in batch mode.

 

3. Read the log file with the INFILE statement and output it to the log.

filename f "&logref";
data _null_;
  infile f;
  input;
  putlog _infile_;
run;
filename f;

 

View solution in original post

2 REPLIES 2
japelin
Rhodochrosite | Level 12

How about these ways.

 

1. Use the X command to open the log file in a different application.

 

x "notepad &logref";

 

2. Save the log file with DM statement instead of PROC PRINTTO.

proc printto new print="&lstref";
run;


DM "LOG; FILE ""&logref"" ";/* at end of program */

This does not work in batch mode.

 

3. Read the log file with the INFILE statement and output it to the log.

filename f "&logref";
data _null_;
  infile f;
  input;
  putlog _infile_;
run;
filename f;

 

Ivy
Quartz | Level 8 Ivy
Quartz | Level 8
Thank you very much !

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 603 views
  • 1 like
  • 2 in conversation