Hello,
I have a silly question. I saw people use proc format and then build new variable with it.
I saw some used
Region = put(parkcode, $reglbl.);
but some used
Region=put(parkcode, ?? reglbl.)
what are the difference. I am very confused on '??' part. Could anyone guide me on this?
Thanks.
?? can be used with the INPUT function, not the PUT function. Consider these variations:
n1 = input('ABC', 3.);
n2 = input('ABC', ?? 3.);
The first statement would give you a message about invalid data being read since the 3. informat looks to create a numeric value. And "ABC" can't be read as numeric.
In a way, the second statement gives the same outcome in that n1 will equal n2. However, the ?? suppresses any messages in the log about invalid data.
?? can be used with the INPUT function, not the PUT function. Consider these variations:
n1 = input('ABC', 3.);
n2 = input('ABC', ?? 3.);
The first statement would give you a message about invalid data being read since the 3. informat looks to create a numeric value. And "ABC" can't be read as numeric.
In a way, the second statement gives the same outcome in that n1 will equal n2. However, the ?? suppresses any messages in the log about invalid data.
Thanks. So "??" is for cleaner log file? when do we need to use "??" instead?
@stataq wrote:
Thanks. So "??" is for cleaner log file? when do we need to use "??" instead?
You don't NEED to use it.
You might WANT to use it when:
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.