I'm writing a macro that takes in a dataset with an unknown number of columns (both character and numeric), but it is known that 1 column is called obsId.
I'd like to proc transpose the contents of the entire table by ObsId, without knowing the names of the other columns. Is this doable without doing something crazy like looking it up in dictionary.columns?
Sample Dataset
ObsId Name Age Height
1 John 15 170
2 Joe 34 160
Desired Output
ObsId _name_ col1
1 Name John
1 Age 15
1 Height 170
2 Name Joe
2 Age 34
2 Height 160
Equivalent Code
proc transpose data=dataset;
by ObsId;
var Name Age Height;
run;
Again, I'd like to be able to do this with any generic dataset which has a column named ObsId and an unspecified number of other columns.
Any input would be appreciated.