Hi,
I don't understand why the answer to this is a and not b?
WORD is set when AMOUNT=7.
It is not reset when AMOUNT changes.
Hi @pri26
If you execute the code step by step:
NB: it would have been better to have a LENGTH statement to define the word variable. As it is missing here, the length is set by default to 3, as it is the length of the first value proposed for this variable in the IF condition ('CAT'). It doesn't matter here as 'DOG' has the same number of letters than 'CAT'. But you can test to set amount to 3 for example, you will see that the 'ELSE' statement is true and that is displays 'NoN' and not 'NoNE !!!'
Best,
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.