Example 1 (COBOL)

The following is an example of a COBOL program calling IDISNAP five times, showing each of the different invocation styles. As indicated by the DYNAM option in the CBL statement of the COBOL source, IDISNAP is called dynamically in this example.
CBL APOST,NOOPT,DYNAM,XREF,LIST,SSRANGE,RENT,MAP
      IDENTIFICATION DIVISION.
      PROGRAM-ID. COBMST4X
      ENVIRONMENT DIVISION.
      INPUT-OUTPUT SECTION.
      FILE-CONTROL.
      DATA DIVISION.
      FILE SECTION.

      WORKING-STORAGE SECTION.
      01  FILLER        PIC X(20) VALUE 'WORKING-STORAGE'.
      01  PARM1         PIC X(4) .
      01  PARM2.
       02 PARM2MSG      PIC X(40) VALUE 'HEADING FOR IDIXSNAP'.
       02 PARM2WORK     PIC X(100) .
      01  PARM3         PIC X(140) VALUE 'DATASETS(IDIHIST(NULLFILE))'.
      01  DATAA         PIC X(200) VALUE 'DATAA'.
      01  DATAB         PIC X(200) VALUE 'DATAB'.
      01  DATAC         PIC X(200) VALUE 'DATAC'.
      01  DATAD         PIC X(200) VALUE 'DATAD'.
      01  DATAE         PIC X(200) VALUE 'DATAE'.
      01  DATAF         PIC X(200) VALUE 'DATAF'.
      01  DATAG         PIC X(200) VALUE 'DATAG'.
      PROCEDURE DIVISION.
      MAIN SECTION.
      START000.
****** 5 CALLS TO IDISNAP
          CALL "IDISNAP".
          MOVE "0000" TO PARM1.
          CALL "IDISNAP" USING PARM1.
          MOVE "0001" TO PARM1.
          CALL "IDISNAP" USING PARM1 PARM2.
          MOVE "0002" TO PARM1.
          CALL "IDISNAP" USING PARM1 PARM2 PARM3.
          MOVE "000V" TO PARM1.
          CALL "IDISNAP" USING PARM1 PARM2 PARM3 PARM1 PARM2WORK
                DATAA DATAB DATAC DATAD.
          GOBACK.
      END PROGRAM COBMST4X.