Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mp_validatecol.sas File Reference

Used to validate variables in a dataset. More...

Go to the source code of this file.

Detailed Description

Useful when sanitising inputs, to ensure that they arrive with a certain pattern. Usage:

data test;
  infile datalines4 dsd;
  input;
  libds=_infile_;
  %mp_validatecol(libds,LIBDS,is_libds)
datalines4;
some.libname
!lib.blah
%abort
definite.ok
not.ok!
nineletrs._
;;;;
run;
Parameters
[in]incolThe column to be validated
[in]ruleThe rule to apply. Current rules:
  • ISNUM - checks if the variable is numeric
  • LIBDS - matches LIBREF.DATASET format
[out]outcolThe variable to create, with the results of the match

SAS Macros

Version
9.3

Definition in file mp_validatecol.sas.