Hello,
Could someone help to explain why the numeric values were not read correctly? Thank you! Yvonne
data id;
input id best32.;
format id 20.;
datalines;
2416303039498861622
2416303543869862689
2416307785486124532
2416309804262141822
; run;
proc print; run;
------output--------
Obs id
1 2416303039498861568
2 2416303543869862912
3 2416307785486124544
4 2416309804262141952
Your ID field is too long for SAS to hold accurately as a number - around 15 digits is the maximum. For ID-type fields read these as character to fix your problem:
input id $20.;
Your ID field is too long for SAS to hold accurately as a number - around 15 digits is the maximum. For ID-type fields read these as character to fix your problem:
input id $20.;
Thank you!
But I have other tables with numeric ID (length 20.), this table was from 3rd party. Does it mean I need to convert others to a character ID? Not very efficient but if there is no choice.
Unfortunately yes. In what form do you receive these tables? If they are delimited or fixed-length text files you may be able to read them in as character to begin with.
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!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.