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
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;
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.