data digits_split; infile datalines missover; length digits 255; input digits ; datalines; 1234567899999999999999999999999999999999 5547 3324 120 1005 11 2 ; run;
Hi Experts,
can you please explain variable length 3-8 even if I have given explicit length for digits variable how to get complete digits without convert numeric to char and what is max numeric length in SAS
SAS numbers are always stored in 8 bytes floating point. For storage in datasets, this length can be reduced down to 3 bytes, but during processing it's always 8.
The maximum precision because of this is between 15 and 16 decimal digits, which is sufficient for all kinds of statistical analysis.
Anything which needs more precision is most likely not a number, but some kind of a code and must be stored as character.
PS the technical details of 8 byte floating point can be found here
Also to note:
1.
SAS numbers are always stored in 8 bytes floating point
Not only SAS, that's true for numbers in software running on PC or unix.
2.
can you please explain variable length 3-8
The length of 8 represents the number of bytes used to store the number (sign, mantissa and exponent), not the number of digits.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
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.