Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Specifying A Series of Character Codes - Need help

Accepted Solution Solved
Reply
Contributor
Posts: 71
Accepted Solution

Specifying A Series of Character Codes - Need help

In SAS, there is the ability to speficiy that if a variable is within a range of numbers, that you can recode them i.e. if variable in (1 2 3 4 5) then new_variable = 1;

I am wondering if the same can be done with a character variable. I am analyzing data with ICD9 codes and not all the codes are numeric. I am specifically wanting to have a series of ICD9 codes from V277 to V277.2.

Is there a way in SAS to write that I want to identify records that contain an ICD9 code between V277 and V277.2

thank you for any help you can provide.


Accepted Solutions
Solution
‎06-27-2012 05:32 PM
Super User
Posts: 11,343

Re: Specifying A Series of Character Codes - Need help

if "V277" le yourcodevariable le "V277.2"  MAY work. It may not if there are codes such as V277.12 that you do not want.

View solution in original post


All Replies
Solution
‎06-27-2012 05:32 PM
Super User
Posts: 11,343

Re: Specifying A Series of Character Codes - Need help

if "V277" le yourcodevariable le "V277.2"  MAY work. It may not if there are codes such as V277.12 that you do not want.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 184 views
  • 0 likes
  • 2 in conversation