sql - Import .csv file to SAS, clean NULLs -
i'm importing .csv files sas using proc import works fine. however, of quantitative columns have nulls generated .csv files exporting sql. when sas goes through columns, classifies these columns character if 1 of 1000 entries null (which sas thinks string).
is there way tell sas null represents missing value , should taken care of accordingly?
thanks
not proc import. pre-process file , convert string 'null' actual empty space.
data _null_; infile 'my.csv' dsd truncover length=ll column=cc ; outfile 'new.csv' dsd ; length cell $5000 ; while (cc < ll); input cell @; if cell='null' cell=' '; put cell @; end; put; run;
or read file using data step , create user defined informat converts 'null' missing.
proc format ; invalue nulls 'null'=. ; run; data _null_ ; infile 'my.csv' dsd ; informat mynumber nulls. ; input mynumber ; run;
Comments
Post a Comment