Macros for SAS Application Developers File Reference

Returns dataset variable list direct from header. More...

Go to the source code of this file.

Detailed Description

WAY faster than dictionary tables or sas views, and can also be called in macro logic (is pure macro). Can be used in open code, eg as follows:

%put List of Variables=%mf_getvarlist(sashelp.class);


List of Variables=Name Sex Age Height Weight

For a seperated list of column values:

  %put %mf_getvarlist(sashelp.class,dlm=%str(,),quote=double);



[in]libdsTwo part dataset (or view) reference.
[in]dlm=( ) Provide a delimiter (eg comma or space) to separate the variables
[in]quote=(none) use either DOUBLE or SINGLE to quote the results
[in]typefilter=(A) Filter for certain types of column. Valid values:
  • A Return All columns
  • C Return Character columns
  • N Return Numeric columns
Allan Bowe

Definition in file