23%macro mf_getschema(libref
25 %local dsid vnum rc schema;
27 %let libref = %upcase(%scan(&libref, 1, %str(.)));
29 %let dsid=%sysfunc(open(sashelp.vlibnam(where=(
30 libname=
"%upcase(&libref)" and sysname=:
'Schema'
32 %
if (&dsid ^= 0) %then %
do;
33 %let vnum=%sysfunc(varnum(&dsid,SYSVALUE));
34 %let rc=%sysfunc(fetch(&dsid));
35 %let schema=%sysfunc(getvarc(&dsid,&vnum));
36 %put &libref. schema is &schema.;
37 %let rc= %sysfunc(close(&dsid));