TIRFTNUM

TIRFTNUM is a called module supplied with CA Gen. TIRFTNUM is called every time an CA Gen action diagram uses the NUMTIME function.

NUMTIME converts a valid time into a numeric value.

NUMTIME generates the following COBOL statements:

Statement

Quantity

Call

1

Compute

2

Move

2

Initialize

1

IF

1

Heavy use of NUMTIME can drastically increase CPU costs.

Example

The following example converts the current time (11:16:55) into the numeric value 111655.

 

SET local work_set time_nbr TO numtime(CURRENT_TIME)

Hints

If an action diagram uses NUMTIME more than once for the same time:

  • use NUMTIME once for the desired time

  • save the numeric value returned in a local view

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

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

If NUMTIME is used in an action diagram that uses several CA Gen functions, or the action diagram has high CPU usage due to NUMTIME, consider converting the action diagram to an external action block.

Example (COBOL External Action Block)

In this example, only one COBOL statement is needed to convert a time into a numeric value.

LINKAGE SECTION.

01 IMPORT-0001EV.

03 WORK-VIEW-0001ET.

05 TIME-FLD1-0001AS PIC X(0001).

05 TIME-FLD1-0001 PIC S9(0006).

05 TIME-FLD1-0001XX REDEFINES TIME-FLD1-0001

PIC X(0006).

01 EXPORT-0002EV.

03 WORK-VIEW-0002ET.

05 INTEGER-FLD1-0002AS PIC X(0001).

05 INTEGER-FLD1-0002 PIC S9(0006).

05 INTEGER-FLD1-0002XX REDEFINES INTEGER-FLD1-0002

PIC X(0006).

PROCEDURE DIVISION.

MOVE TIME-FLD1-0001 TO INTEGER-FLD1-0002.