That's a good start.
Couple of pointers,
1. All variables are character so make sure to include the $ in your array declarations.
2. You should loop over the key array/vars to check for those 7 values.
3. The score is a check for each value, so if score1=1 then the first value was found. You don't know where in the diagnosis it was found, but it's present. You could store the location if desired.
4. WhichC will search through the list of arrays to find the values.
5. Your last line doesn't make sense...not sure what you wanted to assign in that line.
Array Raw {9} $ c_dx1, c_dx2, c_dx3, c_dx4, c_dx5, c_dx6, c_dx7, c_dx8, c_hcpc;
Array Key {7} $ _temporary_ ('28730', '28739', '2875','280', '281', '282', '283');
Array Score {7} (7*0) ;
Do i = 1 to 7;
if whichc(key(i), of raw(*))>0 then score(i)=1;
End;
Total = sum( of score1 – score7 );
if total ge 1 then dis2 =1;
else if total dis2 =1; *doesn't make sense;
... View more