sas - Reading in character data as numeric -
i have csv file of numerical values expressed strings commas thousand separator, e.g. "1,513,256" instead of 1513256. simplest way read data sas
read data using comma. informat.
i find reading delimited files works best if first define variables. length statement this, can use attrib statement. make sure attach required informats and/or formats. note character , numeric variables require either informat or format, defaults work fine. write input statement.
data want ; infile 'myfile.csv' dsd truncover firstobs=2; length id $10 cost 8; informat cost comma.; input id cost; run;
Comments
Post a Comment