The below output datasets, I would like to create do loop (month and year) , so that it will iterate total no of times . Can you please someone help me? so that these values I can pass into a different macro. date date_ month year 3/3/2018 3/3/2018 303 2018 3/10/2018 3/10/2018 310 2018 3/17/2018 3/17/2018 317 2018 3/24/2018 3/24/2018 324 2018 3/31/2018 3/31/2018 331 2018 SAS Code: data want; sub_table_date='01MAR2018'd; end_date=intnx('month', sub_table_date, 0, 'e'); do date=sub_table_date to end_date; if weekday(date)=7 then output ; end; format date mmddyy10.; keep date; run; data test; set want; date_= put(date, mmddyy10.); month=trim(compress(substr(date_,1,5),'/')); year= substr(date_,7,4); call symput( 'mon',month); call symput( 'yr',year); run; Finally I would like pass this 'mon' and 'yr' value into a do loop statement. %visit(&mon.,&yr.);
... View more