Someone asked this on SAS-L this morning and I'm wondering if my discussion forum colleagues might have an answer.
Suppose you had/created the following tab delimited file:
filename testdata "c:\testdata.txt";
data _null_;
file testdata;
length thedata $15;
input thedata;
put thedata @;
if mod(_n_,4) eq 0 then put;
else put "09"x @;
cards;
StudyNumber
vara
varb
varc
"1001"
"1"
"a"
"b"
"1002"
"1"
"a"
"b"
"1003"
"1"
"a"
"b"
;
run;
Using the following code to import the file results in a file where StudyNumber is imported as a datetime field:
proc import datafile="c:\testdata.txt"
dbms=dlm out=work.test
replace;
delimiter='09'x;
getnames=yes;
guessingrows=32767;
run;
Interestingly, if one changes the first data record to have a StudyNumber of "301001" the file imports correctly.
Since the OP needs to import 100s of files, he doesn't want to replace proc import with datastep code.
Anyone have a clue as to why proc import is functioning that way and any direct way to change its behavior?
Art
p.s. I'm looking forward to finally meeting some of you in Vegas next week, especially at the combined SAS-L / SAS Discussion Forums / sasCommunity.org meetup.