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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1492 views
  • 1 like
  • 2 in conversation