Assuming the subroutine(s) issue no CALLs or SVCs, the following simple
update to the CICS Assembler main programs will do the trick:

CICPGM  CSECT ,
                DFHEIENT CODEREG=RX,EIBREG=RY,DATAREG=R13
                .
                DO SOME STUFF
                .
                CALL SUBA
                .
                CALL SUBB
                .
                CALL SUBC
                .
                DO MORE STUFF
                .
                EXEC  CICS RETURN.
                LTORG ,
                DFHEISTG
STGSAVE DS      18F     SAVE AREA FOR CALLED SUBROUTINES
                .
                USER DATA AREA
                .
                DFHEIEND
                END ,

All we're doing is adding a SAVE AREA to the beginning to the user data area
and assuring the user data area is addressed by R13.  No changes to the
subroutine(s) would be necessary and they will function in both batch and
CICS mode as before.  This may be a lot of doggie work simply because of the
number of CICS modules to go through.  Nobody likes to do that, but it is a
rather safe and simple modification.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of John McKown
Sent: Thursday, June 27, 2013 12:31 PM
To: [email protected]
Subject: Re: z/OS subroutine in assembler, used in both batch & CICS ,
making re-entrant

Not possible. This was designed 20+ years ago and is in use by about 650
different programs, combined CICS and batch, currently in production.
Trying to get either all of the batch xor all of the CICS programs changed
to use a different name is politically impossible. The original person
should have made separate entry points. But we have some really _bad_
design decisions in a lot of programs, IMO. And we continue in that
tradition until this day.

On Thu, Jun 27, 2013 at 12:16 PM, John Gilmore <[email protected]> wrote:

> Something akin to Mike Ward's scheme will work well.
>
> My own preference would, however, be for two different entry points.
> It is ugly to take a foregone code-path decision at execution time
> when it can be taken at bind time.
>
> John Gilmore, Ashland, MA 01721 - USA
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>



-- 
This is a test of the Emergency Broadcast System. If this had been an
actual emergency, do you really think we'd stick around to tell you?

Maranatha! <><
John McKown

----------------------------------------------------------------------
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

Reply via email to