BookmarkSubscribeRSS Feed
srapp88
Calcite | Level 5

I previously had a question on getting ALTLOG to work and it was answered per this:

 

https://communities.sas.com/t5/SAS-Programming/Setting-up-ALTLOG-in-SASV9-cfg-FIle/m-p/506426#M13576...

 

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:

 

SASLogs.JPG

 

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?

2 REPLIES 2
Tom
Super User Tom
Super User

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.

 

 

srapp88
Calcite | Level 5

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.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1874 views
  • 2 likes
  • 2 in conversation