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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.