Multiple choice technology programming languages

data work.flights; destination='cph'; select(destination); when('LPR') city='London'; when('CPH') city = 'Copenhagen'; otherwise city='Other'; end; run; which one of the following is the value of the CITY variable?

  1. Other

  2. Copenh

  3. Copenhagen

  4. Missing

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The destination variable contains 'cph' (lowercase), but the WHEN clause checks for 'CPH' (uppercase) and 'LPR'. Since SAS comparisons are case-sensitive, neither condition matches, so the OTHERWISE clause executes and assigns 'Other' to city. This demonstrates the importance of case in SAS string comparisons.