BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nturne
Calcite | Level 5

Hi sas community, 

 

does anyone know how I can array icd9 and icd10 codes? Below is my code

 

data obesity;
set colon.ip_colon;
array AllDiagCodes {15} $ dx1-dx15;
alcohol = 0;
do i = 1 to 15;
if AllDiagCodes{i} IN: (( "303", "980","E860", "291","3050", "7903") and ("F10", "R780", "T51", "O9931"))
then alcohol = 1;
end;
drop i;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

You can't use AND in the list being used by the IN operator. This is logically equivalent:

if AllDiagCodes{i} IN: ("303","980","E860","291","3050","7903","F10","R780","T51","O9931") then alcohol = 1;

View solution in original post

1 REPLY 1
SASKiwi
PROC Star

You can't use AND in the list being used by the IN operator. This is logically equivalent:

if AllDiagCodes{i} IN: ("303","980","E860","291","3050","7903","F10","R780","T51","O9931") then alcohol = 1;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

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
  • 1 reply
  • 391 views
  • 0 likes
  • 2 in conversation