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

Hi,

 

I have been using the below query to save my sas logs. However, while I run the code, I can not view the live log. Please help.

 


proc printto log="C:\Reports\LK55_&sysdate..txt" New;
run;

 

option obs=max;
proc import datafile= "//<<path>>/LK.xlsx"
out=LK
dbms=xlsx replace;
run;

 

I have also used Proc printo;run; before import query, this is giving the live log but the saved logs is having NIL data in this case.Is there any way to actually get both the logs..?

1 ACCEPTED SOLUTION

Accepted Solutions
s_lassen
Meteorite | Level 14

You could write the file to the log afterwards, e.g.:

Filename mylog "C:\Reports\LK55_&sysdate..txt";

Proc printto log=mylog new;
run; 

/* your code here */

Proc printto;run;

data _null_;
  infile mylog;
  input;
  put _infile_;
run;

View solution in original post

5 REPLIES 5
Kurt_Bremser
Super User

Since you are redirecting the whole log, it's not sent to EG anymore. To have a complete log written to disk, and still display in EG, you need to work with the logconfig.xml of the workspace server.

andreas_lds
Jade | Level 19

If you can't edit logconfig.xml of the workspace server, as @Kurt_Bremser suggested, you could add a step in EG to export the Log

automatically. eg_export_log.png

 

 

 

s_lassen
Meteorite | Level 14

You could write the file to the log afterwards, e.g.:

Filename mylog "C:\Reports\LK55_&sysdate..txt";

Proc printto log=mylog new;
run; 

/* your code here */

Proc printto;run;

data _null_;
  infile mylog;
  input;
  put _infile_;
run;
don21
Quartz | Level 8

Works like charm, Thanks a lot!!

SASKiwi
PROC Star

If you run your programs in batch mode then no re-direction of logs is required AND you can monitor live logs as well. Using SAS Management Console and the batch program scheduler is the best option for this assuming to use a remote SAS server.

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
  • 5 replies
  • 3800 views
  • 0 likes
  • 5 in conversation