DATA Step, Macro, Functions and more

Job handling / workflow questions

Reply
Contributor
Posts: 51

Job handling / workflow questions

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
Super User
Posts: 5,256

Re: Job handling / workflow questions

> - 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
Contributor
Posts: 51

Re: Job handling / workflow questions

Thanks,

%abort without any argument does the job.

Thomas
Ask a Question
Discussion stats
  • 2 replies
  • 109 views
  • 0 likes
  • 2 in conversation