I have a scheduled job that runs in SAS MC on the scheduler. I get an email notification saying that my flow has started and that the log file can be found here:
[Command] : /opt/sas/sascompute/config/Lev1/SASApp/BatchServer/sasbatch.sh –log
The problem is that I don't have access to the above directory. How can I route this file somewhere else? Also, I don't see Server Manager in MC.
P.S. This is what my SAS MC looks like:
The log file location is specified in the Server Manager plug-in for SAS Management Console in the properties for the SAS DATA Step Batch Server. You would not be able to see the Server Manager plug-in unless you are a SAS Administrator or have otherwise been granted access to that plug-in. By default, the path is <SAS-configuration-directory>/Levn/SASApp/BatchServer/Logs. When you deploy a job the command is built using the path set in that configuration. It is possible for you to modify your job's command after that and change that option, or add the ALTLOG option to specify an additional location.
The log file location is specified in the Server Manager plug-in for SAS Management Console in the properties for the SAS DATA Step Batch Server. You would not be able to see the Server Manager plug-in unless you are a SAS Administrator or have otherwise been granted access to that plug-in. By default, the path is <SAS-configuration-directory>/Levn/SASApp/BatchServer/Logs. When you deploy a job the command is built using the path set in that configuration. It is possible for you to modify your job's command after that and change that option, or add the ALTLOG option to specify an additional location.
I certainly prefer ALTLOG when it can be used. I've found in some cases, ALTLOG doesn't do quite what I expect, for example with SAS Connect sessions where I've been unable to get log directives to work.
If for some reason ALTLOG didn't take care of your needs, Proc PRINTTO is another option.
Lastly, and it's not at all a preferred option, one can always create a FILENAME statement that points to a text file and then in one's code use a FILE statement with PUT commands to write one's own logging to the text file. Definitely a last ditch measure.
Jim
Thanks Greg!
Dumb question, when a program runs on the scheduler is it considered 'batch mode'? If so, I think I can add altlog to the beginning of my program in the options like this:
OPTIONS='LOG=<file> PRINT=<file> ALTLOG=<file>'
Does that sound right?
Thanks again,
@SAShole - Indeed that is correct. The scheduler runs SAS Data Step Batch Server jobs and changing the logs location is simply a matter of changing the Logs Directory option in the properties of the SAS Data Step Batch Server.
I'm trying to change the path to which logs are written for scheduled jobs submitted by users. I had updated the path in the SAS Datastep batch server properties under server manager in SMC. But still logs are written to the old directory. I believe changes in SMC does not require any service restart.
Do I need to update it somewhere else as well in SAS grid?
Does it require redeploying the jobs?
Thank you for your quick response, appreciate it!!
I redeployed my job, unscheduled and then scheduled it again from SMC. But still job logs are going to the old directory. Wondering if there is anything to change at PPM?
When I deploy a new job, its log is written to the new directory. But already existing job's logs are going to the old directory. I redeployed the job, unscheduled and scheduled its flow again, but still not working.
Hi @gwootton
The command was not updated even after redeploying the job. Found something interesting as well, when I select a different app server while redeploying a job, it is not updated in the command. It appears that SAS has release a hotfix #B6T013 (https://tshf.sas.com/techsup/download/hotfix/HF2/B6T.html#62194) to address this issue which is already deployed in our environment and has not fixed the issue.
Hi @gwootton
Yes, the hotfix is applied on both client and server machines. I could see the specific hotfix B6T013 in deploymentreg generated on the client machine.
Concerning the reset button, I could find it in SMC but when I click on it, I see the message "The command line property was set when deployed and cannot be reset. Redeploy the job for scheduling"
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.