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 (December 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 21 Dec 2004 17:23:55 -0800
Reply-To:     Dennis Diskin <diskin@SNET.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Dennis Diskin <diskin@SNET.NET>
Subject:      Re: proc transpose - duplicate id values
Comments: To: Nageswar Rao Punnani <>
In-Reply-To:  <>
Content-Type: text/plain; charset=us-ascii


What do you want for a result? Proc transpose does not know what to do with the duplicate records. If you want to keep them, a common approach is to add a sequence counter for duplicate records within your by group and add thet to the by statement. But, you have to figure out what you are going to do with those records later.

Regards, Dennis Diskin

Nageswar Rao Punnani <npunnani@GMAIL.COM> wrote: Hi all ,

I have sorted my data set with the by variables and then tried to transpose within the by group with the id variable. But the problem is in my data set , within the same by group i have duplicate id variable values and proc transpose is ignoring those observations . Is there a way to get around this .. any help is greatly appreciated.

this is the code i wrote :

proc transpose data = desktop.hosp_nonmissing1 out = work.hosp_nonmissingt prefix = code let; by patient_id hosp_adm_date hosp_disch_date; var diag_code ; id diag_code_number; run;

log report : The ID value "code1" occurs twice in the same BY group

sample observations where proc transpose is giving the error : id date1 date2 diag_code_number 12345 11/23/2004 12/23/2004 1 12345 11/23/2004 12/23/2004 1 12345 11/23/2004 12/23/2004 2 12345 11/23/2004 12/23/2004 3

thanks in advance,


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