I used proc import to import data from csv file. For some long numeric columns ( for ex, 456789123), csv shows scientific notation(for ex, 4.20E+8). So when SAS reads in CSV, it is converted to 400000000 (instead of the original, correct number = 456789123). I want to add a data quality checking step to alert myself that CSV actually is a scientific notation. How can I have SAS show that column as 4.20E+8 (that way, I will be able to pop up an error message for myself)?
proc import datafile = "inputfile.csv"
out = outds
dbms = csv replace;
getnames = YES;
run;
Whenever importing data gets complicated (read: ALWAYS), do not use proc import, but write your own data step. In that, you can read this column into a temporary character variable, check for the notation, and then either convert to the final numeric variable (if no scientific notation) or set a flag.
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.