1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-15 16:14:36 +00:00

feat(*): recreate library as scoped package

This commit is contained in:
Krishna Acondy
2020-07-07 21:27:24 +01:00
commit 8beb0048a3
144 changed files with 30478 additions and 0 deletions

32
base/mf_existvar.sas Executable file
View File

@@ -0,0 +1,32 @@
/**
@file
@brief Checks if a variable exists in a data set.
@details Returns 0 if the variable does NOT exist, and return the position of
the var if it does.
Usage:
%put %mf_existvar(work.someds, somevar)
@param libds (positional) - 2 part dataset or view reference
@param var (positional) - variable name
@version 9.2
@author Allan Bowe
**/
%macro mf_existvar(libds /* 2 part dataset name */
, var /* variable name */
)/*/STORE SOURCE*/;
%local dsid rc;
%let dsid=%sysfunc(open(&libds,is));
%if &dsid=0 or %length(&var)=0 %then %do;
%put %sysfunc(sysmsg());
0
%end;
%else %do;
%sysfunc(varnum(&dsid,&var))
%let rc=%sysfunc(close(&dsid));
%end;
%mend;