Hi,
Is there a possibility that log can be outputed into txt file and also that it will be written into te sas log window ?
i've tried to copy witth altlog but without success.
proc printto log='destination';run;
option altlog=log;
Since altlog can only be turned on when SAS is invoked, it depends on how your are running SAS.
If you have PC SAS, you can add -altlog "c:\mylog" to your SAS configuration file, which is a file like C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg. Or you can add -altlog "c:\mylog" to the icon you click to start a SAS session. It's similar for other OS.
The challenge is if you're using something like EG or SAS studio to connect to a SAS server, you would likely need to talk with your administrator, as they control configuration options that are applied when SAS starts.
filename mylog 'YourPathHere\log.txt';
proc printto log=mylog;
run;
/* Some SAS Code */
data MyData;
set sashelp.class;
run;
proc print data=MyData;
run;
Ah sorry, I missed the point here. I think the easiest is to use the ALTLOG System Option at startup in your Autoexec file.
Otherwise, here is a thread with alternative solutions 🙂
https://communities.sas.com/t5/SAS-Programming/Outputting-log-to-two-locations/td-p/301336
Agree, ALTLOG must be specified at startup. You can't use it in an options statement.
If you think it would be useful to be able to specify ALTLOG in an options statement, please add your vote to this ballot idea I submitted a few years back: https://communities.sas.com/t5/SASware-Ballot-Ideas/Allow-ALTLOG-to-be-specified-on-OPTIONS-statemen...
Since altlog can only be turned on when SAS is invoked, it depends on how your are running SAS.
If you have PC SAS, you can add -altlog "c:\mylog" to your SAS configuration file, which is a file like C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg. Or you can add -altlog "c:\mylog" to the icon you click to start a SAS session. It's similar for other OS.
The challenge is if you're using something like EG or SAS studio to connect to a SAS server, you would likely need to talk with your administrator, as they control configuration options that are applied when SAS starts.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.