External Call support for Stringlists and $lists

From m204wiki
Revision as of 04:19, 7 February 2013 by Alex (talk | contribs) (Created page with "==$lists and ECF== A $list identifier can be passed to an ECF program, as in: <p class="syntax"><span class="literal">EXTERNAL CALL COBPROG WITH $LIST </span><span class="term...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

$lists and ECF

A $list identifier can be passed to an ECF program, as in:

EXTERNAL CALL COBPROG WITH $LIST inlist outlist

where:

inlist The $list identifier to be passed to the ECF program as input.
outlist The $list identifier to receive the data as modified by the ECF program. The contents of this $list are replaced with the ECF program output. The length of the $list items are made to match that of the input $list, and if the output $list is the same identifier as the input $list, the output data simply replaces the original input data. For PARMTYPE=INPUT ECF programs, the output $list is ignored.

The input $list is copied into the ECF parameter area before the ECF program is called. The $list items are concatenated and there is no way to determine where one ends and the next begins, so presumably the $list items would all have the same length, or some $list items have the length or number of occurrences of a following set of $list items (which can be used in the ECF program to determine the structure of the data).

More likely, the structure for passing data from a $list to an ECF program will be a $list where all $list items have the same length. To facilitate use of such a structure, the $list ECF interface automatically places a one word (four byte) binary number of occurrences before the copied $list items in the ECF parameter area. This makes it possible, if the ECF program is written in COBOL, to refer to the $list as a DEPENDING array where the number of occurrences can vary at run-time. To refer to the $list, the COBOL program would look something like this:

LINKAGE SECTION. 01 STUBB. 03 NUM-HARPOONS PIC 9(9) BINARY 03 HARPOON-INFO OCCURS 0 TO 25000 TIMES DEPENDING ON NUM-HARPOONS. ... PROCEDURE DIVISION USING STUBB.

If for some reason, this count is deemed undesirable in the linkage structure, it can be suppressed via the NOCOUNT keyword in the EXTERNAL CALL statement as in:

EXTERNAL CALL COBPROG WITH $LIST %LIST NOCOUNT

Multiple $lists and images can be passed in a single ECF call as in:

EXTERNAL CALL COBPROG WITH $LIST %LIST, INIMAGE, $LIST %LIST2