Previous Topic: Call OPSLINK from COBOL ProgramsNext Topic: Define the OPSLINK Routine in COBOL Programs


Define an Output Array in COBOL Programs

The optional sixth argument of all OPSLINK calls is an output array that should be defined as:

DATA DIVISION.
   01 ARRAY           OCCURS 200 TIMES.
   03 LINE-LENGTH     PIC 9(4) COMP.
   03 LINE-TEXT       PIC X(256).

The size 200 is arbitrary, but should be large enough to accommodate the maximum number of output lines you expect each call to return. The fifth argument passed to OPSLINK sets the size of the array.

Note: The fifth argument had set it to 200 in the above example.