I want to read a large floating point number from fixed position file and write it as the same value without rounding it.
Example:
Number starts from position 20 in the file. And the value is 999999999999.999999
I tried reading this value as
INPUT @20 num 19.6;
But the output it shows with or without the format 19.6 as :
1E12
SAS stores numbers in 8 bytes which can accurately hold around 16 digits including decimal places. Since SAS cannot precisely hold the 19 digits you are after you end up getting numbers slightly different to what you read. Try format 16.2.
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 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.