Date: Thu, 20 Jun 2002 11:54:55 -0400
Reply-To: "Huang, Ya" <ya.huang@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <ya.huang@PFIZER.COM>
Subject: Re: specifying length of tranposed variables
Content-Type: text/plain; charset="iso-8859-1"
Andrew,
The length of variables in transpose output
data set is determined by the original var's length. So you
have two options. 1. to change the length before the transpose.
2. resize them since they all have a common prefix.
Here is a code showing how the resize is done:
data xx;
length c $20;
c='abc'; output;
c='abcdefghijk'; output;
proc transpose out=yy prefix=c;
var c;
proc contents;
data yy;
length c1-c2 $12;
set yy;
proc contents;
run;
The original c has length 20, therefore in the
first proc contents, c1,c2 are shown with lenght=20.
The last data step is to resize the length of c1-c2.
Be ware that length statement has to be ahaed of set statement.
Now the second proc contents shows c1-c2 with length=12.
Hope this helps.
Ya Huang
-----Original Message-----
From: andy [mailto:kamons@FAS.HARVARD.EDU]
Sent: Thursday, June 20, 2002 7:41 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: specifying length of tranposed variables
Does anyone know of a way to specify the length of the variables
output by the transpose procedure without specifically naming them?
The optimal solution would be to have the output be of the length I
specify. If not, is there a way to resize them later if I'm only
certain of the common prefix, not the actual name or number of
variables?
thanks,
Andrew