Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_abort.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Abort, ungracefully
4 @details Will abort with a straightforward %abort if the condition is true.
5
6 Not advised in SASjs web services: %abort gives the program no opportunity to
7 capture the failure and return it to the client, so the caller sees a failed
8 request with no message. Use mp_abort.sas in that context - it writes the
9 standard SASjs abort JSON (message, calling macro, SYSCC and a log extract) to
10 _webout before ending the step.
11
12 @param [in] mac= (mf_abort.sas) Name of calling macro (is printed to the log)
13 @param [in] msg= ( ) Additional string to print to the log
14 @param [in] iftrue= (%str(1=1)) Conditional logic under which to perform the
15 abort
16
17 <h4> Related Macros </h4>
18 @li mp_abort.sas
19
20 @version 9.2
21 @author Allan Bowe
22 @cond
23**/
24
25%macro mf_abort(mac=mf_abort.sas, msg=, iftrue=%str(1=1)
26)/des='ungraceful abort' /*STORE SOURCE*/;
27
28 %if not(%eval(%unquote(&iftrue))) %then %return;
29
30 %put NOTE: /// mf_abort macro executing //;
31 %if %length(&mac)>0 %then %put NOTE- called by &mac;
32 %put NOTE - &msg;
33
34 %abort;
35
36%mend mf_abort;
37
38/** @endcond */