Issue:
My program runs every hour. I need to create one log per day. So I need to append all the log generated by the code to a single file. Next day it should create the log in new file. How to do that?
Solution:
Use the logparm attribute as append. This option will append the log on the same file.-logparm "open=append"
The batch code will be:
/opt/sas/config/Lev1/SASApp/BatchServer/sasbatch.sh -sysin "myprogram.sas" -log "myprogram_`date +"%Y-%m-%d"`.log" -logparm "open=append" -print -noterminal
You can see I have used date command to make it daily. You can change the occurence using that command.
For more details about Logparam follow the below link:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm
Comments
Post a Comment