![]() |
Macros for SAS Application Developers
https://github.com/sasjs/core |
abort gracefully according to context More...
Go to the source code of this file.
Configures an abort mechanism according to site specific policies or the particulars of an environment. For instance, can stream custom results back to the client in an STP Web App context, or completely stop in the case of a batch run. For STP sessions
The method used varies according to the context. Important points:
[in] | mac= | (mp_abort.sas) To contain the name of the calling macro. Do not use &sysmacroname as this will always resolve to MP_ABORT. |
[out] | msg= | message to be returned |
[in] | iftrue= | (1=1) Condition under which the macro should be executed |
[in] | errds= | (work.mp_abort_errds) There is no clean way to end a process within a include called within a macro. Furthermore, there is no way to test if a macro is called within a include. To handle this particular scenario, the include should be switched for the mp_include.sas macro. This provides an indicator that we are running a macro within a %include (_SYSINCLUDEFILEDEVICE ) and allows us to provide a dataset with the abort values (msg, mac). We can then run an abort cancel FILE to stop the include running, and pass the dataset back to the calling program to run a regular %mp_abort(). The dataset will contain the following fields:
|
[in] | mode= | (REGULAR) If mode=INCLUDE then the &errds dataset is checked for an abort status. Valid values:
|
Definition in file mp_abort.sas.