Date: Fri, 11 Nov 2005 13:05:37 -0800
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: Sort and Append
Content-Type: text/plain; format=flowed
gsingh24@GMAIL.COM wrote to me:
>As you might guess, I posted a sample code on the user-group. The
>actual data set has more variables both character and numeric. The code
>worked but I got missing values for some of the variables. The log
>shows what the character values were converted to numeric. Why were all
>the values converted to numeric? Would the code only process numeric
It looks like you've already gotten everything patched up.
But in answer to your question, the problem is simple. A SAS array can hold
numerics. Or it can hold character variables. But not both. So you would
want to define an array of all your numeric variables, and an array of all
character variables, and then load the two of them.
Since you are having to shove this stuff into an Excel spreadsheet later,
are probably going to want to put a LENGTH or ATTRIB statement at the very
top of the data step, with your variables listed in the order you'll want
have. Otherwise, you'll need to re-order them later. You see, the two
will mean that you'll get all the numeric variables in a row in the output
then all the character variables, unless you first tell SAS about the
a statement like RETAIN, LENGTH, or ATTRIB.
David L. Cassell
3115 NW Norwood Pl.
Corvallis OR 97330
Donít just search. Find. Check out the new MSN Search!