BookmarkSubscribeRSS Feed
ThomasH
Calcite | Level 5
Hi,

I am trying to build some kind of workflow handling and would like to request your input on the following scenario:

There is 1 job A, which includes (via %include) 3 jobs B1, B2, B3 sequentially in a loop.

Job A is executed

Job A includes B1
B1 checks for a condition (if true: continue with job, set a flag F = 0 / if false:
abort only B1, set a flag F = 1)
Job A includes B2
B2 checks F (if 0, continue / if 1, abort only B2)
B3 as B2

Job A ends

Questions:
- does the usage of "%abort return" work for the given scenario or should I consider anything else?
- is "%global F" sufficient to define it as a variable available throughout B1 - B3?

A is executed in batch mode.

Any hint would be appreciated.

Thanks and regards,
Thomas Message was edited by: ThomasH
2 REPLIES 2
LinusH
Tourmaline | Level 20
> - does the usage of "%abort return" work for the
> given scenario or should I consider anything else?
Abort will terminate the current SAS session. %include will run your jobs within the original session, therefore will your whole workflow terminate at abort return.

> - is "%global F" sufficient to define it as a
> variable available throughout B1 - B3?
Yes, since it will be declared as global in the "whole" session (see above).

/Linus
Data never sleeps
ThomasH
Calcite | Level 5
Thanks,

%abort without any argument does the job.

Thomas

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