Reputation: 11
So I'm trying to read in a temporary dataset into SAS and every single thing reads in perfectly except for the revenue in line 5. I checked and counted and all of the variable lengths/positions are correct. I also tried to test this by copying data that read in fine into line 5 (which is the line that doesn't work) and nothing reads in on line 5 but everything else is fine. What could be the cause of this?
Upvotes: 1
Views: 133
Reputation: 51566
Your photograph of your SAS LOG is showing that line has a TAB character in it.
See the '09'x character that is after the digits 4 and 1 ('3431'x in hexadecimal).
It really looks like all of the data is actually in fixed columns, so you could change the INPUT statement to only read that variable from columns 67 to 76 and thus avoid the TAB in column 77.
Another simple fix is to add the EXPANDTABS option to the INFILE statement. That will replace the tab with enough space characters to reach the next tab stop.
While you are at it you could also add the TRUNCOVER option to handle any lines where there is nothing at all listed for the last few fields.
Upvotes: 1