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 (June 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: andy <kamons@FAS.HARVARD.EDU>
Content-Type: text/plain; charset="iso-8859-1"


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?



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