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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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