Date: Wed, 2 Jan 2008 21:45:17 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Change of format
Content-Type: text/plain; charset="iso-8859-1"
Use Proc SQL load your variable names up into a Macro variable and refernce them with a Retain statement. Then after that use a length statement to specify the length of your variable of choice.
Data Temp ;
A = 'A' ;
B = 'B' ;
C = 'C' ;
Proc SQL NoPrint ;
Select Name Into : MyNames Separated By ' '
Where Libname = 'WORK'
And Memname = 'TEMP' ;
Data Need ;
Retain &MyNames ;
Length B $ 5 ;
Set Temp ;
Put _all_ ;
Data = Need ;
"Don't bail. The best gold is at the bottom of barrels of crap."
"Be prepared. Luck is where preparation meets opportunity."
> Date: Wed, 2 Jan 2008 13:29:38 -0800
> From: saslearn007@GMAIL.COM
> Subject: Re: Change of format
> To: SAS-L@LISTSERV.UGA.EDU
> On Jan 2, 3:46 pm, tobyd...@HOTMAIL.COM (toby dunn) wrote:
>> You may not need to worry about this as most procedures will accept a Format Statement whie the order is determined by a var or similar statement.
>> As a last resort just put a format statement after your set statement with the variables new format. The set statement will be encountered first and set the order of the variables.
>> Toby Dunn
>> "Don't bail. The best gold is at the bottom of barrels of crap."
>> Randy Pausch
>> "Be prepared. Luck is where preparation meets opportunity."
>> Randy Pausch
>>> Date: Wed, 2 Jan 2008 12:28:43 -0800
>>> From: saslearn...@GMAIL.COM
>>> Subject: Change of format
>>> To: SA...@LISTSERV.UGA.EDU
>>> How can I change the format of one variable in many variables with out
>>> disturbing the order of variables.
>> The best games are on Xbox 360. Click here for a special offer on an Xbox 360 Console.http://www.xbox.com/en-US/hardware/wheretobuy/
> I figured out with proc datasets how to change format with out
> changing order but not length can any body help with changing the
> length of a variable with out modifying the order of the variables in
> data set
Share life as it happens with the new Windows Live.