I am using SAS Studio. Code is not reading data with commas enclosed by "s. I tried two ways 1)format 2)informat.
I am reading a csv file with long column headings which I changed to ABCDEFGHIJK. I will deal with the long variable names next but first how should I read this in?
A=A B=. ....K=. Error message says I have invalid data for B--K.
How to do? Please see details below. Thank you.
Mary A. Marion
Data (first three lines):
A,B,C,D,E,F,G,H,I,J,K Albany County,"294,565","289,565","245,060","32,624",605,"8,090",84,"3,102","5,000","9,079" Allegany County,"49,927","49,487","48,444",361,139,358,2,183,440,454 ...
data ny; infile '/folders/myshortcuts/611/data/Week 03/HWdata/nypopulation.mm.csv' DSD; input A B C D E F G H I J K; format A $30. B comma8. C comma8. D comma8. E comma8. F comma8. G comma8. H comma8. I comma8. J comma8. K comma8.; run; data ny; informat A $30. B comma8. C comma8. D comma8. E comma8. F comma8. G comma8. H comma8. I comma8. J comma8. K comma8.; infile '/folders/myshortcuts/611/data/Week 03/HWdata/nypopulation.mm.csv' DSD; input A B C D E F G H I J K; run;
... View more