" If you could print out about 50 rows from have4, there should be a way to get you what you need here" Like I say, If I knew how to do that, I would. Here's trying. Okay. Reset. This code runs without errors:: title ' '; options nodate nonumber; data have; input entity $ con1 $ con2 con3 $; datalines; a y 1 d a y 2 i a y 3 d a y 1 d a n 2 d a n 3 d b y 1 di b y 1 di b n 1 ii b n 3 i b n 3 . b n 3 . c y 2 . c n 2 . c y 3 di c n 3 . d y 1 di d y 2 ii d y 3 i d n 2 i d y 1 d d n 2 d d y 3 . d n 1 i ; ODS LISTING CLOSE; ods output table=have1; proc tabulate data=have; class entity con1 con2 con3; table entity , con1 con2 con3; run; ods output close; ODS LISTING; proc sort data=have1 out=have2 (keep=entity con1-con3 n); by entity; run; data have3 (drop=con2 rename=con4=con2); set have2; *con4=put (con2,1.); length con4 $5; con4 = left(put(con2,5.)); run; data have4; set have3; array v con1-con3; array vid $8. id1-id3; do i=1 to dim(v); if not missing(v(i)) then vid(i)=catx('_',vname(v(i)),v(i)); end; id=coalescec(id1,id2,id3); run; ods html body="have4.htm"; proc print; run; options missing=""; proc transpose data=have4 out=want (drop=_:) ; by entity; var n; id id; run; proc print; run; However, the output it makes is wrong and clearly affected by the missing values. The output is here: http://momarda.brinkster.net/have4.htm con1_y should be 4,2,2,5 not 4,2,1,4 and con1_n should be 2,4,2,3 not 2,2,,3. Cleary for con3_d 5, , ,2 is close to 5,0,0,2 and for con3_d 1,1, ,3 is close to 1,1,0,3. Okay.
... View more