Created
May 10, 2017 01:05
-
-
Save statgeek/6d5b69d8977fa6c2ee0654ac882d275c to your computer and use it in GitHub Desktop.
SAS - dynamically update labels to propcase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class; | |
set sashelp.class; | |
label name="NAme" sex="GEndeR" age="Age" height="HeiGht" weight="kilograms"; | |
run; | |
proc sql noprint; | |
select catx('=', name, quote(propcase(coalescec(trim(label), name)))) | |
into :label_list separated by " " from sashelp.vcolumn where libname='WORK' | |
and upper(memname)='CLASS'; | |
quit; | |
proc datasets lib=work nodetails nolist; | |
modify class; | |
label &label_list; | |
run; | |
quit; | |
proc print data=class label; | |
run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment