Macros for SAS Application Developers
https://github.com/sasjs/core
mp_reseterror.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Reset when an err condition occurs
4  @details When building apps, sometimes an operation must be attempted that
5  can cause an err condition. There is no try catch in SAS! So the err state
6  must be caught and reset.
7 
8  This macro attempts to do that reset.
9 
10  @version 9.2
11  @author Allan Bowe
12 
13 **/
14 
15 %macro mp_reseterror(
16 )/*/STORE SOURCE*/;
17 
18 options obs=max replace nosyntaxcheck;
19 %let syscc=0;
20 
21 %if "&sysprocessmode " = "SAS Stored Process Server " %then %do;
22  data _null_;
23  rc=stpsrvset('program error', 0);
24  run;
25 %end;
26 
27 %mend mp_reseterror;