title: Do Loop within PROC PHREG
body: <p>Can someone tell me if these two would be equivalent?</p>
  
  <pre><code>PROC PHREG DATA=data;
  ARRAY start{*} exp_start1-exp_start100;
  ARRAY stop{*} exp_STOP1-exp_STOP100;
  use=0;
  DO I=1 TO 100;
  IF stop{I}&gt;start{I} AND start{I}&lt;time2event THEN use=1;
  END;
  MODEL time2event*censor(1)=use/risklimits covb;
  RUN;
  </code></pre>
  
  <p>AND:</p>
  
  <pre><code>data _want;
  data _have;
  ARRAY start{*} exp_start1-exp_start100;
  ARRAY stop{*} exp_STOP1-exp_STOP100;
  use=0;
  DO I=1 TO 100;
  IF stop{I}&gt;start{I} AND start{I}&lt;time2event THEN use=1;
  END;
  run;
  **PROC PHREG DATA=_want;**
  MODEL time2event*censor(1)=use/risklimits covb;
  RUN;
  </code></pre>
  
  <p>Basically, can do the DO loop be outside of the PROC PHREG procedure when trying to incorporate time-dependent covariates?</p>
  
  <p>Thanks! </p>