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
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.
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.