Hi Everyone,
I find that when a scv file has so many initial blank cell, my SAS code will not import correctly and it cause me trouble as I mentioned in the previous post (https://communities.sas.com/t5/Base-SAS-Programming/Import-issue/m-p/402819#M97858)
So I create this sample file and I wish you could help me to import correctly.
In this file, the first column has number at the first cell and SAS import the last row correctly.
For the other 2 column (bad1 bad2), many blank cell on top which make SAS import wrong. the value 350 in bad1 (last row) turn to 3. The value 2000 in bad2 turn to 2.
By the way, I have to use Import in my work
proc import datafile="...\error.csv"
out=error dbms=csv replace;
getnames=yes;
run;
data error; set error;
N=_N_;
if good^=. or bad1^=" " or Bad2^=" ";run;
I really appreciate your help.
HC
Add a GUESSINGROWS option and make it a big number. Then PROC IMPORT will scan more records before it determines the types.
This will slow down your processing.
proc import datafile="...\error.csv"
out=error dbms=csv replace;
getnames=yes;
guessingrows=1000000;
run;
Add a GUESSINGROWS option and make it a big number. Then PROC IMPORT will scan more records before it determines the types.
This will slow down your processing.
proc import datafile="...\error.csv"
out=error dbms=csv replace;
getnames=yes;
guessingrows=1000000;
run;
You save my day!!!
Thanks a lot.
HHC
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.