> -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] On > Behalf Of Andy Robertson > Sent: Friday, June 05, 2009 11:42 AM > To: [email protected] > Subject: Re: Wait under CICS > > > Could they not check that they are running in a CICS environment and > > then call a subroutine to do an EXEC CICS DELAY ? Or am I > > oversimplifying things. > > Jim McAlpine > > The problem is you can't CALL a subprogram with EXEC CICS in it - as I > understand it. You have to EXEC CICS LINK to it. This ends up defeating > the code-sharing target I explained earlier
Horsepucky. BTDTGTTS. No EXEC CICS LINK is required. When the top-level transaction/application is invoked by CICS, all the appropriate CICS parameters are passed by CICS (EIB, DFHCOMMAREA, etc.). All that the top-level application program has to do is to save the addresses of these areas in a global location that your new subroutine knows how to find, and then just use those addresses for the CICS calls inside the subroutine. That's what the COBOL statement "SET ADDRESS OF ... to ptr-variable" is for. It's tricky running the CICS translator with code like this, but it is possible to get the job done. It's easier in assembler, of course, so you might want to go that route instead of COBOL. I can't give you a sample, I did this for a prior employer now gone out of business, so that code is lost, but this can be done, I assure you. ISTR it may be simpler to have a two-level set of subroutines for CICS. The first level program gets the CICS addresses and then calls the second-level routine AS IF it had been invoked by EXEC CICS LINK, passing the needed CICS parameters. Then the actual CICS EXEC WAIT program is "normal" and easy to maintain. The batch version is just one level, of course. Remember, the application code may not care that it is executing in the context of a CICS transaction, but you do know that and can take advantage of that knowledge to get the task done. Peter P.S. -- At an even earlier employer, I had code that saved the top-level CICS control block addresses, made several levels of EXEC CICS LINK calls, then in a static subroutine call used the saved top-level addresses for EXEC CICS things at the lowest level, and then "switched back" to the CICS level from which it was invoked on return to the caller. Now *that* was tricky stuff, but it worked like a charm. 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: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

