I previously had a question on getting ALTLOG to work and it was answered per this:
However i have noticed that when running SAS jobs in batch they do not pick up these settings and instead create a file with:
%l_%n_%Y%m%d_%H%M%s_%p.log
For example a correct and incorrect log:
From reading the article at: https://go.documentation.sas.com/?docsetId=lesysoptsref&docsetTarget=p0fmptfnyvi1n6n148u0qu4h44a5.ht...
I can see it states it should work for both in line and batch mode but when every i run a job in batch I get the above.
I have got around this by putting in the Batch script -
-ALTLOG "D:\SAS_Logs\%username%_%computername%_%stamp%.log"
But i wanted to know what I am getting wrong or does the config simply not work in batch like this?
Does this note from the documentation help?
Note: If you start SAS in batch mode or server mode and the LOGCONFIGLOC= option is specified, logging is done by the SAS logging facility. The traditional SAS log option LOGPARM= is ignored. The traditional SAS log option LOG= is honored only when the %S{App.Log} conversion character is specified in the logging configuration file. For more information, see The SAS Logging Facility in SAS Logging: Configuration and Programming Reference.
Apologies i meant to mention that in the original post, i read that as well but it mentions that this would be loaded on the start of a new SAS Session, however the option LOGCONFIGLOC is not in my config files and seeing as both Batch and Interactive sessions load from the same config i would expect them to currently act the same.
Additionally even if the config was set without me changing it, the llogs location i have set is a separate folder that is only specified using the -altlog location in the SAS.cfg file suggesting it is pulling that setting but simply not converting the various switches that have been set.
Unless this parameter is in a separate config? Just for clarity's sake this is not a planned deployment just a single server (4x single servers) using Base SA 9.4 no MetaData etc.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.