Java Reference
In-Depth Information
03 MYSUB-TRAFFIC-COP-IN PIC X.
88 MYSUB-IN-FUNCTION-EXTENDED VALUE "E".
03 MYSUB-TRAFFIC-COP-OUT PIC X.
88 MYSUB-OUT-FUNCTION-EXTENDED VALUE "E".
03 MSG-TEXT PIC X(20).
03 MSG-SIZE PIC 9(8).
03 MYSUB-RETURNED-CALL-COUNTER PIC 9(10).
03 MYSUB-PRIVATE-ITEMS PIC X(20).
*
In the subroutine's definition of MYSUB-CONTROL,
*
PRIVATE-ITEMS is redefined with items known only to the subroutine.
03 FILLER REDEFINES MYSUB-PRIVATE-ITEMS.
05 MYSUB-PRIVATE-COUNTER PIC 9(8).
05 MYSUB-OTHER-PRIVATE-ITEMS PIC X(12).
01 TEXT-STRING PIC X(20).
PROCEDURE DIVISION USING MYSUB-CONTROL, TEXT-STRING.
MYSUB-INITIAL SECTION.
MYSUB-INITIAL-S.
*
Perform the function to detect the number of arguments.
PERFORM GET-ARGUMENT-COUNT.
*
Perform the INITIALIZE function if requested.
IF MYSUB-ACTION-INITIALIZE
MOVE 0 TO MYSUB-PRIVATE-COUNTER
ELSE
*
Prepare the text argument and increment the counters, but only if
*
not "continuing" from an incomplete extended function.
IF NOT MYSUB-IN-FUNCTION-EXTENDED
IF ARGUMENT-COUNT = 2
MOVE TEXT-STRING TO LOCAL-TEXT
ELSE
MOVE MSG-TEXT TO LOCAL-TEXT
END-IF
*
Increment the Global counter.
ADD 1 TO CALL-COUNTER
*
Increment the Instance counter.
ADD 1 TO MYSUB-PRIVATE-COUNTER.
*
Process the ACTION-SWITCHES.
*
If requested, return the value in the counter variable.
IF MYSUB-ACTION-GET-CALL-COUNTER
MOVE CALL-COUNTER TO MYSUB-RETURNED-CALL-COUNTER
Search WWH ::




Custom Search