Originally posted by: repanzer
I don't know about holidays, but maybe if you do;
FROMDATETIME(CURRENTDATETIME(),"DAY") will return the name of the day, i.e. Monday.
So, you could do something like "IF( FROMDATETIME(CURRENTDATETIME(),"DAY")=MONDAY, ADDDAYS(number of weeks times 7 - number of weeks times 2).
Number of weeks times 7 is the total days, and number of weeks times seven minus two gives you the number of saturdays and sundays.
or MAYBE, and this is a strong maybe, and also strongly dependent on what you're trying to achieve, you can add logic like;
IF( FROMDATETIME(ADDDAYS(CURRENTDATETIME(), 10), {DAY}) = "SATURDAY", then put in logic to deal with Saturday and Sunday.
IF( FROMDATETIME(ADDDAYS(CURRENTDATETIME(), 10), {DAY}) = "SATURDAY", then do this
IF( FROMDATETIME(ADDDAYS(CURRENTDATETIME(), 10), {DAY}) = "SUNDAY", then do this
IF( FROMDATETIME(ADDDAYS(CURRENTDATETIME(), 10), {DAY}) = "MONDAY", then do this
IF( FROMDATETIME(ADDDAYS(CURRENTDATETIME(), 10), {DAY}) = "TUESDAY", then do this
IF( FROMDATETIME(ADDDAYS(CURRENTDATETIME(), 10), {DAY}) = "WENDSDAY", then do this
IF( FROMDATETIME(ADDDAYS(CURRENTDATETIME(), 10), {DAY}) = "THURSDAY", then do this
IF( FROMDATETIME(ADDDAYS(CURRENTDATETIME(), 10), {DAY}) = "FRIDAY", then do this
Basically, you have the tools to let the system know what day of the week it is, and also what day of the week it is if you take a date and add any number of days. So something like the logic above could work for certain, specific circumstances, like if your add days lands on a Saturday, the add two more days.
Holidays would be rough, but not impossible. The system will need to know what day is a holiday, and you can put them all in a cross reference, like;
11/27, THANKSGIVING
12/25, Christmas
Then, IF(PRESENT(LOOKUP(DATE_in_CrossRefernce, where FROMDATETIME(CURRENTDATE(), "MM/DD") = FirstField in Cross reference)). If it's present, that day is a holiday.
good luck
#DataExchange#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender