05-22-2014 02:16 PM
I am trying to readin a pipe delimited file and have some issue with the readin program. Basically, the file has following layout:
Col_A| Col_B | Col_C
I am using below code to readin above data:
data Want ;
infile '../Text_file.txt' delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=2 ;
informat Col_A best32. ;
informat Col_B yymmdd10. ;
informat Col_C $10. ;
format Col_A best32. ;
format Col_B yymmdd10. ;
format Col_C $10. ;
Col_C_number = Col_C * 1;
When I try to convert Col_C to numeric, SAS outputs missing values for all Col_C value. I have following Note in the log file:
NOTE: Invalid numeric data, Col_C='99.12.' , at line 32 column 15.
I am guessing since there is no delimiter after Col_C, there is "." appended after each Col_C value.Can you please guide me on how to fix this issue?
Thanks for your time!!
05-22-2014 04:25 PM
I've never had a period appended to the last value of a pipe delimited file. You may have some artifact from text encoding such UNICODE that leaves little hidden surprises.
If you copy complete lines of data from the file and paste into a straight text editor such as Notepad do you see the period?