| Date: | Fri, 13 Feb 2004 07:42:23 GMT |
| Reply-To: | Lars Wahlgren <lars.wahlgren.pleasenospam@STAT.LU.SE> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Lars Wahlgren <lars.wahlgren.pleasenospam@STAT.LU.SE> |
| Organization: | Lund university, Sweden |
| Subject: | Re: Prefix blanks |
|---|
Arrays are useful
data new (drop=i) ;
set old ;
array x oldvar1-oldvar200 ;
array y newvar1-newvar200 ;
do i = 1 to 200 ;
y[i] = input(x[i], 12.) ;
end ;
run ;
HTH
/LWn
"Sun Bow" <sunbow4u@HOTMAIL.COM> skrev i meddelandet
news:BAY2-DAV45ai4omRXf200016ae0@hotmail.com...
Hi,
Problem A:
In one of my dataset the values of variables have blanks in prefix ie its
like ' 16 (say 10 balnks before numbers). Is there a way to remove
them?
Problem B:
The same dataset has more than 200 variables. I used
newvar1 = input (oldvar1, 12.);
.......
newvar200 = input (oldvar200, 12.);
to convert all these character to numeric. I am sure there is a much
efficient way to do this but I am quite new to SAS.
Will appreciate help.
Sunbow
|