BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAShole
Pyrite | Level 9

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:

SAS MC.png

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ

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.

--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

13 REPLIES 13
gwootton
SAS Super FREQ

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.

--
Greg Wootton | Principal Systems Technical Support Engineer
jimbarbour
Meteorite | Level 14

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. 

https://go.documentation.sas.com/?docsetId=hostunx&docsetTarget=n17bp001b9i7scn0zvbx3jar94kb.htm&doc...

 

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

SAShole
Pyrite | Level 9

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,

SASKiwi
PROC Star

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

SASWayne
Quartz | Level 8

Hello @gwootton and @SASKiwi 

 

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?

gwootton
SAS Super FREQ
When a job is deployed its command line (including the log path) is written to the metadata object, so redeploying the job would need to occur to update the path there. You would then need to reschedule the job so the command line is updated in the schedule.
--
Greg Wootton | Principal Systems Technical Support Engineer
SASWayne
Quartz | Level 8

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?

SASWayne
Quartz | Level 8

@gwootton ,

 

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. 

gwootton
SAS Super FREQ
In the properties for the deployed job in SMC you should be able to see the command string, does it reflect the new log path? Here is an example from one of my deployed jobs, note the log path defined there:

<sas-config>/Lev1/SASApp/BatchServer/sasbatch.sh -log <sas-config>/Lev1/SASApp/BatchServer/Logs/sysget_ -batch -noterminal -logparm "rollover=session" -sysin <sas-config>/Lev1/SASApp/SASEnvironment/SASCode/Jobs/sysget.sas

This should be updated with the new log path when you redeploy, and when you schedule this is what is sent to the scheduling server to execute. if that command line has been manually modified, this could be preventing it from being populated by redeployment.
--
Greg Wootton | Principal Systems Technical Support Engineer
SASWayne
Quartz | Level 8

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.

 

 

gwootton
SAS Super FREQ
That is a hot fix for SAS Management Console, often this is run from a separate client system rather than the server. Did you confirm the hot fix was applied there?

Is the "Reset" button available when viewing the command line in SMC?
--
Greg Wootton | Principal Systems Technical Support Engineer
SASWayne
Quartz | Level 8

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"

gwootton
SAS Super FREQ
That message suggests the command hasn't been manually altered (which could prevent the redeploy from overwriting it).
At this point, you may wish to create a support track with SAS Technical Support, it seems like the schedule manager plugin isn't doing what it should. The workaround it seems would be to recreate the job.
--
Greg Wootton | Principal Systems Technical Support Engineer

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

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.

Discussion stats
  • 13 replies
  • 4622 views
  • 7 likes
  • 5 in conversation