TIRFTMEC

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

TIMETEXT converts a text value (in a valid time format) into a valid time.

TIMETEXT generates the following COBOL statements:

Statement

Quantity

Call

1

Compute

1

Move

3

Initialize

1

IF

1

Heavy use of TIMETEXT can drastically increase CPU costs.

Hints

If an action diagram uses TIMETEXT more than once for the same text value:

  • use TIMETEXT once for the desired text value

  • save the time returned in a local view

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

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

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

Example (COBOL External Action Block)

In this example, five COBOL statements are needed to convert a text value into a valid time.

WORKING-STORAGE SECTION.

01 WS-FIELDS.

03 WS-TIME-X.

05 WS-TIME-X-HOUR PIC 9(02).

05 FILLER PIC X(01) VALUE ':'.

05 WS-TIME-X-MINUTE PIC 9(02).

05 FILLER PIC X(01) VALUE ':'.

05 WS-TIME-X-SECOND PIC 9(02).

03 WS-TIME PIC 9(06).

03 WS-TIME-R REDEFINES WS_TIME.

05 WS-TIME-HOUR PIC 9(02).

05 WS-TIME-MINUTE PIC 9(02).

05 WS-TIME-SECOND PIC 9(02).

LINKAGE SECTION.

01 IMPORT-0001EV.

03 WORK-VIEW-0001ET.

05 TEXT-8-0001AS PIC X(0001).

05 TEXT-8-0001 PIC X(0008).

05 TEXT-8-0001XX REDEFINES TEXT-8-0001

PIC X(0008).

01 EXPORT-0002EV.

03 WORK-VIEW-0002ET.

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

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

05 TIME-FLD1-0002XX REDEFINES TIME-FLD2-0001

PIC X(0006).

PROCEDURE DIVISION.

MOVE TEXT-8-0001 TO WS-TIME-X.

MOVE WS-TIME-X-HOUR TO WS-TIME-HOUR.

MOVE WS-TIME-X-MINUTE TO WS-TIME-MINUTE.

MOVE WS-TIME-X-SECOND TO WS-TIME-SECOND.

MOVE WS-TIME TO TIME-FLD1-0002.