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

Hi, I am running the MACRO code shown below and getting the following error. How to i correct that ?


%macro incidence ;
	
	%do i = 1 %to 12 ;
	
		%let inf=%scan(int*zoo*othbact*hiv*vir*arth*chly*ricket*spiro*helminth*para*late, &i., *) ;
		
		/*intestinal infectious disease*/
		%let int=%str("001","002","003","004","005","006","007","008","009") ;
		
		/*zoonotic bacterial disease*/
		%let zoo=%str("020","021","022","023","024","025","026","027") ;
		
		/*other bacterial disease*/
		%let othbact=%str("030","031","032","033","034","035","036","037","038","039","040","041");
		
		/*hiv*/
		%let hiv=%str("042") ;
		
		/*viral diseases accompanied by exanthem*/
		%let vir=%str("050","051","052","053","054","055","056","057");
		
		/*arthropod-brone viral disease*/
		%let arth=%str("060","061","062","063","064","065","066");
		
		/*other diseases due to viruses and chlamydiae*/
		%let chly=%str("070","071","072","073","074","075","076","077","078","079");
		
		/*rickettsioses and otehr arthrpod-borne diseases*/
		%let ricket=%str("080","081","082","083","084","085","086","087","088");
		
		/*other spirochetal diseases*/
		%let spiro=%str("100","101","102","103","104");
	
		/*helminthiases*/
		%let helminth=%str("120","121","123","124","125","126","127","128","129");
		
		/*other infectious and parasitic diseases*/
		%let para=%str("130","131","132","133","134","135","136");
		
		/*late effects of infectious and parasitic diseases*/
		%let late=%str("137","138","139");
		
		
	/*FLAG PATIENT WITH SERIOUS INFECTIONS AFTER INDEX_DATE BUT BEFORE PERIOD_STOP*/;
	data _04_post_&inf. ;
		set derived._01_incidence;
		format post_&inf. 5. ;
		post_&inf. =1 ;
		where (code in:(&&&inf.)) and (index_date le svcdate le period_stop) ;
	run ;
	
	proc sort data = _04_post_&inf. nodupkey ;
		by enrolid svcdate ;
	run ;
	
	/*KEEP ONLY FIRST DIAGNOSTIC DATE*/
	data _04_post2_&inf.;
		set _04_post_&inf. ;
		by enrolid svcdate ;
		format first_svcdate_&inf. mmddyy10. ;
		if first.enrolid then first_svcdate_&inf. = svcdate;
	run ;
	
	proc sort data =_04_post2_&inf. nodupkey ;
		by enrolid svcdate ;
	run ;
	
	/*FLAG PATIENTS WITH SERIOUS INFECTIONS BEFORE THE INDEX_DATE */
	data _04_pre_&inf. ;
		set derived._01_incidence;
		format pre_&inf. 4. ;
		pre_&inf. = 1 ;
		where (code in: (&&&inf.)) and (svcdate le index_date) ;
	run ;
	
	proc sort data  = _04_pre_&inf. nodupkey ;
		by enrolid svcdate ;
	run ;
	
	%end ;
	
	data _04_allevents ;
		merge _04_post2_int _04_post2_zoo _04_post2_othbact _04_post2_hiv _04_post2_vir _04_post2_arth 
		_04_post2_chly _04_post2_ricket _04_post2_spiro _04_post2_helminth _04_post2_para _04_post2_late
		_04_pre_int _04_pre_zoo _04_pre_othbact _04_pre_hiv _04_pre_vir _04_pre_arth  
		_04_pre_chly _04_pre_ricket _04_pre_spiro _04_pre_helminth _04_pre_para _04_pre_late 
		;
	by enrolid;
	run;
	
	/*left joining back to our cohort*/
	proc sql;
		create table _04_allevents2 as
		select distinct a.*
		from derived._01_incidence as a
		left join _04_allevents as b 
		on a.enrolid = b.enrolid ;
	quit ;
	
	
%mend incidence;
%incidence;
	

/*INCIDENCE RATE CALCULATION- INCIDENCE IS THE NUMBER OF NEW EVENTS OR NUMBER OF PATIENTS WHO HAD A SVCDATE FOR ANY SERIOUS INFECTION ON OR
AFTER THE INDEX_DATE DIVIDED BY THE NUMBER OF PERSON YEARS - WHICH IS PERIOD_STOP - SVCDATE / 365 DAYS FOR EACH PATIENT AT RISK 
(PATIENTS  AT RISK ARE ALL PATEINTS WHO HAD INCIDENCE OF A DISEASE AFTER THE INDEX_DATE UNTIL THEY GOT THE DISEASE*/

%macro inc_cal ;/*since we need to divide our results into specific infections we are making another macros to read al the codes
and then make seperate datasets of it accordingly*/

	%do i = 1 %to 12 ;
		
		%let inf = %scan(int*zoo*othbact*hiv*vir*arth*chly*ricket*spiro*helminth*para*late, &i., *) ;

		proc sort data =_04_allevents2 out= _04_inc_cal nodupkey ;
			by enrolid ;
		run ;
		
		/*GETTING RID OF PATIENTS HAVING SVCDATE FOR INFECTIONS PRIOR TO THE INDEX DATE*/
		data _04_inc_cal1 ;
			set _04_inc_cal ;
			by enrolid ;
			if pre_&inf. =1 then delete ;
		run ;
		
		/*PERSON YEAR CALCULATION*/
			/*FINDING THE LAST DATE OF THE DATASET*/
				proc sql ;	
					create table test as 
					select max(period_stop) as date format mmddyy10.
					from dmk_scan.periods_cm_rx ;
				quit ;
		
		data _04_inc_cal2 ;
			set _04_inc_cal1 ;
			if post_&inf. =1 then py_&inf. = (min(period_stop, '30sep2017'D,first_svcdate_&inf.) - index_date +1)/365.25;
			else if post_&inf. = . then py_&inf. = (min(period_stop, '30sep2017'D) - index_date +1)/365.25 ;
			else if post_&inf. <0 then delete ;
		run ;
		
