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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 1214 views
  • 0 likes
  • 2 in conversation