BookmarkSubscribeRSS Feed
sasikala
Obsidian | Level 7

Hi Experts,

I need to keep sas session alive for all time and in some time frequency (Call sleep()) call macro and execute it.

I am thinking to schedule the SAS script in unix nohup and clear sas tmp space frequently part sas script.

Could you please let me know if there any disadvantage of keeping SAS session alive for all time by nohup. 

Thanks,

Sasikala.k

 

 

 

7 REPLIES 7
Quentin
Super User

Why keep it alive forever (while sleeping between calls)?  Wouldn't it be better (use less resources) to just program it as a batch job that runs once, and then schedule the job to run with whatever frequency you want?

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
sasikala
Obsidian | Level 7

Thanks for the update.

My requirement is , need to check the DB table entry, in case new record inserted by other job, need to fetch that record immediately and execute the SAS job load the data into DB.

My sas job should be running independently to check entry in DB table .. if new entry present , It should load data immediately

Thanks,

Sasi.k

 

 

SASKiwi
PROC Star

How frequently do you wish to run this process? Every minute, every 5 minutes, every 10 minutes? For example if you run it every minute that is 1,440 times each day. That means if you schedule a "single-pass" SAS job to do this you will end up with 1,440 SAS log files to manage per day.

 

I suggest perhaps scheduling this application to run daily starting at midnight (or another time to suit your preference) and looping at the required frequency for 24 hours. That way SAS log management is a lot easier (one log file per day) and job reliability is unlikely to be compromised.

sasikala
Obsidian | Level 7

Thanks! This helps lot

sasikala
Obsidian | Level 7

Hi KurtBremser,

The DB records will be inserted by other process and I don't have control to update or modify it to schedule my job along with it.so my job should run independently, if some new entry is present in the DB table, need to fetch it and invoke the data load process.

Thanks,

Sasi.K

 

Kurt_Bremser
Super User

On UNIX, you have cron at your disposal. Use that.

A SAS session can crash for a lot of reasons (or simply be terminated by a system reboot). A crontab entry is there and will stay there.

With separate batch SAS sessions, there's no need to clean out WORK.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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