/*CREATING TABLE FOR INCIDENCE RATE CALCLUATION - CI, RATE CALCUALTION , NO. OF NEW EVENTS, PY*/

	proc sql;
		create table _04_inc_table_&i. as
		select "&inf." as col,
			, COUNT(enrolid) as N
			, SUM(&inf.) as events
			, SUM(P_Years) as PYs
			, (SUM(&inf.)/SUM(py_&inf.))*10000 as IR
			, CINV(0.025,2*SUM(&inf.))/(2*SUM(py_&inf.))*100000 as Lower95
			, CINV(0.975,2*(SUM(&inf.)+1))/(2*SUM(py_&inf.))*100000 AS Upper95
		from _04_inc_cal2 ;
	quit ;
	
	%end ;
	
	/*SET ALL THE DATASETS*/
	data derived._04_final_inc; 
		set _04_inc_table_1 - _04_inc_table_12 ;
	run ;
	
%mend inc_cal ;
%inc_cal;




	
	
 

LOG 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 SYMBOLGEN:  Macro variable _SASWSTEMP_ resolves to /data1/home/genesis/sai/.sasstudio/.images/e397ea8c-5f99-4a01-a71d-5997654d2d86
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 SYMBOLGEN:  Macro variable GRAPHINIT resolves to GOPTIONS RESET=ALL GSFNAME=_GSFNAME;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 73         
 74         ***********************************************************************
 75         **
 76         **                esrd_04_incidencerate.sas
 77         **
 78         ** CREATED BY:    Saipriya
 79         **
 80         ** FUNCTION     : ESRD cohort
 81         **
 82         ** CREATED      : 07/18/2018
 83         **
 84         ** LAST
 85         ** MODIFIED     :
 86         **
 87         ** PARAMETERS   :derived._01_esrd
 88         **
 89         ** NOTES        :Incidence rate for ESRD group
 90         **
 91         **********************************************************************;
 92         option mprint mlogic symbolgen ;
 93         
 94         *STEP 1 ;
 95         
 96         /*CALCULATING THE NUMBER OF PATIENTS WITH THE APPLICABLE ENDPOINT (ONLY FIRST EVENT TO BE COUNTED) */
 97         
 98         %macro incidence ;
 99         
 100        %do i = 1 %to 12 ;
 101        
 102        %let inf=%scan(int*zoo*othbact*hiv*vir*arth*chly*ricket*spiro*helminth*para*late, &i., *) ;
 103        
 104        /*intestinal infectious disease*/
 105        %let int=%str("001","002","003","004","005","006","007","008","009") ;
 106        
 107        /*zoonotic bacterial disease*/
 108        %let zoo=%str("020","021","022","023","024","025","026","027") ;
 109        
 110        /*other bacterial disease*/
 111        %let othbact=%str("030","031","032","033","034","035","036","037","038","039","040","041");
 112        
 113        /*hiv*/
 114        %let hiv=%str("042") ;
 115        
 116        /*viral diseases accompanied by exanthem*/
 117        %let vir=%str("050","051","052","053","054","055","056","057");
 118        
 119        /*arthropod-brone viral disease*/
 120        %let arth=%str("060","061","062","063","064","065","066");
 121        
 122        /*other diseases due to viruses and chlamydiae*/
 123        %let chly=%str("070","071","072","073","074","075","076","077","078","079");
 124        
 125        /*rickettsioses and otehr arthrpod-borne diseases*/
 126        %let ricket=%str("080","081","082","083","084","085","086","087","088");
 127        
 128        /*other spirochetal diseases*/
 129        %let spiro=%str("100","101","102","103","104");
 130        
 131        /*helminthiases*/
 132        %let helminth=%str("120","121","123","124","125","126","127","128","129");
 133        
 134        /*other infectious and parasitic diseases*/
 135        %let para=%str("130","131","132","133","134","135","136");
 136        
 137        /*late effects of infectious and parasitic diseases*/
 138        %let late=%str("137","138","139");
 139        
 140        
 141        /*FLAG PATIENT WITH SERIOUS INFECTIONS AFTER INDEX_DATE BUT BEFORE PERIOD_STOP*/;
 142        data _04_post_&inf. ;
 143        set derived._01_incidence;
 144        format post_&inf. 5. ;
 145        post_&inf. =1 ;
 146        where (code in:(&&&inf.)) and (index_date le svcdate le period_stop) ;
 147        run ;
 148        
 149        proc sort data = _04_post_&inf. nodupkey ;
 150        by enrolid svcdate ;
 151        run ;
 152        
 153        /*KEEP ONLY FIRST DIAGNOSTIC DATE*/
 154        data _04_post2_&inf.;
 155        set _04_post_&inf. ;
 156        by enrolid svcdate ;
 157        format first_svcdate_&inf. mmddyy10. ;
 158        if first.enrolid then first_svcdate_&inf. = svcdate;
 159        run ;
 160        
 161        proc sort data =_04_post2_&inf. nodupkey ;
 162        by enrolid svcdate ;
 163        run ;
 164        
 165        /*FLAG PATIENTS WITH SERIOUS INFECTIONS BEFORE THE INDEX_DATE */
 166        data _04_pre_&inf. ;
 167        set derived._01_incidence;
 168        format pre_&inf. 4. ;
 169        pre_&inf. = 1 ;
 170        where (code in: (&&&inf.)) and (svcdate le index_date) ;
 171        run ;
 172        
 173        proc sort data  = _04_pre_&inf. nodupkey ;
 174        by enrolid svcdate ;
 175        run ;
 176        
 177        %end ;
 178        
 179        data _04_allevents ;
 180        merge _04_post2_int _04_post2_zoo _04_post2_othbact _04_post2_hiv _04_post2_vir _04_post2_arth
 181        _04_post2_chly _04_post2_ricket _04_post2_spiro _04_post2_helminth _04_post2_para _04_post2_late
 182        _04_pre_int _04_pre_zoo _04_pre_othbact _04_pre_hiv _04_pre_vir _04_pre_arth
 183        _04_pre_chly _04_pre_ricket _04_pre_spiro _04_pre_helminth _04_pre_para _04_pre_late
 184        ;
 185        by enrolid;
 186        run;
 187        
 188        /*left joining back to our cohort*/
 189        proc sql;
 190        create table _04_allevents2 as
 191        select distinct a.*
 192        from derived._01_incidence as a
 193        left join _04_allevents as b
 194        on a.enrolid = b.enrolid ;
 195        quit ;
 196        
 197        
 198        %mend incidence;
 199        %incidence;
 MLOGIC(INCIDENCE):  Beginning execution.
 MLOGIC(INCIDENCE):  %DO loop beginning; index variable I; start value is 1; stop value is 12; by value is 1.  
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 1
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   data _04_post_int ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   format post_int 5. ;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   post_int =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INT resolves to "001","002","003","004","005","006","007","008","009"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("001","002","003","004","005","006","007","008","009")) and (index_date le svcdate le 
 period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 3039 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('001', '002', '003', '004', '005', '006', '007', '008', '009') and (index_date<=svcdate) and 
       (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_INT has 3039 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.04 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   proc sort data = _04_post_int nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 3039 observations read from the data set WORK._04_POST_INT.
 NOTE: 114 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_INT has 2925 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   data _04_post2_int;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   set _04_post_int ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   format first_svcdate_int mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_int = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 2925 observations read from the data set WORK._04_POST_INT.
 NOTE: The data set WORK._04_POST2_INT has 2925 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   proc sort data =_04_post2_int nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 2925 observations read from the data set WORK._04_POST2_INT.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_INT has 2925 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   data _04_pre_int ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   format pre_int 4. ;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   pre_int = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INT resolves to "001","002","003","004","005","006","007","008","009"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("001","002","003","004","005","006","007","008","009")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 143 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('001', '002', '003', '004', '005', '006', '007', '008', '009') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_INT has 143 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.05 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INCIDENCE):   proc sort data = _04_pre_int nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 143 observations read from the data set WORK._04_PRE_INT.
 NOTE: 11 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_INT has 132 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 2; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 2
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   data _04_post_zoo ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   format post_zoo 5. ;
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   post_zoo =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to zoo
 SYMBOLGEN:  Macro variable ZOO resolves to "020","021","022","023","024","025","026","027"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("020","021","022","023","024","025","026","027")) and (index_date le svcdate le period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 12 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('020', '021', '022', '023', '024', '025', '026', '027') and (index_date<=svcdate) and (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_ZOO has 12 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.04 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   proc sort data = _04_post_zoo nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 12 observations read from the data set WORK._04_POST_ZOO.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_ZOO has 12 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   data _04_post2_zoo;
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   set _04_post_zoo ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   format first_svcdate_zoo mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_zoo = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 12 observations read from the data set WORK._04_POST_ZOO.
 NOTE: The data set WORK._04_POST2_ZOO has 12 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   proc sort data =_04_post2_zoo nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 12 observations read from the data set WORK._04_POST2_ZOO.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_ZOO has 12 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   data _04_pre_zoo ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   format pre_zoo 4. ;
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   pre_zoo = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to zoo
 SYMBOLGEN:  Macro variable ZOO resolves to "020","021","022","023","024","025","026","027"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("020","021","022","023","024","025","026","027")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 0 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('020', '021', '022', '023', '024', '025', '026', '027') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_ZOO has 0 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.04 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to zoo
 MPRINT(INCIDENCE):   proc sort data = _04_pre_zoo nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: Input data set is empty.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_ZOO has 0 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 3; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 3
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   data _04_post_othbact ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   format post_othbact 5. ;
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   post_othbact =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to othbact
 SYMBOLGEN:  Macro variable OTHBACT resolves to "030","031","032","033","034","035","036","037","038","039","040","041"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("030","031","032","033","034","035","036","037","038","039","040","041")) and (index_date le 
 svcdate le period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 25816 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('030', '031', '032', '033', '034', '035', '036', '037', '038', '039', '040', '041') and (index_date<=svcdate) 
       and (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_OTHBACT has 25816 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   proc sort data = _04_post_othbact nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 25816 observations read from the data set WORK._04_POST_OTHBACT.
 NOTE: 2594 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_OTHBACT has 23222 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   data _04_post2_othbact;
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   set _04_post_othbact ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   format first_svcdate_othbact mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_othbact = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 23222 observations read from the data set WORK._04_POST_OTHBACT.
 NOTE: The data set WORK._04_POST2_OTHBACT has 23222 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   proc sort data =_04_post2_othbact nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 23222 observations read from the data set WORK._04_POST2_OTHBACT.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_OTHBACT has 23222 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.01 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   data _04_pre_othbact ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   format pre_othbact 4. ;
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   pre_othbact = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to othbact
 SYMBOLGEN:  Macro variable OTHBACT resolves to "030","031","032","033","034","035","036","037","038","039","040","041"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("030","031","032","033","034","035","036","037","038","039","040","041")) and (svcdate le 
 index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 666 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('030', '031', '032', '033', '034', '035', '036', '037', '038', '039', '040', '041') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_OTHBACT has 666 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to othbact
 MPRINT(INCIDENCE):   proc sort data = _04_pre_othbact nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 666 observations read from the data set WORK._04_PRE_OTHBACT.
 NOTE: 76 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_OTHBACT has 590 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 4; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 4
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   data _04_post_hiv ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   format post_hiv 5. ;
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   post_hiv =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to hiv
 SYMBOLGEN:  Macro variable HIV resolves to "042"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("042")) and (index_date le svcdate le period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 0 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('042') and (index_date<=svcdate) and (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_HIV has 0 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   proc sort data = _04_post_hiv nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: Input data set is empty.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_HIV has 0 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   data _04_post2_hiv;
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   set _04_post_hiv ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   format first_svcdate_hiv mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_hiv = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 0 observations read from the data set WORK._04_POST_HIV.
 NOTE: The data set WORK._04_POST2_HIV has 0 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   proc sort data =_04_post2_hiv nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: Input data set is empty.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_HIV has 0 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   data _04_pre_hiv ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   format pre_hiv 4. ;
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   pre_hiv = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to hiv
 SYMBOLGEN:  Macro variable HIV resolves to "042"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("042")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 0 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('042') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_HIV has 0 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to hiv
 MPRINT(INCIDENCE):   proc sort data = _04_pre_hiv nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: Input data set is empty.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_HIV has 0 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 5; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 5
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   data _04_post_vir ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   format post_vir 5. ;
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   post_vir =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to vir
 SYMBOLGEN:  Macro variable VIR resolves to "050","051","052","053","054","055","056","057"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("050","051","052","053","054","055","056","057")) and (index_date le svcdate le period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 740 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('050', '051', '052', '053', '054', '055', '056', '057') and (index_date<=svcdate) and (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_VIR has 740 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   proc sort data = _04_post_vir nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 740 observations read from the data set WORK._04_POST_VIR.
 NOTE: 38 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_VIR has 702 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   data _04_post2_vir;
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   set _04_post_vir ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   format first_svcdate_vir mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_vir = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 702 observations read from the data set WORK._04_POST_VIR.
 NOTE: The data set WORK._04_POST2_VIR has 702 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   proc sort data =_04_post2_vir nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 702 observations read from the data set WORK._04_POST2_VIR.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_VIR has 702 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   data _04_pre_vir ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   format pre_vir 4. ;
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   pre_vir = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to vir
 SYMBOLGEN:  Macro variable VIR resolves to "050","051","052","053","054","055","056","057"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("050","051","052","053","054","055","056","057")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 44 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('050', '051', '052', '053', '054', '055', '056', '057') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_VIR has 44 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to vir
 MPRINT(INCIDENCE):   proc sort data = _04_pre_vir nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 44 observations read from the data set WORK._04_PRE_VIR.
 NOTE: 4 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_VIR has 40 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 6; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 6
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   data _04_post_arth ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   format post_arth 5. ;
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   post_arth =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to arth
 SYMBOLGEN:  Macro variable ARTH resolves to "060","061","062","063","064","065","066"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("060","061","062","063","064","065","066")) and (index_date le svcdate le period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 11 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('060', '061', '062', '063', '064', '065', '066') and (index_date<=svcdate) and (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_ARTH has 11 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   proc sort data = _04_post_arth nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 11 observations read from the data set WORK._04_POST_ARTH.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_ARTH has 11 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   data _04_post2_arth;
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   set _04_post_arth ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   format first_svcdate_arth mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_arth = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 11 observations read from the data set WORK._04_POST_ARTH.
 NOTE: The data set WORK._04_POST2_ARTH has 11 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   proc sort data =_04_post2_arth nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 11 observations read from the data set WORK._04_POST2_ARTH.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_ARTH has 11 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   data _04_pre_arth ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   format pre_arth 4. ;
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   pre_arth = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to arth
 SYMBOLGEN:  Macro variable ARTH resolves to "060","061","062","063","064","065","066"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("060","061","062","063","064","065","066")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 0 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('060', '061', '062', '063', '064', '065', '066') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_ARTH has 0 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to arth
 MPRINT(INCIDENCE):   proc sort data = _04_pre_arth nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: Input data set is empty.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_ARTH has 0 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 7; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 7
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   data _04_post_chly ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   format post_chly 5. ;
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   post_chly =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to chly
 SYMBOLGEN:  Macro variable CHLY resolves to "070","071","072","073","074","075","076","077","078","079"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("070","071","072","073","074","075","076","077","078","079")) and (index_date le svcdate le 
 period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 17955 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('070', '071', '072', '073', '074', '075', '076', '077', '078', '079') and (index_date<=svcdate) and 
       (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_CHLY has 17955 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   proc sort data = _04_post_chly nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 17955 observations read from the data set WORK._04_POST_CHLY.
 NOTE: 480 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_CHLY has 17475 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   data _04_post2_chly;
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   set _04_post_chly ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   format first_svcdate_chly mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_chly = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 17475 observations read from the data set WORK._04_POST_CHLY.
 NOTE: The data set WORK._04_POST2_CHLY has 17475 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   proc sort data =_04_post2_chly nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 17475 observations read from the data set WORK._04_POST2_CHLY.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_CHLY has 17475 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   data _04_pre_chly ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   format pre_chly 4. ;
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   pre_chly = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to chly
 SYMBOLGEN:  Macro variable CHLY resolves to "070","071","072","073","074","075","076","077","078","079"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("070","071","072","073","074","075","076","077","078","079")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 573 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('070', '071', '072', '073', '074', '075', '076', '077', '078', '079') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_CHLY has 573 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.04 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to chly
 MPRINT(INCIDENCE):   proc sort data = _04_pre_chly nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 573 observations read from the data set WORK._04_PRE_CHLY.
 NOTE: 32 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_CHLY has 541 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 8; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 8
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   data _04_post_ricket ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   format post_ricket 5. ;
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   post_ricket =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to ricket
 SYMBOLGEN:  Macro variable RICKET resolves to "080","081","082","083","084","085","086","087","088"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("080","081","082","083","084","085","086","087","088")) and (index_date le svcdate le 
 period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 40 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('080', '081', '082', '083', '084', '085', '086', '087', '088') and (index_date<=svcdate) and 
       (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_RICKET has 40 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   proc sort data = _04_post_ricket nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 40 observations read from the data set WORK._04_POST_RICKET.
 NOTE: 1 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_RICKET has 39 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   data _04_post2_ricket;
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   set _04_post_ricket ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   format first_svcdate_ricket mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_ricket = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 39 observations read from the data set WORK._04_POST_RICKET.
 NOTE: The data set WORK._04_POST2_RICKET has 39 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   proc sort data =_04_post2_ricket nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 39 observations read from the data set WORK._04_POST2_RICKET.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_RICKET has 39 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   data _04_pre_ricket ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   format pre_ricket 4. ;
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   pre_ricket = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to ricket
 SYMBOLGEN:  Macro variable RICKET resolves to "080","081","082","083","084","085","086","087","088"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("080","081","082","083","084","085","086","087","088")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 7 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('080', '081', '082', '083', '084', '085', '086', '087', '088') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_RICKET has 7 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to ricket
 MPRINT(INCIDENCE):   proc sort data = _04_pre_ricket nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 7 observations read from the data set WORK._04_PRE_RICKET.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_RICKET has 7 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 9; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 9
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   data _04_post_spiro ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   format post_spiro 5. ;
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   post_spiro =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to spiro
 SYMBOLGEN:  Macro variable SPIRO resolves to "100","101","102","103","104"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("100","101","102","103","104")) and (index_date le svcdate le period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 9 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('100', '101', '102', '103', '104') and (index_date<=svcdate) and (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_SPIRO has 9 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   proc sort data = _04_post_spiro nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 9 observations read from the data set WORK._04_POST_SPIRO.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_SPIRO has 9 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   data _04_post2_spiro;
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   set _04_post_spiro ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   format first_svcdate_spiro mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_spiro = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 9 observations read from the data set WORK._04_POST_SPIRO.
 NOTE: The data set WORK._04_POST2_SPIRO has 9 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   proc sort data =_04_post2_spiro nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 9 observations read from the data set WORK._04_POST2_SPIRO.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_SPIRO has 9 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   data _04_pre_spiro ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   format pre_spiro 4. ;
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   pre_spiro = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to spiro
 SYMBOLGEN:  Macro variable SPIRO resolves to "100","101","102","103","104"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("100","101","102","103","104")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 0 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('100', '101', '102', '103', '104') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_SPIRO has 0 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to spiro
 MPRINT(INCIDENCE):   proc sort data = _04_pre_spiro nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: Input data set is empty.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_SPIRO has 0 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 10; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 10
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   data _04_post_helminth ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   format post_helminth 5. ;
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   post_helminth =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to helminth
 SYMBOLGEN:  Macro variable HELMINTH resolves to "120","121","123","124","125","126","127","128","129"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("120","121","123","124","125","126","127","128","129")) and (index_date le svcdate le 
 period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 16 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('120', '121', '123', '124', '125', '126', '127', '128', '129') and (index_date<=svcdate) and 
       (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_HELMINTH has 16 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   proc sort data = _04_post_helminth nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 16 observations read from the data set WORK._04_POST_HELMINTH.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_HELMINTH has 16 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   data _04_post2_helminth;
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   set _04_post_helminth ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   format first_svcdate_helminth mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_helminth = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 16 observations read from the data set WORK._04_POST_HELMINTH.
 NOTE: The data set WORK._04_POST2_HELMINTH has 16 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   proc sort data =_04_post2_helminth nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 16 observations read from the data set WORK._04_POST2_HELMINTH.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_HELMINTH has 16 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   data _04_pre_helminth ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   format pre_helminth 4. ;
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   pre_helminth = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to helminth
 SYMBOLGEN:  Macro variable HELMINTH resolves to "120","121","123","124","125","126","127","128","129"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("120","121","123","124","125","126","127","128","129")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 3 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('120', '121', '123', '124', '125', '126', '127', '128', '129') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_HELMINTH has 3 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to helminth
 MPRINT(INCIDENCE):   proc sort data = _04_pre_helminth nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 3 observations read from the data set WORK._04_PRE_HELMINTH.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_HELMINTH has 3 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 11; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 11
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   data _04_post_para ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   format post_para 5. ;
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   post_para =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to para
 SYMBOLGEN:  Macro variable PARA resolves to "130","131","132","133","134","135","136"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("130","131","132","133","134","135","136")) and (index_date le svcdate le period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 2582 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('130', '131', '132', '133', '134', '135', '136') and (index_date<=svcdate) and (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_PARA has 2582 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   proc sort data = _04_post_para nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 2582 observations read from the data set WORK._04_POST_PARA.
 NOTE: 2 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_PARA has 2580 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   data _04_post2_para;
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   set _04_post_para ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   format first_svcdate_para mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_para = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 2580 observations read from the data set WORK._04_POST_PARA.
 NOTE: The data set WORK._04_POST2_PARA has 2580 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   proc sort data =_04_post2_para nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 2580 observations read from the data set WORK._04_POST2_PARA.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_PARA has 2580 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   data _04_pre_para ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   format pre_para 4. ;
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   pre_para = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to para
 SYMBOLGEN:  Macro variable PARA resolves to "130","131","132","133","134","135","136"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("130","131","132","133","134","135","136")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 116 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('130', '131', '132', '133', '134', '135', '136') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_PARA has 116 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to para
 MPRINT(INCIDENCE):   proc sort data = _04_pre_para nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 116 observations read from the data set WORK._04_PRE_PARA.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_PARA has 116 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 12; loop will iterate again.
 MLOGIC(INCIDENCE):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 12
 MLOGIC(INCIDENCE):  %LET (variable name is INT)
 MLOGIC(INCIDENCE):  %LET (variable name is ZOO)
 MLOGIC(INCIDENCE):  %LET (variable name is OTHBACT)
 MLOGIC(INCIDENCE):  %LET (variable name is HIV)
 MLOGIC(INCIDENCE):  %LET (variable name is VIR)
 MLOGIC(INCIDENCE):  %LET (variable name is ARTH)
 MLOGIC(INCIDENCE):  %LET (variable name is CHLY)
 MLOGIC(INCIDENCE):  %LET (variable name is RICKET)
 MLOGIC(INCIDENCE):  %LET (variable name is SPIRO)
 MLOGIC(INCIDENCE):  %LET (variable name is HELMINTH)
 MLOGIC(INCIDENCE):  %LET (variable name is PARA)
 MLOGIC(INCIDENCE):  %LET (variable name is LATE)
 MPRINT(INCIDENCE):   ;
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   data _04_post_late ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   format post_late 5. ;
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   post_late =1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to late
 SYMBOLGEN:  Macro variable LATE resolves to "137","138","139"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in:("137","138","139")) and (index_date le svcdate le period_stop) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 33 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('137', '138', '139') and (index_date<=svcdate) and (svcdate<=period_stop);
 NOTE: The data set WORK._04_POST_LATE has 33 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.02 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   proc sort data = _04_post_late nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 33 observations read from the data set WORK._04_POST_LATE.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST_LATE has 33 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   data _04_post2_late;
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   set _04_post_late ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   format first_svcdate_late mmddyy10. ;
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   if first.enrolid then first_svcdate_late = svcdate;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 33 observations read from the data set WORK._04_POST_LATE.
 NOTE: The data set WORK._04_POST2_LATE has 33 observations and 8 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   proc sort data =_04_post2_late nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 33 observations read from the data set WORK._04_POST2_LATE.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_POST2_LATE has 33 observations and 8 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   data _04_pre_late ;
 MPRINT(INCIDENCE):   set derived._01_incidence;
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   format pre_late 4. ;
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   pre_late = 1 ;
 SYMBOLGEN:  && resolves to &.
 SYMBOLGEN:  Macro variable INF resolves to late
 SYMBOLGEN:  Macro variable LATE resolves to "137","138","139"
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 MPRINT(INCIDENCE):   where (code in: ("137","138","139")) and (svcdate le index_date) ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 2 observations read from the data set DERIVED._01_INCIDENCE.
       WHERE code in: ('137', '138', '139') and (svcdate<=index_date);
 NOTE: The data set WORK._04_PRE_LATE has 2 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.03 seconds
       
 
 SYMBOLGEN:  Macro variable INF resolves to late
 MPRINT(INCIDENCE):   proc sort data = _04_pre_late nodupkey ;
 MPRINT(INCIDENCE):   by enrolid svcdate ;
 MPRINT(INCIDENCE):   run ;
 
 NOTE: There were 2 observations read from the data set WORK._04_PRE_LATE.
 NOTE: 0 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_PRE_LATE has 2 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MLOGIC(INCIDENCE):  %DO loop index variable I is now 13; loop will not iterate again.
 MPRINT(INCIDENCE):   data _04_allevents ;
 MPRINT(INCIDENCE):   merge _04_post2_int _04_post2_zoo _04_post2_othbact _04_post2_hiv _04_post2_vir _04_post2_arth _04_post2_chly 
 _04_post2_ricket _04_post2_spiro _04_post2_helminth _04_post2_para _04_post2_late _04_pre_int _04_pre_zoo _04_pre_othbact 
 _04_pre_hiv _04_pre_vir _04_pre_arth _04_pre_chly _04_pre_ricket _04_pre_spiro _04_pre_helminth _04_pre_para _04_pre_late ;
 MPRINT(INCIDENCE):   by enrolid;
 MPRINT(INCIDENCE):   run;
 
 NOTE: MERGE statement has more than one data set with repeats of BY values.
 NOTE: There were 2925 observations read from the data set WORK._04_POST2_INT.
 NOTE: There were 12 observations read from the data set WORK._04_POST2_ZOO.
 NOTE: There were 23222 observations read from the data set WORK._04_POST2_OTHBACT.
 NOTE: There were 0 observations read from the data set WORK._04_POST2_HIV.
 NOTE: There were 702 observations read from the data set WORK._04_POST2_VIR.
 NOTE: There were 11 observations read from the data set WORK._04_POST2_ARTH.
 NOTE: There were 17475 observations read from the data set WORK._04_POST2_CHLY.
 NOTE: There were 39 observations read from the data set WORK._04_POST2_RICKET.
 NOTE: There were 9 observations read from the data set WORK._04_POST2_SPIRO.
 NOTE: There were 16 observations read from the data set WORK._04_POST2_HELMINTH.
 NOTE: There were 2580 observations read from the data set WORK._04_POST2_PARA.
 NOTE: There were 33 observations read from the data set WORK._04_POST2_LATE.
 NOTE: There were 132 observations read from the data set WORK._04_PRE_INT.
 NOTE: There were 0 observations read from the data set WORK._04_PRE_ZOO.
 NOTE: There were 590 observations read from the data set WORK._04_PRE_OTHBACT.
 NOTE: There were 0 observations read from the data set WORK._04_PRE_HIV.
 NOTE: There were 40 observations read from the data set WORK._04_PRE_VIR.
 NOTE: There were 0 observations read from the data set WORK._04_PRE_ARTH.
 NOTE: There were 541 observations read from the data set WORK._04_PRE_CHLY.
 NOTE: There were 7 observations read from the data set WORK._04_PRE_RICKET.
 NOTE: There were 0 observations read from the data set WORK._04_PRE_SPIRO.
 NOTE: There were 3 observations read from the data set WORK._04_PRE_HELMINTH.
 NOTE: There were 116 observations read from the data set WORK._04_PRE_PARA.
 NOTE: There were 2 observations read from the data set WORK._04_PRE_LATE.
 NOTE: The data set WORK._04_ALLEVENTS has 40931 observations and 42 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.07 seconds
       cpu time            0.07 seconds
       
 
 MPRINT(INCIDENCE):   proc sql;
 MPRINT(INCIDENCE):   create table _04_allevents2 as select distinct a.* from derived._01_incidence as a left join _04_allevents as 
 b on a.enrolid = b.enrolid ;
 NOTE: Table WORK._04_ALLEVENTS2 created, with 195101 rows and 6 columns.
 
 MPRINT(INCIDENCE):   quit ;
 NOTE: PROCEDURE SQL used (Total process time):
       real time           2.25 seconds
       cpu time            4.13 seconds
       
 
 MLOGIC(INCIDENCE):  Ending execution.
 200        
 201        
 202        /*INCIDENCE RATE CALCULATION- INCIDENCE IS THE NUMBER OF NEW EVENTS OR NUMBER OF PATIENTS WHO HAD A SVCDATE FOR ANY
 202      ! SERIOUS INFECTION ON OR
 203        AFTER THE INDEX_DATE DIVIDED BY THE NUMBER OF PERSON YEARS - WHICH IS PERIOD_STOP - SVCDATE / 365 DAYS FOR EACH PATIENT
 203      ! AT RISK
 204        (PATIENTS  AT RISK ARE ALL PATEINTS WHO HAD INCIDENCE OF A DISEASE AFTER THE INDEX_DATE UNTIL THEY GOT THE DISEASE*/
 205        
 206        %macro inc_cal ;/*since we need to divide our results into specific infections we are making another macros to read al
 206      ! the codes
 207        and then make seperate datasets of it accordingly*/
 208        
 209        %do i = 1 %to 12 ;
 210        
 211        %let inf = %scan(int*zoo*othbact*hiv*vir*arth*chly*ricket*spiro*helminth*para*late, &i., *) ;
 212        
 213        proc sort data =_04_allevents2 out= _04_inc_cal nodupkey ;
 214        by enrolid ;
 215        run ;
 216        
 217        /*GETTING RID OF PATIENTS HAVING SVCDATE FOR INFECTIONS PRIOR TO THE INDEX DATE*/
 218        data _04_inc_cal1 ;
 219        set _04_inc_cal ;
 220        by enrolid ;
 221        if pre_&inf. =1 then delete ;
 222        run ;
 223        
 224        /*PERSON YEAR CALCULATION*/
 225        /*FINDING THE LAST DATE OF THE DATASET*/
 226        proc sql ;
 227        create table test as
 228        select max(period_stop) as date format mmddyy10.
 229        from dmk_scan.periods_cm_rx ;
 230        quit ;
 231        
 232        data _04_inc_cal2 ;
 233        set _04_inc_cal1 ;
 234        if post_&inf. =1 then py_&inf. = (min(period_stop, '30sep2017'D,first_svcdate_&inf.) - index_date +1)/365.25;
 235        else if post_&inf. = . then py_&inf. = (min(period_stop, '30sep2017'D) - index_date +1)/365.25 ;
 236        else if post_&inf. <0 then delete ;
 237        run ;
 238        
 239        /*CREATING TABLE FOR INCIDENCE RATE CALCLUATION - CI, RATE CALCUALTION , NO. OF NEW EVENTS, PY*/
 240        
 241        proc sql;
 242        create table _04_inc_table_&i. as
 243        select "&inf." as col,
 244        , COUNT(enrolid) as N
 245        , SUM(&inf.) as events
 246        , SUM(P_Years) as PYs
 247        , (SUM(&inf.)/SUM(py_&inf.))*10000 as IR
 248        , CINV(0.025,2*SUM(&inf.))/(2*SUM(py_&inf.))*100000 as Lower95
 249        , CINV(0.975,2*(SUM(&inf.)+1))/(2*SUM(py_&inf.))*100000 AS Upper95
 250        from _04_inc_cal2 ;
 251        quit ;
 252        
 253        %end ;
 254        
 255        /*SET ALL THE DATASETS*/
 256        data derived._04_final_inc;
 257        set _04_inc_table_1 - _04_inc_table_12 ;
 258        run ;
 259        
 260        %mend inc_cal ;
 261        %inc_cal;
 MLOGIC(INC_CAL):  Beginning execution.
 MLOGIC(INC_CAL):  %DO loop beginning; index variable I; start value is 1; stop value is 12; by value is 1.  
 MLOGIC(INC_CAL):  %LET (variable name is INF)
 SYMBOLGEN:  Macro variable I resolves to 1
 MPRINT(INC_CAL):   proc sort data =_04_allevents2 out= _04_inc_cal nodupkey ;
 MPRINT(INC_CAL):   by enrolid ;
 MPRINT(INC_CAL):   run ;
 
 NOTE: There were 195101 observations read from the data set WORK._04_ALLEVENTS2.
 NOTE: 179819 observations with duplicate key values were deleted.
 NOTE: The data set WORK._04_INC_CAL has 15282 observations and 6 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.09 seconds
       cpu time            0.10 seconds
       
 
 MPRINT(INC_CAL):   data _04_inc_cal1 ;
 MPRINT(INC_CAL):   set _04_inc_cal ;
 MPRINT(INC_CAL):   by enrolid ;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INC_CAL):   if pre_int =1 then delete ;
 MPRINT(INC_CAL):   run ;
 
 NOTE: Variable pre_int is uninitialized.
 NOTE: There were 15282 observations read from the data set WORK._04_INC_CAL.
 NOTE: The data set WORK._04_INC_CAL1 has 15282 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.02 seconds
       
 
 MPRINT(INC_CAL):   proc sql ;
 MPRINT(INC_CAL):   create table test as select max(period_stop) as date format mmddyy10. from dmk_scan.periods_cm_rx ;
 NOTE: Data file DMK_SCAN.PERIODS_CM_RX.DATA is in a format that is native to another host, or the file encoding does not match the 
       session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce 
       performance.
 NOTE: Table WORK.TEST created, with 1 rows and 1 columns.
 
 MPRINT(INC_CAL):   quit ;
 NOTE: PROCEDURE SQL used (Total process time):
       real time           7.82 seconds
       cpu time            7.83 seconds
       
 
 MPRINT(INC_CAL):   data _04_inc_cal2 ;
 MPRINT(INC_CAL):   set _04_inc_cal1 ;
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INC_CAL):   if post_int =1 then py_int = (min(period_stop, '30sep2017'D,first_svcdate_int) - index_date +1)/365.25;
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INC_CAL):   else if post_int = . then py_int = (min(period_stop, '30sep2017'D) - index_date +1)/365.25 ;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INC_CAL):   else if post_int <0 then delete ;
 MPRINT(INC_CAL):   run ;
 
 NOTE: Variable post_int is uninitialized.
 NOTE: Variable first_svcdate_int is uninitialized.
 NOTE: There were 15282 observations read from the data set WORK._04_INC_CAL1.
 NOTE: The data set WORK._04_INC_CAL2 has 15282 observations and 10 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       
 
 MPRINT(INC_CAL):   proc sql;
 SYMBOLGEN:  Macro variable I resolves to 1
 SYMBOLGEN:  Macro variable INF resolves to int
 22: LINE and COLUMN cannot be determined.
 NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, 
               a missing value, *, BTRIM, INPUT, PUT, SUBSTRING, USER.  
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INC_CAL):   create table _04_inc_table_1 as select "int" as col, , COUNT( enrolid) as N , SUM(int) as events , SUM(P_Years) 
 as PYs , (SUM(int)/SUM(py_int))*10000 as IR , CINV(0.025,2*SUM(int))/(2*SUM(py_int))*100000 as Lower95 , 
 CINV(0.975,2*(SUM(int)+1))/(2*SUM(py_int))*100000 AS Upper95 from _04_inc_cal2 ;
 NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
 MPRINT(INC_CAL):   quit ;
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE SQL used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds

This is the error in the log above :- 

NOTE: Variable post_int is uninitialized.
NOTE: Variable first_svcdate_int is uninitialized.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Look at the FIRST error in the log.  SAS cannot give you a nice pointer to where it thinks the error is because you are running a macro. So take the MPRINT lines of code and paste them back into the program editor and try to re-run them.

 

You will immediately notice that your PROC SQL code has two commas next to each other.

 243        select "&inf." as col,
 244        , COUNT(enrolid) as N

**rant**

Yet another reason to NEVER put continuation characters at the END of the line (like line 243). 

Instead always place them at the start of the continuation line.

It is much easier for a human to scan down the left side of the lines of text an quickly see that the new lines are continuations of the previous line.  Trying to scan the ragged right hand side of the lines is much harder.  Not to mention when you start having code with more than 75 characters on a line so that you have to keep shifting your eyes from left to right. ... 

View solution in original post

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

From:

 MPRINT(INC_CAL):   data _04_inc_cal2 ;
 MPRINT(INC_CAL):   set _04_inc_cal1 ;
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INC_CAL):   if post_int =1 then py_int = (min(period_stop, '30sep2017'D,first_svcdate_int) - index_date +1)/365.25;
 SYMBOLGEN:  Macro variable INF resolves to int
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INC_CAL):   else if post_int = . then py_int = (min(period_stop, '30sep2017'D) - index_date +1)/365.25 ;
 SYMBOLGEN:  Macro variable INF resolves to int
 MPRINT(INC_CAL):   else if post_int <0 then delete ;
 MPRINT(INC_CAL):   run ;
 
 NOTE: Variable post_int is uninitialized.
 NOTE: Variable first_svcdate_int is uninitialized.

The log is telling you that in  dataset 

_04_inc_cal1 

There is no variable post_int or first_svcdate.

 

I would really advise you to put those lists into a dataset, maybe something like:
CAT   CODE

int      001

int      002

...

zoo    020

 

And then merge that data on rather than using list.  Also, creating lots of the same datasets is also not great, it uses more resources, and is not as easy to program with.  By groups are designed for this.   So merge your CAT on from above, then use that to by group your data.  Most of the code given (though I don't have time to look closely) is just splitting out the data into lots of datasets, then merging back again.

manya92
Fluorite | Level 6

How can i group by using my MACROS I used previously.

Tom
Super User Tom
Super User

Look at the FIRST error in the log.  SAS cannot give you a nice pointer to where it thinks the error is because you are running a macro. So take the MPRINT lines of code and paste them back into the program editor and try to re-run them.

 

You will immediately notice that your PROC SQL code has two commas next to each other.

 243        select "&inf." as col,
 244        , COUNT(enrolid) as N

**rant**

Yet another reason to NEVER put continuation characters at the END of the line (like line 243). 

Instead always place them at the start of the continuation line.

It is much easier for a human to scan down the left side of the lines of text an quickly see that the new lines are continuations of the previous line.  Trying to scan the ragged right hand side of the lines is much harder.  Not to mention when you start having code with more than 75 characters on a line so that you have to keep shifting your eyes from left to right. ... 

manya92
Fluorite | Level 6

I corrected that error but the output I see is not correct. I am getting the same number for all categories whereas i should see different number for each category. How do I achieve this using the same code that i have. 

Tom
Super User Tom
Super User
Run an example with only two or three categories and figure out where your logic error is.
Then you can expand the code for all of the categories.
Or perhaps you might want to consider a different algorithm instead. For help with that you would need to explain what you are trying to do (in a new question).

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 1008 views
  • 0 likes
  • 3 in conversation