TIRDAT2

TIRDAT2 is a called module supplied with CA Gen. TIRDAT2 is called every time an action diagram uses the CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP expressions.

These expressions obtain the current date, current time, and current timestamp (respectively) from the operating system clock. They generate the following COBOL statements:

 

Statement

Current date

Current time

Current Timestamp

Call

1

1

1

Compute

3

3

5

Move

4

4

6

Initialize

1

1

1

 

Heavy use of these expressions can drastically increase CPU costs.

Hints

If any of these expressions are used more than once in an action diagram for the same value:

  • use the expression once for the desired value

  • save the date/time/timestamp returned in a local view

  • use the local view instead of the expression for the remaining instances

  • pass the local view to the import view of any called action diagrams that need it.

Example

The following example saves the value of Current Date (in conjunction with the days function) in a local view and then uses that value repeatedly in a FOR loop. Instead of calling the TIRDAT2 module 1000 times, it will be called only once.

 

+- AB_CALC_TERMINATION_NBR_OF_DAYS

| IMPORTS:

| Group View import_group (optional,1000,implicit,import only)

| Entity View import_grp employee (optional,transient)

| social_security_nbr (optional)

| last_name (optional

| termination_date (optional)

| EXPORTS:

| LOCALS:

| Work View local work_set

| current_nbr_of_days

| nbr_of_days

| ENTITY ACTIONS:

|

| SET local work_set current_nbr_of_days TO days(CURRENT_DATE)

|

| += FOR EACH import_group

| |

| | SET local work_set nbr_of_days TO local work_set current_nbr_of_days

| | - days(import_grp employee termination_date)

| |

| | USE xab_list_termination_info

| | WHICH IMPORTS: Entity View import_grp employee

| | Work View local work_set

| +--

+--