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 (March 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 3 Mar 2010 14:29:10 -0500
Reply-To:     William Whitworth <wcw2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         William Whitworth <wcw2@CDC.GOV>
Subject:      long to wide

I have data in the following long format (4 obs per subject, with automan and accession as unique identifiers):

data long; input Subj_ID $ AUTOMAN $ ACCESSION $ TESTRESULT;

datalines; 24C-004 auto C07-1021 10 24C-004 manual C07-1021 22 24C-004 auto C07-1022 13 24C-004 manual C07-1022 20 24C-006 auto C07-1033 17 24C-006 manual C07-1033 25 24C-006 auto C07-1034 18 24C-006 manual C07-1034 11 ;;;; Proc Print; run;

I'd like to get the data into the following structure: (The lowest accession is for the first two tests, the higher is for the second two tests).

Subj_ID AUTO1 AUTO2 MANUAL1 MANUAL2 24C-004 10 13 22 20 24C-006 17 18 25 11

I've tried a few things (datastep array, proc transpose, SQL) but nothing seems to work. Can anybody offer any suggestions? Thanks!


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