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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.