Home > Software design >  SAS: How do I skip an error in a do loop?
SAS: How do I skip an error in a do loop?

Time:08-18

I am trying to skip a selection in the do loop if there is an error.

I am running the following code:

  %macro date_loop(start,end);
   %let start=%sysfunc(inputn(&start,anydtdte9.));
   %let end=%sysfunc(inputn(&end,anydtdte9.));
   %let dif=%sysfunc(intck(weekday,&start,&end));
     %do i=0 %to &dif;
      %let date=%sysfunc(intnx(weekday,&start,&i,b),yymmddn8.);
      %put &date;
       MY CODE TO OPEN FILE WITH THAT DATE
     %end;
   %mend date_loop;

              
  • Related