Hi, I'm working on a project using US Mortality Multiple Cause Files (https://www.cdc.gov/nchs/data_access/vitalstatsonline.htm#Tools) to look at specific causes of death. When I import the data it seems to work correctly. For example, when I check the frequency of the ICD codes they all show up. However, when I try to check a specific value within the ICD variable I get an error saying the variable is not in the dataset. How can I correct this? Thanks in advance, examples below.
Data step code/import:
Check ICD variable:
Check output:
Check specific value:
where ICD='A009';
When you want to refer to a value of a character variable, the value must be in (single or double) quotes. Otherwise, SAS thinks A009 is the name of a variable.
where ICD='A009';
When you want to refer to a value of a character variable, the value must be in (single or double) quotes. Otherwise, SAS thinks A009 is the name of a variable.
Ah ha. Thanks! As usual the simple answer is the correct answer.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.