DATA Step, Macro, Functions and more

Cannot view log in sas EG

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 80
Accepted Solution

Cannot view log in sas EG

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..?


Accepted Solutions
Solution
‎03-27-2018 05:01 AM
PROC Star
Posts: 274

Re: Cannot view log in sas EG

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


All Replies
Super User
Posts: 10,534

Re: Cannot view log in sas EG

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Valued Guide
Posts: 626

Re: Cannot view log in sas EG

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

automatically. eg_export_log.png

 

 

 

Solution
‎03-27-2018 05:01 AM
PROC Star
Posts: 274

Re: Cannot view log in sas EG

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;
Frequent Contributor
Posts: 80

Re: Cannot view log in sas EG

Works like charm, Thanks a lot!!

Super User
Posts: 4,016

Re: Cannot view log in sas EG

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 132 views
  • 0 likes
  • 5 in conversation