| Date: | Mon, 25 Jan 1999 09:34:46 -0500 |
| Reply-To: | barbara_quazi_butler@CCMAIL.CENSUS.GOV |
| Sender: | "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU> |
| From: | barbara_quazi_butler@CCMAIL.CENSUS.GOV |
| Subject: | Re[2]: conver character to numeric format |
|
| Content-Type: | text/plain; charset=US-ASCII |
In my humble opinion this subject has
been like the one of the top ten favorites
that is discussed if not weekly daily.
Re-visit the SAS-L digest of prior months
But I do a lot of daily reads of files from
100's of organizations of spreadsheet data
and then convert it into SAS datasets for
our SAS repository and feeds into Oracle.
You can use the following code ;
data x ; set new ; (this implies you have used the SAS Wizard
to execute the import)
length charvar $9. ; (value off the file)
charvar=filevar ;
newvar = input(charvar,9.) ; (Without knowing
the data I am guessing at the
format...)
(ref. page 556 SAS Lang. V.6 1st ED)
Or you can make sure that while in the
spreadsheet specifiy what format you
want the column to be and the length
This process works extremely well for
me and it's the only way I work with
external data.
Good Luck "Just Curious" Barbara!
______________________________ Reply Separator _________________________________
Subject: Re: conver character to numeric format
Author: Panos PAPANIKOLAOU <PapanikolaouP@CARDIFF.AC.UK> at SMTP-GATEWAY
Date: 1/23/1999 8:16 PM
Dear All,
I have a SAS perm data-set which was created after importing an Excel
file. SAS 6.12 v. was capable of reading correctly the Xls file.
However, the Excel file had some variables read as character. When
I looked at the variables and printed several cases I noticed that
these are NOT character but actually NUMERIC. I have used SAS to
produce the means & std of these variables. It rightly responds
telling me that these variables are CHARACTER. (This is because
they have been initially read as character, an imported Excel file).
To me, it would be very complicated indeed to change the variable
format in Excel and the read it in SAS. So, I am wondering if I'd
have SAS read these variables as NUMERIC. That is, do you know
the way that SAS will be able to recognise these variables not as
CHARACTER but as NUMERIC variables.If so, this would allow me to
use the proc means and univariate to derive useful stats info about
them. I would be grateful if I would have any suggestions on what to
do.
Thank you very much indeed for taking the time to consider my
request. I look forward to hearing from you.
Yours Sincerely
Panos Papanikolaou
Research Fellow
UWCM
Great Britain.
|