So you need some way to loop over the list of values. For the method you started on to work the data step would need to generate macro calls that will execute after the data step finishes. You can use CALL EXECUTE for that. data dates1; array dates (17) $10 d1-d17 ('9-23-13','9-24-13','9-25-13','9-26-13','9-27-13','9-28-13' ,'9-29-13','9-30-13','10-1-13','10-2-13','10-3-13','10-4-13' ,'10-5-13','10-6-13', '10-7-13','10-8-13','10-9-13' ); do i=1 to 17; call execute(cats('%read_dates(',dates(i),',',cats('temp',i),')' )); end; run; You could also do the looping over the list in macro code instead. %macro read_date2(datelist,prefix); %local i date ; %do i=1 %to %sysfunc(countw(&datelist,%str( ))); %let date=%scan(&datelist,&i,%str( )); %read_dates(&date,&prefix.&i); %end; %mend read_date2 ; %read_date2 (9-23-13 9-24-13 9-25-13 9-26-13 9-27-13 9-28-13 9-29-13 9-30-13 10-1-13 10-2-13 10-3-13 10-4-13 10-5-13 10-6-13 10-7-13 10-8-13 10-9-13 ,temp );
... View more