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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.