I have a transpose / merge question. I have two tables.
Table Dimension which contains columns name colname rank year yeartype employee category tenure and year conformed.
Table data contains columns unitId Insitution_name and many measures with names that correlate to dimension.name.
My goal is to merge the two tables such that the numeric values are displayed side by side with the dimensional fields. Effectively the employees column in the display is created from the measure column. I will then merge each of the measure columns vertically.
Please advise on the merge process.
Desired output is below:
Measure column | ||||||||
UnitID | Institution_Name | Employees | Rank | year | yearType | employee_category | tenure | yearConformed |
231624 | College of William and Mary | 174 | Associate Professors | 2016 | S | Faculty | Tenured | 1617 |
126818 | Colorado State University-Fort Collins | 329 | Associate Professors | 2016 | S | Faculty | Tenured | 1617 |
134097 | Florida State University | 294 | Associate Professors | 2016 | S | Faculty | Tenured | 1617 |
232186 | George Mason University | 337 | Associate Professors | 2016 | S | Faculty | Tenured | 1617 |
139940 | Georgia State University | 268 | Associate Professors | 2016 | S | Faculty | Tenured | 1617 |
153603 | Iowa State University | 378 | Associate Professors | 2016 | S | Faculty | Tenured | 1617 |
159391 | Louisiana State University and Agricultural & Mechanical College | 268 | Associate Professors | 2016 | S | Faculty | Tenured | 1617 |
It looks like first I transpose the data then I merge it.
proc sort data=combined2;
by UnitID 'Institution Name'n;
run;
proc transpose data=combined2 out=testing;
var 'All ranks (S2012_SIS_RV Wi_0001'n 'No academic rank (S2012_SIS_0002'n 'No academic rank (S2012_SIS_0003'n;
by UnitID 'Institution Name'n;
run;
This paper is really good.
It looks like first I transpose the data then I merge it.
proc sort data=combined2;
by UnitID 'Institution Name'n;
run;
proc transpose data=combined2 out=testing;
var 'All ranks (S2012_SIS_RV Wi_0001'n 'No academic rank (S2012_SIS_0002'n 'No academic rank (S2012_SIS_0003'n;
by UnitID 'Institution Name'n;
run;
This paper is really good.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.