10-31-2016 06:14 PM
10-31-2016 06:25 PM
This doesn't make a whole lot of sense. Why multiply the date by -1, that will cause issues down the road. You have multiple checks for day of week 1?
1. Look at DOWNAME format.
%let dow=%sysfunc(today(), downame.); %put &dow.;
2. Where is the error being generated from? You've posted a lot of code - what's the actual issue?
3. I don't see the keyword BETWEEN so not sure what you're referring to here.
10-31-2016 06:46 PM
You have a Teradata error but do no show any connection, so missing some information.
Also putting quotes into macro variables frequently causes issues and your DT varaible has spaces inside the single quotes which may be even more problematic depending on use.
I would also suggest use of DATE9. so that you have a 4 digit year just in case year values become an issue. Some other program may assume that 16 is 1916.
11-01-2016 08:35 AM
You don't show the actual Teradata call, so a bit guessing here.
If you are using implicit pass through (using Libname to Teradata), I assume that you need to use a SAS date literal, you can either extend your macro variable, or add it at macro variable resolution.
If you are using explicit pass through, you need a format that Terdata accepts, and chances are that they prefer a ISO date.