When there is no selection in a single-valued parameter, it produces a missing value. For numeric parameters, it is a dot ., for characters, it is an empty space ' '.
You can simplify this by using the missing() and notmissing() functions, which will automatically handle both numeric or character values. For example:
if(missing('parameter'p) ) return 1 else 0
If you are on SAS Viya, the isSet() function is a better alternative. isSet() returns True or False (1 or 0) depending on if a parameter has been selected. It can be used to get really great feedback on how someone is using the report. Plus, it works for both single-valued and multi-valued parameters.
if(isSet('parameter'p) ) return 1 else 0
Confirming Parameter Values
In case you ever need to confirm what the value of a parameter actually is in the background, here's a simple trick:
Create a new calculated column and simply drag in the parameter:
Add a list table and add your calculated column as a row
Select different values of your parameter to view its raw value
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.