filename csvnew '\\mydrive\DATA.csv';
DATA mydata.;
LENGTH
VAR1 $ 4
VAR2 $ 4
VAR3 $ 1
VAR4 $ 3
VAR5 $ 1
VAR6 $ 1
VAR7 $ 6
VAR8 $ 6
VAR9 $ 1;
FORMAT
VAR1 $4.
VAR2 $4.
VAR3 $1.
VAR4 $3.
VAR5 $1.
VAR6 1.
VAR7 6.
VAR8 6.
VAR9 1.;
INFORMAT
VAR1 $4.
VAR2 $4.
VAR3 $1.
VAR4 $3.
VAR5 $1.
VAR6 1.
VAR7 6.
VAR8 6.
VAR9 1.;
INFILE &csvnew.
LRECL=67108864
DLM='2C0D'x
DSD firstobs=1;
INPUT
VAR1 $
VAR2 $
VAR3 $
VAR4 $
VAR5 $
VAR6
VAR7
VAR8
VAR9
@@;
RUN; Hello, attached is the code I've been using to import a csv that I've been receiving for years now. I thought this was working properly until I noticed some rows were missing. After loading the csv into a data model in excel I've realised there are 2,091,600 rows whereas SAS is only getting 1,950,158 rows. I have opened the CSV in notepad (too big to view in excel) and there is nothing to suggest why SAS would stop at this row - no missing row or strange characters or spaces; it just carries on like the rest of the CSV. There does seem to be something strange going on though because upon running the data step / infile shown, I get a "lost card" note for the record after row 1,950,158 and also it's reading the CSV as 1 line, hence why I think the "@@" is needed in the input section of the data step. Furthermore, I have tried using a simple proc import but it imports the CSV as one row only with thousands of columns as if it's not recognising that there are multiple rows in the csv. Anyone know how to help? Thanks, Matt
... View more