-
1. Re: Need to set a variable to end of week Friday
Paul Robins Nov 13, 2019 11:49 PM (in response to Stacy Hill-Sanders)3 of 3 people found this helpfulIf your job is running on a set date then you just use %%$CALCDATE to add the required number of days.
Otherwise, I'm thinking to use %%OWDAY. Depending on when your start day of week is will determine whether this works.
If my start day of week is Saturday, then %%OWDAY for Saturday is 0, Sunday is 1, Friday is 6.
To determine how many days prior to Friday we are running do:
%%DAYGAP = 6 %%MINUS %%OWDAYSo if the job is scheduled on Monday (2), the gap is 4.
Then use
%%FRIDAY_DATE = %%$CALCDATE %%$ODATE +%%DAYGAP
Something like that. I haven't tested this code.
Hope this helps, it might not work depending on your start day of week, or maybe someone has a simpler idea!
Cheers,
Paul.
-
2. Re: Need to set a variable to end of week Friday
Stacy Hill-Sanders Nov 14, 2019 8:25 PM (in response to Paul Robins)Thank you, Paul. I will give this a try.
-
3. Re: Need to set a variable to end of week Friday
Ilyas Shaikh Nov 14, 2019 10:36 PM (in response to Stacy Hill-Sanders)1 of 1 people found this helpfulHi Stacy,
If the job is scheduled on Monday, you can use following to get the Friday date:
FRIDAY_DATE=%%$CALCDATE %%DATE -3
Regards,
Ilyas Shaikh