Hi,
if the COBOL subroutines are compiled using NORENT, there could be another
possibility; we used this at my former customer's site.
The ASSEMBLER main program could call a dummy COBOL main,
which does nothing (but builds the LE environment) and calls again the
ASSEMBLER main at a secondary entry point. Now the enclave is present,
and from now on the ASSEMBLER main can do its work and call the
COBOL subroutines. The COBOL subroutines, IMO, only need the correct
value in register 12 (the pointer to the Common Anchor Area of LE) and some
values in the save areas must be set up correctly (next available byte
pointer); you will
have to copy these values from the save area that the COBOL main did build.
You will see what you have to do if you look at the prologue code of the
COBOL functions.
Things are different, if the COBOL routines are compiled using RENT;
that is,
if they have writable static areas; then you need something like CEEFETCH -
a normal call using V address constant (or LINK or LOAD macro) will not be
sufficient.
At the end, the ASSEMBLER main line (secondary entry) returns to the
COBOL dummy main; this dummy main terminates the enclave and then
it returns to the ASSEMBLER "real" main line.
This worked for us; every ASSEMBLER main program was built this way
and had a dummy HLL main program linked to it (it was PL/1, in fact),
and this was how the main programs built LE enclaves, so that PL/1 and
C subroutines could be called later (if necessary).
The call to the HLL subroutines was done by a special CALL macro which
did the necessary preparations, so that the subroutines found the LE
enclave.
Kind regards
Bernd
Am 16.03.2017 um 18:57 schrieb Farley, Peter x23353:
Hi All,
We are preparing for the transition from COBOL V4.2 to COBOL V5.2. Existing
non-LE-enabled assembler main programs need to change from using IGZERRE
initialization to using CEEPIPI enclave initialization to allow calling
multiple COBOL subroutines, sometimes calling a subroutine more than once per
batch step execution.
We do know that the assembler main programs really ought to be converted to
LE-enabled to make things better, but that is beyond available programmer
resources and time at the moment. It may be scheduled later, but in the
meantime we need a quicker solution. We already use a set of assembler macros
to hide the initialization and loading and calling of COBOL programs from
non-LE-enabled main programs, so I am modifying the macros to use CEEPIPI rules
instead so that programs can just be re-translated to accomplish the change.
Now to my questions:
The (call_sub) function of CEEPIPI to call a subroutine states that "The next call
to (call_sub) initializes a new enclave", which is obviously CPU expensive.
The (call_sub_addr) function of CEEPIPI to call a subroutine does not have this
statement. Does this mean I can use the following sequence of calls and only
have one enclave created and reused for each called subroutine?
CEEPIPI ( (init_sub), . . . )
LOAD EP=SUBPGM1
Save address for CEEPIPI
LOAD EP=SUBPGM2
Save address for CEEPIPI
CEEPIPI ( (call_sub_addr), (addr-for-SUBPGM1), . . . )
CEEPIPI ( (call_sub_addr), (addr-for-SUBPGM2), . . . )
Etc.
CEEPIPI ( (term), . . . )
Or do I need to use the CEEPIPI initialization function (init_sub_dp) instead
of (init_sub) to accomplish multiple (call_sub_addr)'s with only one enclave
initialization?
TIA for your help in understanding the rules here.
Peter
--
This message and any attachments are intended only for the use of the addressee
and may contain information that is privileged and confidential. If the reader
of the message is not the intended recipient or an authorized representative of
the intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication
in error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN