External Call support for Stringlists and $lists: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(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...")
 
Line 1: Line 1:
==$lists and ECF==
==External Call enhancements==
A $list identifier can be passed to an ECF program, as in:
A [[Stringlist class|Stringlist object]] or $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">inlist outlist</span>
<p class="syntax"><span class="literal">external call cobprog with </span><span class="term">inStringlist outStringlist</span>
</p>
where:
<table class="syntaxTable">
<tr><th>inStringlist
</th><td>The Stringlist object whose contents are to be passed to the ECF program as input.
</td></tr>
<tr><th>outStringlist
</th><td>The Stringlist object to receive the data as modified by the ECF program. The contents of this Stringlist are replaced with the ECF program output. The length of the Stringlist items are made to match that of the input Stringlist, and if the output Stringlist is the same identifier as the input Stringlist, the output data simply replaces the original input data. For <code>PARMTYPE=INPUT</code> ECF programs, the output Stringlist is ignored.
</td></tr></table>
or
<p class="syntax"><span class="literal">external call cobprog with $list </span><span class="term">inlist outlist</span>
</p>
</p>
where:
where:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>inlist
<tr><th>inlist
</th><td>The $list identifier to be passed to the ECF program as input.
</th><td>The $list identifier whose contents are to be passed to the ECF program as input.
</td></tr>
</td></tr>
<tr><th>outlist
<tr><th>outlist
</th><td>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 <code>PARMTYPE=INPUT</code> ECF programs, the output $list is ignored.
</th><td>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 <code>PARMTYPE=INPUT</code> ECF programs, the output $list is ignored.
</td></tr></table>
</td></tr></table>
The input $list is copied into the ECF parameter area before the ECF program is called.
In the following discussion, all references to Stringlist also apply to $lists. Stringlist is used here because their use is recommended over the use of $lists.
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
The input Stringlist contents are copied into the ECF parameter area before the ECF program is called. The Stringlist items are concatenated and there is no way to determine where one ends and the next begins, so presumably the Stringlist items would all have the same length, or some Stringlist items have the length or number of occurrences of a following set of Stringlist items (which can be used in the ECF program to determine the structure of the data).
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
More likely, the structure for passing data from a Stringlist to an ECF program will be a Stringlist where all Stringlist items have the same length. To facilitate use of such a structure, the Stringlist/$list ECF interface automatically places a one word (four byte) binary number of occurrences before the copied Stringlist items in the ECF parameter area. This makes it possible, if the ECF program is written in COBOL, to refer to the Stringlist as a <code>DEPENDING</code> array where the number of occurrences can vary at run-time.
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 <code>DEPENDING</code> array where the number of occurrences
can vary at run-time.
To refer to the $list, the COBOL program would look something like this:
To refer to the $list, the COBOL program would look something like this:
<p class="code">LINKAGE SECTION.
<p class="code">LINKAGE SECTION.
Line 36: Line 39:
PROCEDURE DIVISION USING STUBB.
PROCEDURE DIVISION USING STUBB.
</p>
</p>
If for some reason, this count is deemed undesirable in the linkage
If for some reason, this count is deemed undesirable in the linkage structure, it can be suppressed via the <code>NOCOUNT</code> keyword in the <code>External Call</code> statement as in:
structure, it can be suppressed via the <code>NOCOUNT</code> keyword in the <code>EXTERNAL
<p class="code">external call cobprog with %stringlist nocount
CALL</code> statement as in:
<p class="code">EXTERNAL CALL COBPROG WITH $LIST %LIST NOCOUNT
</p>
</p>
Multiple $lists and images can be passed in a single ECF call as
or
in:
<p class="code">external call cobprog with $list %list nocount
<p class="code">EXTERNAL CALL COBPROG WITH $LIST %LIST, INIMAGE, $LIST %LIST2
</p>
Multiple stringlists, $lists, and images can be passed in a single ECF call as in:
<p class="code">external call conbprog with %stringlist1, $list %list, inimage, $list %list2, %stringlist2
</p>
</p>
[[Category:Overviews]]
[[Category:Overviews]]
[[Category:User Language syntax enhancements]]
[[Category:User Language syntax enhancements]]

Revision as of 04:35, 7 February 2013

External Call enhancements

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

external call cobprog with inStringlist outStringlist

where:

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

or

external call cobprog with $list inlist outlist

where:

inlist The $list identifier whose contents are 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.

In the following discussion, all references to Stringlist also apply to $lists. Stringlist is used here because their use is recommended over the use of $lists.


The input Stringlist contents are copied into the ECF parameter area before the ECF program is called. The Stringlist items are concatenated and there is no way to determine where one ends and the next begins, so presumably the Stringlist items would all have the same length, or some Stringlist items have the length or number of occurrences of a following set of Stringlist 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 Stringlist to an ECF program will be a Stringlist where all Stringlist items have the same length. To facilitate use of such a structure, the Stringlist/$list ECF interface automatically places a one word (four byte) binary number of occurrences before the copied Stringlist items in the ECF parameter area. This makes it possible, if the ECF program is written in COBOL, to refer to the Stringlist 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 %stringlist nocount

or

external call cobprog with $list %list nocount

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

external call conbprog with %stringlist1, $list %list, inimage, $list %list2, %stringlist2