Help using Base SAS procedures

matching across multiple ICD9 codes per patient

Reply
N/A
Posts: 0

matching across multiple ICD9 codes per patient

Hello All-

I have one row per patient and for each row I have up to 10 ICD codes (each code is a variable/column, e.g. ICD1, ICD2, ..., ICD10) and corresponding ICD text for each of the codes. I am interested in identifying, for each patient, the ICD9 code(s) that match any of the codes that I have from a master list of codes. Then I want to create a new variable, for each row, that contains the codes that matched along with the corresponding text.

Is this an issues that can be managed using an array?

Thanks in advance-
Super Contributor
Super Contributor
Posts: 3,174

Re: matching across multiple ICD9 codes per patient

An array could be used to parse through the ICD codes and using a SAS format and a PUT function to compare each ICD variable against your master list of codes. Then as you process through the ICD codes, if you find a match by using the test, such as

MATCH = PUT(ICD,$icd_master.);

Then you append each of the matching codes to a new combined-matching-values variable that are in your master list.

So, I prefer to build the $icd_master format with SAS PROC FORMAT, and as shown using the PUT function to test for a match. Using a SAS format for the master list is more flexible for DATA step processing in my opinion.


Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: matching across multiple ICD9 codes per patient

Thank you Scott for the suggestions! I will post again should I run into further issues.
Ask a Question
Discussion stats
  • 2 replies
  • 124 views
  • 0 likes
  • 2 in conversation