I have a rather large dataset in long format that I need wide. I tried proc transpose, but all my numeric variables were changed to character. 1) I don't even know how to change them back and don't want to do so individually anyway as there are a lot of variables 2) is there a way to transpose without this happening? Please see data (in reality there are about 63 variables, character and numeric, like vascular measures, yes/no questions, more physical measures, etc). Any solution I find involving an array seems to require typing out all variables.... event_name stid income educ sex race healthp ht wt sbp dbp smoke baseline 100 1 2 1 1 5 66 140.1 144 98 1 year_2 100 1 2 1 1 4 66 150.1 144 98 1 baseline 200 3 3 2 4 3 62.5 130.2 121 73 2 year_2 200 3 3 2 4 2 62.5 125.8 120 86 2 baseline 300 1 4 1 2 1 64 150.1 129 77 2 year_2 300 1 4 1 2 3 64 145.6 114 74 2 /* trying proc transpose*/ proc transpose data=longsort out=out1; by stID event_name; var income -- dbp; run; proc transpose data=out1 delimiter=_ out=new2(drop=_name_); by stid; var col1; id _name_ event_name; run; /* proc contents shows all are now character variables even the ones supposed to be numeric */
... View more