I have 10 different csv files that I am importing.
8 of them import perfectly however the other dont don't import, there are no apparent differences between the files.
Attached is the log:
NOTE: The infile DUMMY is: Filename=\peter\testing\sales_Dec20, RECFM=V,LRECL=32767,File Size (bytes)=1240186, Last Modified=15 June 2021 04:26:00, Create Time=26 August 2021 19:10:30 NOTE: 0 records were read from the infile DUMMY.I have been trying to work this out for a long time, but I can't seem to find whats wrong?
Inspect the files with a suitable text editor (e.g. Notepad++). It may be that your files use LF only as a record terminator (UNIX style).
Good text editors (see above) can show you the line termination style and reveal hidden characters.
I am in the process of looking into the the files. If my files do use LF only, how do I deal with this?
Since you need to adapt the TERMSTR option, this may need macro coding, and will prevent you from reading a bunch of files in one data step.
If you need to set this up for some kind of production use, insist that consistent file formats are used.
Hints:
I think I have just found the problem.
It is the free text field in my data that seems to be the problem, most cell entries are like this:
jennifer wants $10000
sales too low
over the limit
However there are a few entries that have an equals at the beginning, like so:
=jennifer wants $10000
=sales too low
When I went into the raw data and removed the equals sign, the data successfully loaded in.
I don't understand why this is tho. I discovered this fix by trial and error pretty much.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.