Account Department (NNPC)
=========================================================================
Date: Tue, 18 Feb 2003 09:18:27 +0000
Reply-To: david.mcnulty@QUESTINTL.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: david.mcnulty@QUESTINTL.COM
Subject: Re: Importing from Excel
Content-type: text/plain; charset=us-ascii
Hi Carey,
In Excel the position of a number in general format tells you whether the
number has been entered as a number (right) or text (left). My personal
favourite is to add zero to every cell. Copy any empty cell then use Edit
-> Paste special -> Add. True text values and numbers are unaffected.
Blank/missing cells are preserved. Numbers entered as text are converted to
real numbers.
Regards
Dave.
"Carey G. Smoak"
<carey.smoak@ROC To: SAS-L@LISTSERV.UGA.EDU
HE.COM> cc: (bcc: David Mcnulty/GB/QUES/ICI)
Sent by: "SAS(r) Subject: Importing from Excel
Discussion"
<SAS-L@LISTSERV.
UGA.EDU>
17/02/2003 22:11
Please respond
to "Carey G.
Smoak"
I have a program that imports data from Excel to SAS. Here is the code:
proc import out=test99
datafile="c:\Excel\Book1.xls"
dbms=excel2000 replace;
getnames=yes;
run;
proc print data=test99;
run;
The Excel file looks like:
Var1
1.291
0.827
1.087
1.311
1.338
1.594
0.002
*0.842
*0.674
*1.009
*1.121
1.227
The cells with an asterisk are left justified and the cells without an
asterisk are right justified. The cell format in Excel is "general."
The problem that I am having is that when I import the data from Excel to
SAS, the cells with an asterisk are blank in SAS. For example, *0.842 is
not blank in SAS.
Any suggestions on how to correct the problem? Thanks in advance for your
assistance.
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the
intended recipient only. Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal