yes I just realized that right after I posted my last note. This is what I add to create age1 age1 = intnx(year,dob,1); /* add 1 year to date of birth */ and kept the rest of the code the same and the variables are created but all empty ? these are new errors Argument 1 to function INTNX(' .',15803,1) at line 102 column 8 is invalid and It looks like it is only for a few ids ? but it would be able to create for others ? wouldn't it ? and at the end it says Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values. This is what my code looks like now is there anything wrong that I am missing ? Thank you for your help ! Data want; Set have; age1 = intnx(year,dob,1); /* add 1 year to date of birth */ array inage {25} VISIT1_AGE VISIT2_AGE VISIT3_AGE VISIT4_AGE VISIT5_AGE VISIT6_AGE VISIT7_AGE VISIT8_AGE VISIT9_AGE VISIT10_AGE VISIT11_AGE VISIT12_AGE VISIT13_AGE VISIT14_AGE VISIT15_AGE VISIT16_AGE VISIT17_AGE VISIT18_AGE VISIT19_AGE VISIT20_AGE VISIT21_AGE VISIT22_AGE VISIT23_AGE VISIT24_AGE VISIT25_AGE; array incode {25} antibi1 antibi2 antibi3 antibi4 antibi5 antibi6 antibi7 antibi8 antibi9 antibi10 antibi11 antibi12 antibi13 antibi14 antibi15 antibi16 antibi17 antibi18 antibi19 antibi20 antibi21 antibi22 antibi23 antibi24 antibi25; array outage {25} outVISIT1_AGE outVISIT2_AGE outVISIT3_AGE outVISIT4_AGE outVISIT5_AGE outVISIT6_AGE outVISIT7_AGE outVISIT8_AGE outVISIT9_AGE outVISIT10_AGE outVISIT11_AGE VISIT12_AGE outVISIT13_AGE outVISIT14_AGE outVISIT15_AGE outVISIT16_AGE outVISIT17_AGE outVISIT18_AGE outVISIT19_AGE outVISIT20_AGE outVISIT21_AGE outVISIT22_AGE outVISIT23_AGE outVISIT24_AGE outVISIT25_AGE; array outcode {25} outantibi1 - outantibi25; j = 1; do i = 1 to 25; if (. < inage{i} le age1) and incode{i} in('antibi1' 'antibi2' 'antibi3' 'antibi4' 'antibi5' 'antibi6' 'antibi7' 'antibi8' 'antibi9' 'antibi10' 'antibi11' 'antibi12' 'antibi13' 'antibi14' 'antibi15' 'antibi16' 'antibi17' 'antibi18' 'antibi19' 'antibi20' 'antibi21' 'antibi22' 'antibi23' 'antibi24' 'antibi25') then do; /* if age is not missing and in time frame and you have one or more of the asthma codes */ outage{j} = inage{i}; /* move image to outage */ outcode{j} = 1; /* found antibi code and in time range*/ j = j + 1; /* when you find one then increment the j index */ end; end;
... View more