IBM Support

Example for the use of settlementDate() function

Technote (FAQ)


Can you please supply an example of the use of the settlementDate function to subtract 40 working days from the current date.


Project requirement.


The function does not contain any functionality to determine the current date.

The function does working day calculations - i.e. it ignores weekends and bank holidays. The function requires a file containing bank holiday definitions (as these vary by locale). If there are no bank holidays to apply then an empty text file may be referenced.

Given the current date the function can determine an offset from the current date. e.g.

Which is correct since 31/July/2013 is 40 working days prior to 25/Sept/2013. (I find it is easier to think in terms of 5 day working weeks - 40 days is 8 * 5 days, there are 5 days in a week, so these dates are 8 weeks apart.)

To retrieve the current date we can call now() passing the required date format, and hence our expression would become:

Please be aware that doing this may make the test non-deterministic, so please use the now() function with care to ensure that the success or failure of your tests is not dependent on the current date (even if the execution of that test were to span midnight local time, should your testing sometimes run overnight).

If you wish to calculate a date based upon calendar days rather than working days then there is no need to use the settlementDate() function, and such a calculation cannot be done using settlementDate().

N.B. The above expressions are given using the IBM Rational Integration Tester (RIT) legacy syntax. This syntax can be used in RIT anywhere that an expression can be evaluated. Within the Function Action the alternate ECMAScript syntax may be used, so the expression would then become:
settlementDate( now("yyyyMMdd"), -40, tags["PROJECT/ROOT"]+"/empty.txt", "yyyyMMdd")

Document information

More support for: Rational Test Workbench
Rational Integration Tester

Software version: 8.0, 8.5

Operating system(s): AIX, Linux, OS X, Solaris, Windows

Software edition: All Editions

Reference #: 1652057

Modified date: 13 November 2013

Translate this page: