BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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 ?
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
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
ArtC
Rhodochrosite | Level 12
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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1193 views
  • 0 likes
  • 3 in conversation