Hi all,
I'm on version 8.5 V.03.05
I'm trying to create a new column that denotes whether or not a DEVICE is classified as an 'Instrument'. I'm struggling to get the syntax correct. This is what I have:
Step 1: Select Data
Step 2: Select + new data Item
Step 3: Select Calculated Item
Step 4: Write script
'DEVICE'n contains 'Instrument'
I get an error message:
X Type mismatch: expected type at this location is Character, type of item being applied is Boolean
Thanks for the help!
Hi Barry,
Glad you were able to get it working. If you have more values that you need to deal with, you will find that the IN condition is useful.
Another approach is to create a custom category, which will be more of a "click and drag" experience and less a coding one. Each way has its pros and cons. If you are creating more than a boolean/binary assignment, the nested IF statements in the calculated item approach can get tedious.
Sam
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.