LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 15 Feb 2008 08:39:34 -0800
Reply-To:     karma <dorjetarap@GOOGLEMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         karma <dorjetarap@GOOGLEMAIL.COM>
Subject:      stacking variables
Comments: To:
Content-Type: text/plain; charset=ISO-8859-1

I'm trying to create a report by stacking variables. This is what I've tried so far, clearly it doesn't work.

data test(keep=stackvar1-stackvar4); set ardata.conmeds(where=(cmtyp='Rheumatoid Arthritis') keep=invid subjid cmatc1_1 cmdecod cmterm cmstdt cmendt cmongo cmtyp); length stackvar2 $ 200; stackvar1=trim(invid)||"~"||left(subjid); stackvar2=trim(left(cmatc1_1))||"~"||trim(left(cmdecod))||"~"|| left(cmterm); stackvar3=cmstdt; stackvar4=cmongo; run;

proc report data=test headline headskip nowd split='~'; title2 ' Listing of RA Concomitant Medications '; column stackvar1 stackvar2 stackvar3 stackvar4; define stackvar1 / width=10 "Inv./~Subj."; define stackvar2 / width=60 "ATC Level 1/~Ingredient/~Verbatim Text"; define stackvar3 / width=15 "Date Started"; define stackvar4 / width=10 "Ongoing~Medication"; run;

I'm not sure if there is a straightforward way to do this in proc report alone.

Thanks in advance

Back to: Top of message | Previous page | Main SAS-L page