Why set format 4.1 in the program, when input 8, the result is 0.8, input 8.0, the result is 8. I'm a little confused by this logic, please help me~
Your 4.1 in an INPUT statement is an INformat, not a format. It tells SAS how to read the numbers. If you want to tell SAS how to display (or write to an output) the numbers, then you need a format. This allows numbers to read in a certain way, and displayed (or written to an output) differently, if so desired.
data a;
input source 4.1;
format source 4.1;
cards;
...
;
I got it. Thank you
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 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.