Created
November 2, 2015 22:59
-
-
Save t-student/36ac3179d469cf28c447 to your computer and use it in GitHub Desktop.
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
* Sort the table columns alphabetically ; | |
proc contents data=Newcoach1t1 out=col_names noprint; run; | |
proc contents data=Newcoach1t1 out=col_names(keep=name ) noprint; run; | |
proc sort data=col_names; by name; run; | |
data _null_; | |
set col_names; | |
by name; | |
retain sorted_cols; | |
length sorted_cols $2500.; | |
if _n_ = 1 then sorted_cols = name; | |
else sorted_cols = catx(' ', sorted_cols, name); | |
call symput('sorted_cols', sorted_cols); | |
run; | |
data Newcoach1t1; | |
retain &sorted_cols; | |
set Newcoach1t1; | |
run; | |
data Newcoach1t1b; | |
set Newcoach1t1; | |
run; | |
proc datasets lib=work; | |
modify Newcoach1t1b; | |
attrib _all_ label=''; | |
run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment