BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi, All!

I edit job, there are many steps, in the middle of the job, if some condition arrive, I will terminate the job, do not excute the following steps, such as:

data _null_;
set
format ....
run;
%macro ....
%mend....

%macro-name;

data _null_;
if(condition succeed);
exit(10); /* exit the job, do not execute following code */
run;

%exit(11); /* otherwise exit the job, do not execute following code. */

proc sql;
something deal.........;
run;
quit;
2 REPLIES 2
Patrick
Opal | Level 21
Look up:
- abort
- %abort
- endsas
- stop
Cynthia_sas
SAS Super FREQ
Hi:
In addition to Patrick's suggestions, I suggest you investigate the difference between a DATA step IF statement and a macro program %IF statement. Sometimes when you want to conditionally execute code, and if you are using macro programs, it is easier to test conditions and conditionally send code to the compiler using %IF.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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