Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_filtervalidate.sas File Reference

Checks a generated filter query for validity. More...

Go to the source code of this file.

Detailed Description

Runs a generated filter in proc sql with the validate option. Used in mp_filtercheck.sas in an fcmp container.

Built to support dynamic filtering in Data Controller for SAS®.

Usage:

data work.filtertable;
  infile datalines4 dsd;
  input GROUP_LOGIC:$3. SUBGROUP_LOGIC:$3. SUBGROUP_ID:8. VARIABLE_NM:$32.
    OPERATOR_NM:$10. RAW_VALUE:$4000.;
datalines4;
AND,AND,1,AGE,=,12
AND,AND,1,SEX,<=,"'M'"
AND,OR,2,Name,NOT IN,"('Jane','Alfred')"
AND,OR,2,Weight,>=,7
;;;;
run;

%mp_filtergenerate(work.filtertable,outref=myfilter)

%mp_filtervalidate(myfilter,sashelp.class)
Returns
The SYSCC value will be 1008 if there are validation issues. On an abort the message carries the reason and the clause that failed, so the inputs are visible without reading the log.
Parameters
[in]inrefThe input fileref to validate (generated by mp_filtergenerate.sas)
[in]targetdsThe target dataset against which to verify the query
[out]abort=(YES) If YES will call mp_abort.sas on any exceptions
[out]outds=(work.mp_filtervalidate) Output dataset containing the diagnostic message, if one exists. If this table contains any rows, there are problems!

SAS Macros

Related Macros

Version
9.3
Author
Allan Bowe

Definition in file mp_filtervalidate.sas.