|
Hi Ben,
Since your delimeters are '09'x which is
the hex value for a TAB character, and
the SAS doc mentions that NOTAB is
for using non-tab characters, they don't
say how this option works when you do
use TABs. In any case, by removing
the NOTAB and changing the format to
a length of 6 seems to work better for
the sample values you gave.
e.g.
data wrk2;
infile exin dlm='09'x missover dsd;
input (a1-a12)(comma6.);
run;
Hope this is helpful,
Mark Terjeson
Washington State Department of Social and Health Services
Division of Research and Data Analysis (RDA)
mailto:terjemw@dshs.wa.gov
-----Original Message-----
From: Krone, Ben --- Manager - Operations Systems --- GO
[mailto:Ben.Krone@AF.COM]
Sent: Tuesday, October 09, 2001 8:24 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Excel DDE - Help with INFILE statement
Need some help on reading some data from Excel into SAS via DDE.
Here is an example of a row of data as it appears in Excel sheet.
9,071 9,333 10,002 8,048 8,392 8,622 8,626 8,470
9,465 9,203 9,355 9,178
Here is the code I am using to read this data in:
filename exin dde 'excel|sheet1!r181c5:r181c16';
data wrk1;
infile exin notab dlm='09'x missover dsd;
input (a1-a12)(comma7.);
run;
This is what I get in the log:
NOTE: The infile EXIN is:
DDE Session,
SESSION=excel|sheet1!r181c5:r181c16,RECFM=V,
LRECL=256
NOTE: Invalid data for a4 in line 1 22-28.
NOTE: Invalid data for a5 in line 1 29-35.
NOTE: Invalid data for a6 in line 1 36-42.
NOTE: Invalid data for a7 in line 1 43-49.
NOTE: Invalid data for a11 in line 1 71-77.
NOTE: Invalid data for a12 in line 1 78-84.
RULE:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+-
---8----+----9----+----0
RULE:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+-
---8----+----9----+----0
1 CHAR 9,071 . 9,333 . 10,002 . 8,048 . 8,392 . 8,622 . 8,626 . 8,470 .
9,465 . 9,203 . 9,355 . 9,178 96
ZONE
2323332023233320233233320232333202323332023233320232333202323332023233320232
33320232333202323332
NUMR
09C0710909C33309010C0020908C0480908C3920908C6220908C6260908C4700909C4650909C
2030909C3550909C1780
a1=9071 a2=9333 a3=100 a4=. a5=. a6=. a7=. a8=8626 a9=8470 a10=946 a11=.
a12=. _ERROR_=1 _N_=1
NOTE: 1 record was read from the infile EXIN.
The minimum record length was 96.
The maximum record length was 96.
NOTE: The data set WORK.WRK1 has 1 observations and 12 variables.
NOTE: DATA statement used:
real time 0.07 seconds
cpu time 0.05 seconds
It appears to be reading the first 2 records fine, then it goes south from
there.
Any help would be greatly appreciated.
Thanks
Ben
******************************************************************
This message contains information that is confidential
and proprietary to American Freightways Corporation
or its affiliates. It is intended only for the recipient
named and for the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************************
|