|
Macros for SAS Application Developers
https://github.com/sasjs/core |
Checks an input filter table for validity. More...
Go to the source code of this file.
Performs checks on the input table to ensure it arrives in the correct format. This is necessary to prevent code injection. Will update SYSCC to 1008 if bad records are found, and call mp_abort.sas for a graceful service exit (configurable).
Used for dynamic filtering in Data Controller for SAS®.
Usage:
%mp_filtercheck(work.filter,targetds=sashelp.class,outds=work.badrecords)
The input table should have the following format:
| GROUP_LOGIC:$3 | SUBGROUP_LOGIC:$3 | SUBGROUP_ID:8. | VARIABLE_NM:$32 | OPERATOR_NM:$10 | RAW_VALUE:$4000 |
|---|---|---|---|---|---|
| AND | AND | 1 | AGE | = | 12 |
| AND | AND | 1 | SEX | <= | 'M' |
| AND | OR | 2 | Name | NOT IN | ('Jane','Alfred') |
| AND | OR | 2 | Weight | >= | 7 |
Rules applied:
| [in] | inds | The table to be checked, with the format above |
| [in] | targetds= | The target dataset against which to verify VARIABLE_NM. This must be available (ie, the library must be assigned). |
| [out] | abort= | (YES) If YES will call mp_abort.sas on any exceptions |
| [out] | outds= | (work.badrecords) The output table, which is a copy of the &inds. table plus a REASON_CD column, containing only bad records. If bad records are found, the SYSCC value will be set to 1008 (a general data problem). Downstream processes should check this table (and return code) before continuing. |
Definition in file mp_filtercheck.sas.