DATA Step, Macro, Functions and more

How to conditionally abort a SAS program ? (macro)

Reply
Regular Contributor
Posts: 190

How to conditionally abort a SAS program ? (macro)

 
Super Contributor
Posts: 345

Betreff: How to conditionally abort a SAS program ? (macro)

By using %abort or %return.

 

 

%macro narf(Condition);
  %put Random debug print;
  %if &Condition = stop_value %then %return;
  %put After return;
%mend;

%narf(no_stop);
%put ------------------------------------;
%narf(stop_value);
Regular Contributor
Posts: 190

Betreff: How to conditionally abort a SAS program ? (macro)

Posted in reply to andreas_lds

thank you for the response can u please elobrate am new in using macros

can write in detail about the program. thanks 

Super User
Super User
Posts: 7,977

Betreff: How to conditionally abort a SAS program ? (macro)

Why would you want to?  You have provided nothing in terms of what you are trying to do, how things are running, what environment you are using etc.  I have yet to find a valid scenario where using one of the abort statements is necessary, and if my logchecker came across that is pulled out as an error.  Provide information about what you want to do and why, and we will see if there are better solutions.

Regular Contributor
Posts: 190

Betreff: How to conditionally abort a SAS program ? (macro)

Posted in reply to andreas_lds
hello betreff
can u explain ur program thanks Smiley Happy
Super Contributor
Posts: 345

Betreff: How to conditionally abort a SAS program ? (macro)

Ask a Question
Discussion stats
  • 5 replies
  • 225 views
  • 0 likes
  • 3 in conversation