This is yet another anomaly with the "date" related INFORMAT handling. The fact that there is mixed INPUT processing is a contributing factor. My recommendation is to open a SAS support track, to let SAS Institute know that this unexpected input handling occurs when there is a date input field, and where the delimiter DOES NOT occur in the input record.
For illustration purposes, the two different input record types are processed, one containing a date field within the record and a second type without a date. SAS seems to handle the record not containing the date with no problem. See the code below:
data _null_;
infile datalines dlm='\';
format numdtvar1 date9.;
input type $ @;
if type ne ' ' then do;
if type = '1' then input charvar1 $ numdtvar1 anydtdte. numvar1 4.2 charvar2 $;
else
if type = '2' then input charvar1 $ numvar1 4.2 charvar2 $;
putlog _all_;
end;
datalines;
1\aaaa\01jan2008\2222\bbbb
2\aaaa\2222\bbbb
run;
Like I suggested, open a support track and stand your ground. Good luck.
Scott Barry
SBBWorks, Inc.