Date Week Selector Task

The date quarter selector task displays an Options tab containing a combo box. The choices in the combobox are: When a selection made and values are specified in any dependent controls the following macro variables are created and set as follows:

An example of the code generated by this task when "Current week of previous year" is selected:

%global week;
%global week_end;
%global week_rel;
%global week_label;
%let week = %sysfunc(intnx(Week.2, %sysfunc(intnx(Year, %sysfunc(date()), -1, 
	s)), 0, b), DATE9.);
%let week_end = %sysfunc(intnx(Week.2, %sysfunc(intnx(Year, %sysfunc(date()), 
	-1, s)), 0, e), DATE9.);
%let week_label = Current week of last year;
%let week_rel = W0W-1Y;
%put _GLOBAL_;

If today is March 22, 2017 the macro variable values set by this example code are:

 GLOBAL WEEK 21MAR2016
 GLOBAL WEEK_END 27MAR2016
 GLOBAL WEEK_LABEL Current week of last year
 GLOBAL WEEK_REL W0W-1Y