I'm having a lot of difficulty reading a .csv file into SAS. The file is large (~900,000 observations) and has an ID column that is a 14 digit number. When I read it into SAS, it comes in as a number in scientific notation with length 8 (i.e., I lose the last part of the ID number). I tried using Excel to change the format of the column, but my version of SAS won't read a .xlsx file and .xls files are limited to 65K observations. I really don't know what to try next. Any suggestions?
I did that (trying several different informat lines), but each time I get an error saying I'm trying to read in a numeric field as a character field and then SAS overrules the command and reads it as an 8 digit number in scientific notation.
What you are suggesting with the "relevant lines of the code as I modified them" doesn't make sense from the SAS processing perspective -- the key statements you have is with the INPUT and INFORMAT statement and how you have defined your variable -- which will be a CHARACTER type variable, not numeric.
There's something you're not sharing here....Suggest you post a reply with the exact SAS-generated log for a more useful reply and guidance.
I apologize for not being clear. I was trying to simplify things, which apparently had the opposite effect.
I used the Import Data procedure from the File menu. That generated the log pasted at the end of this message. The problem variable is FILING_ID, which SAS reads in as a numeric field rather than a character field. I then created a program using the code embedded in the log. In doing so, I modified the three lines dealing with FILING_ID (lines 853, 937, and 1022 below) to read as follows.
informat FILING_ID $14. ;
format FILING_ID $14. ;
I then ran that program to read in the data. The imported dataset looks fine except that FILING_ID was again read in as a numeric field.
I do have a workaround in which I pull the data into Excel, insert a character in front of the number, and write the file out in .csv format. SAS reads that fine, but it's a bit cumbersome because I have more than a few files to load. The workaround is find for this project, but I'd like to figure out an easier approach for future reference.