TIRFNUM

TIRFNUM is a called module supplied with CA Gen. TIRFNUM is called every time an CA Gen Action Diagram uses the NUMTEXT function.

NUMTEXT converts a text value into a numeric value (without a sign or decimal point). The only special characters allowed in the text string are "+", "-", or ".".

NUMTEXT generates the following COBOL statements:

Statement

Quantity

Call

1

Compute

2

Move

2

Initialize

1

IF

1

Heavy use of NUMTEXT can drastically increase CPU costs.

Hints

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

  • use NUMTEXT once for the desired value

  • save the numeric value returned in a local view

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

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

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

Example (COBOL External Action Block)

In this example, only two COBOL statements are needed to convert the text value into a numeric value.

 

WORKING-STORAGE SECTION.

01 WS-FIELDS.

05 WS-TEXT-FIELD PIC X(09).

05 WS-INTEGER-FIELD REDEFINES WS-TEXT-FIELD

PIC 9(09).

LINKAGE SECTION.

01 IMPORT-0001EV.

03 WORK-VIEW-0001ET.

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

05 TEXT-9-0001 PIC X(0009).

05 TEXT-9-0001XX REDEFINES TEXT-9-0001

PIC X(0009).

01 EXPORT-0002EV.

03 WORK-VIEW-0002ET.

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

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

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

PIC X(0009).

PROCEDURE DIVISION.

MOVE TEXT-9-0001 TO WS-TEXT-FIELD.

MOVE WS-INTEGER-FIELD TO INTEGER-FLD1-0002.