I need to read a CSV-file into a DI Studio job. I've registered it as an External File object, and controlled that all the columns and values look fine when I select "Open as a table" in DI Studio. The File Reader transformation causes problems, however. If I *only* map the character columns, File Reader works perfectly, but once I include any of the numeric columns it fails.
Here's the column settings from the File Reader (mapped directly from the External File object):
Once I've run the File Reader and try to open the output table, the column "1980" produces the following errors:
The values for "1980" in the CSV-file are ordinary numbers, and I've sorted them to check that there's no whitespace/blank values. Example:
Can anyone please help me understand the cause of the errors?
First, add informat and format to your numerical column.
And, since your column doesn't comply with SAS naming conventions, you need either map to another name, or have SAS using the n literal, it's a tick option in DIS.
First, add informat and format to your numerical column.
And, since your column doesn't comply with SAS naming conventions, you need either map to another name, or have SAS using the n literal, it's a tick option in DIS.
Thank you very much for the advice.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.