BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
whymath
Lapis Lazuli | Level 10

I am designing an auto SAS program. I want it execute at the very first time I start SAS everyday and it should be executed only once. That is to say, I may start SAS several times this day, but the auto program will be executed only the first time I start SAS.

There are also some restricts:
1. It won't be executed if I have not use my SAS one day;
2. It won't be executed if I happen to working on SAS at daybreak;

Thanks for any hints.

1 ACCEPTED SOLUTION

Accepted Solutions
JuanS_OCS
Amethyst | Level 16

Hi @whymath,

 

I would say that scripting is your answer. You can script with SAS, bash, perl, python, powershell, anything that is of your preference and you feel more confident.

 

Having a file that record the times you started SAS together with the date will help with control.

That control will need to pass your validations, with some rules (something like IF clauses).

 

If needed, you can add some additional scripting to current script that start SAS, to write on that control file, so you know when it has been started.

 

If you cannot script, you can consider asking your colleagues with more expertise on that area, to support you with this task.

 

It should not be very complicated

 

View solution in original post

2 REPLIES 2
JuanS_OCS
Amethyst | Level 16

Hi @whymath,

 

I would say that scripting is your answer. You can script with SAS, bash, perl, python, powershell, anything that is of your preference and you feel more confident.

 

Having a file that record the times you started SAS together with the date will help with control.

That control will need to pass your validations, with some rules (something like IF clauses).

 

If needed, you can add some additional scripting to current script that start SAS, to write on that control file, so you know when it has been started.

 

If you cannot script, you can consider asking your colleagues with more expertise on that area, to support you with this task.

 

It should not be very complicated

 

SimonDawson
SAS Employee
This has some subtle sharp edges you might hit in cases where the SAS system is very very busy. A script could be quite prone to race conditions on busy servers. If you have lots of sessions spawning you might miscount if two sessions spawn at almost identical times.

If this is just your workstation you are unlikely to miscount because of races with many SAS sessions starting in the same microsecond.

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