DATA Step, Macro, Functions and more

Reading a long floating point value in z/OS environment

Reply
Occasional Contributor
Posts: 13

Reading a long floating point value in z/OS environment

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

Super User
Posts: 3,254

Re: Reading a long floating point value in z/OS environment

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.

Ask a Question
Discussion stats
  • 1 reply
  • 144 views
  • 0 likes
  • 2 in conversation