Example program using the AR/CTL common call

The following figure shows fragments of a COBOL application program that uses AR/CTL common calls.

AR/CTL common call example COBOL program

WORKING-STORAGE SECTION.
01  FUNCTION                    PICTURE X(4).
01  STATUSCD                    PICTURE X(2)
                                VALUE SPACES.
01  FORCEOPT                    PICTURE X(3)
                                VALUE 'NO '.
01  IOAREALN                    PICTURE  S9(8)
                                USAGE COMPUTATIONAL
                                VALUE +12.
01  IOAREA                      PICTURE X(12)
                                VALUE SPACES.
01  AREA0BEG...
01  AREA0END...
01  AREA1BEG...
01  AREA1END...
01  AREA2BEG...
01  AREA2END...
01  AREA3BEG...
01  AREA3END...
01  AREA4BEG...
01  AREA4END...
01  AREA5BEG...
01  AREA5END...
01  AREA6BEG...
01  AREA6END...
PROCEDURE DIVISION
MOVE 'XRST' TO FUNCTION.
CALL 'CBLTARC' USING FUNCTION,STATUSCD,FORCEOPT,IOAREALN,
                   IOAREA,AREA0BEG,AREA0END,AREA1BEG,AREA1END,
                   AREA2BEG,AREA2END,AREA3BEG,AREA3END,
                   AREA4BEG,AREA4END,AREA5BEG,AREA5END,
                   AREA6BEG,AREA6END.
IF STATUSCD IS EQUAL TO SPACES
    THEN
        NEXT SENTENCE
    ELSE
        PERFORM STATUSCDERROR.

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Comments