BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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-
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
deleted_user
Not applicable
Thank you Scott for the suggestions! I will post again should I run into further issues.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 652 views
  • 0 likes
  • 2 in conversation