Hello
I am creating a data set and enter data.
The data is
.001
0.01
10
100
10.0
My question is how can I know which informat should I use?
Maxim 1: Read the Documentation.
Go to documentation.sas.com, select "SAS 9.4 and SAS Viya 3.4 Programming Documentation", navigate to "Data Step Programming", "Formats and Informats", "SAS Informats", "Dictionary of Informats", select "Informats by Category". Scroll down to "Numeric".
Usually, you will use the simple w. informat (eg 7.) and see if that does it. If it doesn't, see if you find one that's applicable. It's granted that >90% of the information you'll read while browsing the documentation is not applicable at the moment, but most of it will end up in the back of your brain and come to the fore in a later moment when you'll need it.
Many times you will just have to swap the meaning of a dot and a comma (data from German-speaking countries), so you'll use the commax informat.
Yep. Forgot to mention that the w. informat is the default for numeric.
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.