DATA Step, Macro, Functions and more

To end a job within a macro / Terminer un job dans une macro

Reply
N/A
Posts: 0

To end a job within a macro / Terminer un job dans une macro

I would like to add in a macro that the job ends if the value of a macro variable is equal to something and that it goes on if not.
What is the code for telling the job to end ?

Quel est le code pour interrompre un job dans une macro ?
SAS Super FREQ
Posts: 8,866

Re: To end a job within a macro / Terminer un job dans une macro

Posted in reply to deleted_user
Hi:
In part, this depends on the design of your SAS macro program and how you are executing the macro program. It also depends on what you mean by a "job" -- do you mean a single step program, a multi-step program or do you mean that you want to interrupt or stop a DATA step program in mid-stream??? You could also be using SAS DI Studio and want to conditionally execute a stored process that has been turned into a DI Studio job.

Without more information, it is hard to make specific recommendations. However, some good examples can be found here and they should at least point you in the right direction:
http://www.nesug.org/Proceedings/nesug09/cc/cc23.pdf
http://www2.sas.com/proceedings/sugi26/p074-26.pdf
http://www2.sas.com/proceedings/sugi30/154-30.pdf
http://www2.sas.com/proceedings/sugi30/021-30.pdf

cynthia
Valued Guide
Posts: 634

Re: To end a job within a macro / Terminer un job dans une macro

Posted in reply to deleted_user
In SAS9 the %ABORT statement has similar capabilities to the DATA step's ABORT statement. It is executable so it can be used with an %IF.

Different combinations of %ABORT and its options perform differently depending on the OS and the operating environment. Experiment.
Ask a Question
Discussion stats
  • 2 replies
  • 120 views
  • 0 likes
  • 3 in conversation