Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
options mprint;
%macro lowcase(dsn);
%let dsid=%sysfunc(open(&dsn));
%let num=%sysfunc(attrn(&dsid,nvars));
%put #
data &dsn;
set &dsn(rename=(
%do i = 1 %to #
/*function of varname returns the name of a SAS data set variable*/
%let var&i=%sysfunc(varname(&dsid,&i));
&&var&i=%sysfunc(lowcase(&&var&i)) /*rename all variables*/
%let close=%sysfunc(close(&dsid));
%mend lowcase;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment