My answer to a complex transpose question from SAS-L

This post was kindly contributed by SAS Analysis - go there to comment and to read the full post.

The question is raised from http://www.listserv.uga.edu/cgi-bin/wa?A2=ind1005d&L=sas-l&F=&S=&P=11947


proc sort data=indat out=one;
by subjid vist;
run;
proc transpose data=one out=two ;
var result;
by subjid vist;
run;
proc transpose data=one out=three;
var unit;
by subjid vist;
run;

proc sql;
select a.subjid, a.vist, a.col1 as dpb, b.col1 as dpbunit, a.col2 as sbp, b. col2 as sbpunit, a.col3 as hr, b.col3 as hrunit
from two as a, three as b
where a.subjid=b.subjid and a.vist=b.vist;
quit;

This post was kindly contributed by SAS Analysis - go there to comment and to read the full post.