I wanted to read it an external dataset (>100,000 records). It is tab delimited, with missing variables entered as “.”. I could read in fine if I use dataline. (The data was aligned fine in SAS, but appear misaligned here.
data want;
input Year 1-4 date 6-14 Type $ 16-20 ID1 $ 22-30 ID2 $32-41 Status1 $ 43 status2 $ 45-46 amount 47-51;
datalines;
2008 . ACUT1 580035688 0093509933 A EP 1
2009 01-Jun-08 ACUT2 506920875 7294393694 B FP 7
2009 13-Apr-09 ACUT3 506925992 7863803113 C AC 10
;
run;
But if I read in from an external file, it is giving me error messages. The first row has variable names. I tried using firstobs=2 or removing the first line, but the problem still didn’t go away. I also tried missover or not specifying column numbers, etc., and still didn't help.
DATA want;
INFILE "D:\data.txt" ;
input Year 1-4 date date9. 6-14 Type $ 16-20 ID1 $ 22-30 ID2 $32-41 Status1 $ 43 status2 $ 45-46 amount 47-51;
run;
**************************************************************;
Data in the external file "Data.txt"
Year date type ID1 ID2 Status1 Status2 amount
2008 . ACUT1 580035688 0093509933 A EP 1
2009 01-Jun-08 ACUT2 506920875 7294393694 B FP 7
2009 13-Apr-09 ACUT3 506925992 7863803113 C AC 10
Thanks very much in advance.