Hello,
So, I have to import data from a csv file in pretty good shape to a new SAS table.
In a data step I set up INFORMATs FORMATs and the INPUT statement. The file is imported correctly the only problem is that instead of just missing values (as in ,,) some field have ,null, as a value between separators. That particular variable will be numeric so when on that value I give a numeric INFORMAT (like BEST2. since there are 2 digits numbers where there isn't null) the log shout at me "invalid data".
Take notice that the resulting table is correct, in that particular field I have, as I should, the period.
How can I resolve the warnings?
You could create a custom format:
proc format library=work;
invalue testfmt
'null' = .
other=best.
;
run;
data test;
input x1 testfmt.;
cards;
null
1
2
0
.
;
run;
You could create a custom format:
proc format library=work;
invalue testfmt
'null' = .
other=best.
;
run;
data test;
input x1 testfmt.;
cards;
null
1
2
0
.
;
run;
Didn't think of that, thanks!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.