Hi, I am trying to do the following to pass in the system date and subtract the date so the StartDate will read 09MAR2009 and the EndDate will be 15MAR2009. I'm not sure if I am doing this correctly. This will allow me to run the code automatically instead of hard coding a date each time. Any help is appreciated!
%LET StartDate =%sysfunc(intnx(week.2, "&SYSDATE"D, 0), DATE9.);
%LET EndDate =%sysfunc(intnx(week.7, "&SYSDATE"D, 0), DATE9.);
PROC SQL;
CREATE TABLE TD_Mature AS
SELECT distinct t.contract_no AS Matured_TD
FROM ptware.term_deposits t
WHERE t.mature_date between '&StartDate' and '&EndDate'
AND t.cease_date is not null
AND t.mature_date = t.cease_date;
quit;
... View more