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:
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.