If you want to rotate an entire table 90 degrees then use PROC TRANSPOSE. But this PROC defaults to transposing numeric variables only. So use var _all_ all follows:
data work.grandkids;
input name $ gender $ age mom $ dad $ ;
datalines;
Kamina F 8 Cora Peter
Raelani F 6 Cora Peter
Elliott M 3 Cora Peter
Callie F 1 Emma Nathan
;
run;
* defaults to numeric variables only;
proc transpose data=work.grandkids out=work.t1;
run;
* try one field such a name but it does not work ;
proc transpose data=work.grandkids out=work.t2;
var name;
run;
* use _all_ to transpose the whole darn thing ;
proc transpose data=work.grandkids out=work.t3;
var _all_;
run;
data work.junk;
input v1 $ v2 $ v3 $ v4 $ v5 $ v6 $ v7 $ v8 $;
datalines;
i want each word in its own row
;
run;
* this works ;
proc transpose data=work.junk out=work.t4;
var v1 v2 v3 v4 v5 v6 v7 v8;
run;
* this is easier ;
proc transpose data=work.junk out=work.t5;
var _all_;
run;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment