BookmarkSubscribeRSS Feed
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

is this what you are looking for?

 


data _null_;
	xd = today();
	end=input(put(xd,yymmdd8.),yymmdd8.);
	start='24JAN2019'd;
	call symput('end',put(end,yymmdd10.)); 
	call symput('start',put(start,yymmdd10.));
	put end;
	format start mmddyy10. end mmddyy10. ;
run;
data _null_;
	%put _user_;
run;
data set_weeks;
retain fmtname 'weeks';
start=&start;
end=start+6;
label="Week: "||PUT(start, mmddyy10.)||" - "||PUT(end, mmddyy10.);
OUTPUT;
DO UNTIL (end > &end);
start=start+7;
end=end+7;
label="Week: "||PUT(start, mmddyy10.)||" - "||PUT(end, mmddyy10.);
OUTPUT;
end;
keep fmtname start end label;
format start end mmddyy10.;
run;
fordcr2
Obsidian | Level 7

No, because not all start dates are going to be 24Jan2019. I need the start date to be the date that the participant logged in (participant_startdate).

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 16 replies
  • 4319 views
  • 0 likes
  • 3 in conversation