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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1353 views
  • 0 likes
  • 2 in conversation