BookmarkSubscribeRSS Feed
nikhil_khanolkar
Calcite | Level 5

Hi,

I have created a Windows Batch file to execute the sas code, I want to append the DateTimestamp to the Log file name. Like "Name:Datetime.Log"

I have created below command in batch file.

"C:\Program Files\SAS\SASFoundation\9.2\sas.exe" -autoexec 'C:\Program Files\autoexec2.sas' -sysin "C:\Program Files\Usage per Channel.sas" -log "C:\Program Filesfile://\\GL1015018\SAS\Usage per Channel.

log"

When I tried to do it using Proc Print to in .SAS code and removed -log command in batch file, batch did not run properly.

Any help would be appreciated.

Thanks,

Nikhil

4 REPLIES 4
ballardw
Super User

Did you mean PROC PRINTTO? If not that may be an option if included in the program.

boemskats
Lapis Lazuli | Level 10

Hi Nikhil,

I ran into this a while ago - might help you, particularly as you're already writing batch files.

http://www.phusewiki.org/docs/2008/PAPERS/CC03.pdf

Hope this helps

Nik

Patrick
Opal | Level 21

Have a look into the directives for log names in the second half of below link.

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

boemskats
Lapis Lazuli | Level 10

This is the far better option. I think you need -logparm "rollover=session" in there for it to work

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
  • 4 replies
  • 2822 views
  • 0 likes
  • 4 in conversation