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

Hello,

What's the most efficient way to stop executing a fairly involved program at a specified time?  For example if I have a program with several macros and data steps would I use a batch command to stop the code at 7am PST?  Or is there an easy way to use a time parameter within SAS that would apply to the entire program (E.g. DO UNTIL loop)?  Any help or advice would be greatly appreciated.  Thank you!

Regards,

Bill

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

If the job is scheduled, you can set the scheduler to kill the job if whatever time condition you choose is met.

Otherwise, both the options you mention are valid.

The batch job has the advantage that you can choose the exact kill time.

Doing it as part of the program means the program has to wait between steps to check, which means:

1) you cannot be certain when a check will be made

2) if a step doesn't complete (infinite loop, processing too slow, bug) the check will never take place.

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

If the job is scheduled, you can set the scheduler to kill the job if whatever time condition you choose is met.

Otherwise, both the options you mention are valid.

The batch job has the advantage that you can choose the exact kill time.

Doing it as part of the program means the program has to wait between steps to check, which means:

1) you cannot be certain when a check will be made

2) if a step doesn't complete (infinite loop, processing too slow, bug) the check will never take place.

BillJones
Calcite | Level 5

KSharp and Chris:  Thanks for the suggestions.  I'll kill the job via batch command.  This seems to be the most efficient method.

Regards,

Bill

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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