Skip to content

Instantly share code, notes, and snippets.

@rudvfaden
Created May 25, 2021 07:02
Show Gist options
  • Save rudvfaden/7cafe389bed15819e0ee67198528635d to your computer and use it in GitHub Desktop.
Save rudvfaden/7cafe389bed15819e0ee67198528635d to your computer and use it in GitHub Desktop.
Retunrs sas engine from metadata
%macro getengine(libref);
%global ENGINE;
%let dsid=%sysfunc(open(sashelp.vlibnam(where=(libname="%upcase(&libref.)")),i));
%if (&dsid ^= 0) %then %do;
%let engnum=%sysfunc(varnum(&dsid,ENGINE));
%let rc=%sysfunc(fetch(&dsid));
%let engine=%sysfunc(getvarc(&dsid,&engnum));
&engine.
%let rc= %sysfunc(close(&dsid.));
%end;
%mend;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment