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).

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2578 views
  • 0 likes
  • 3 in conversation