BookmarkSubscribeRSS Feed
prolifious
Obsidian | Level 7

 

 

on my unix box, 

 

/home/.../sas $

 

/home/.../sas $ runsas mysasprogs/myprog.sas

 

 

how do i deal with the "runsas" statement in cron?

 

i've tried

 

45 8 27 1 * /home/.../sas/mysasprogs/myprog.sas

45 8 27 1 * /home/.../sas $ runsas mysasprogs/myprog.sas

 

these arent working.. any help on how to deal with the runsas statement?

5 REPLIES 5
Kurt_Bremser
Super User
/home/.../sas $ 

This is your UNIX prompt. This don`t belong in your crontab.

runsas mysasprogs/myprog.sas

This is your command. This is what you need in the crontab.

But I would make sure that all files in a crontab are called by their absolute pathname (starting with the root - / - directory), as the current working directory of a crontab job might be different from the one you were in when testing.

prolifious
Obsidian | Level 7

Thank you very much...yes you're probably right.  I'm working with your advice, i'll get back soon.  I really appreciate your help.

prolifious
Obsidian | Level 7

totally correct about the script.  I spoke with someone within my shop and they're going to help me with that.  This is not as straight forward as I was initially told.  I've never worked with scripts before, so i need to start now!  Thanks again for your help.

ChrisHemedinger
Community Manager

I like to create a shell script (example: sasdaily.sh) file with all of the SAS jobs that I want to schedule at once.  Looks something like:

 

/usr/local/bin/sas_u8 -nodms -sysin "/u/myid/project/job1.sas"
/usr/local/bin/sas_u8 -nodms -sysin "/u/myid/project/job2.sas" 

To make this file executable, you need to run chmod (example: "chmod +x sasdaily.sh").  Then when I need to change/add the SAS jobs I'm running, I can just edit the .sh file and not mess with the crontab scheduler.

 

You can also combine a "change dir" command in your crontab with this as it runs:

 

30 06  *   *   1-5   cd /u/myid/project && ./sasdaily.sh

Then your logs/listings are grouped where you expect them, with your SAS files.

SAS Innovate 2025: Call for Content! Submit your proposals before Sept 16. Accepted presenters get amazing perks to attend the conference!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 3980 views
  • 4 likes
  • 3 in conversation