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.
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.
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.