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

I have a program which I need to run daily. So, I scheduled a trial run for it on SAS EG, and it approximately usually takes 1 hour to run. It is 10 mins past the run start time now, and how do I now confirm whether the program is running at all or not? 

I am using SAS EG on Unix server.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

You need to log on to the server with SSH.

Then enter the command

crontab -e

which opens your crontab file with the vi editor.

There, enter your command as described in https://help.ubuntu.com/community/CronHowto#:~:text=A%20crontab%20file%20is%20a,them%20in%20the%20sy... 

 

I would recommend to set up an infrastructure in your home directory, e.g.

sas
log
script

for SAS programs, logs and script files.

script files are simple text files that have their execute bit set (done with

chmod u+x $HOME/script/scriptfile

) and contain the SAS call, something like

/sas/Lev1/SASApp/BatchServer/sasbatch $HOME/sas/myprog.sas -log $HOME/log/myprog.log

so you then enter

0 5 * * * $HOME/script/scriptfile

in the crontab to run the program daily at 05:00.

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

Log on to the UNIX server via SSH (e.g. with PUtty). Use your Enterprise Guide credentials.

Run this:

ps -ef|grep userid

where userid is from your EG credentials.

 

Personally, I would do this differently:

  • save your project code to one single .sas file on the server
  • create a shell script on the server that runs the code, including a dedicated name/location for the log file; include the run date/time in the log file name
  • schedule this with crontab

that way you get a clear documentation of the executions (if a cron job fails, mail is sent to your UNIX user), and the scheduling does not rely on your desktop being switched on.

 

Shradha1
Obsidian | Level 7
Would you kindly explain the scheduling with crontab? I have never used it and definitely want to follow the procedure you mentioned, as its more efficient.
Kurt_Bremser
Super User

You need to log on to the server with SSH.

Then enter the command

crontab -e

which opens your crontab file with the vi editor.

There, enter your command as described in https://help.ubuntu.com/community/CronHowto#:~:text=A%20crontab%20file%20is%20a,them%20in%20the%20sy... 

 

I would recommend to set up an infrastructure in your home directory, e.g.

sas
log
script

for SAS programs, logs and script files.

script files are simple text files that have their execute bit set (done with

chmod u+x $HOME/script/scriptfile

) and contain the SAS call, something like

/sas/Lev1/SASApp/BatchServer/sasbatch $HOME/sas/myprog.sas -log $HOME/log/myprog.log

so you then enter

0 5 * * * $HOME/script/scriptfile

in the crontab to run the program daily at 05:00.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2217 views
  • 0 likes
  • 2 in conversation