On Fri, Aug 5, 2016 at 9:18 AM, Hardee, Chuck <[email protected] > wrote:
> Thanks to everyone that responded to my previous question about generating > link statements from the compiler. > The answer was to use the NAME(ALIAS) PROCESS statement. > > I now am looking for some further insight. > > I have a program that has a main program and an alternate entry point > (ENTRY). > The alternate entry point is an LE error handler. > The main program issues a SET xxxx TO ENTRY "modname" in order to load an > assembled parameter file. > If the load is successful, then the program can extract the information it > needs from the load module and go on its merry way. > > The source program successfully compiles and builds a single executable > with the main program name and an alias for the ENTRY statement. > > By inserting displays into the program I can say that the main program > appears to be working fine up to the SET statement. > > It issues a SET xxxx TO ENTRY "error handler entry point name" and then > issues a call to CEEHDLR to register the error handle routine. > It then issues the SET xxxx TO ENTRY "modname" and here's where the > problem comes in. > If the module is found, the SET is successful and the program does its > thing. > If the module is NOT found, it abends with a CEE0374C with > CONDITION=CEE3501S. The reported condition is the condition that the error > handler is supposed to trap and handle. > > If I split the code out into 2 separately compiled programs, all works as > desired. > Unfortunately, 2 programs is not an option for me unless someone can point > me to the IBM statement that declares what I am trying to do is not > possible or not supported. > > Has anyone ever written a single COBOL program which contains an ENTRY > statement for an internal language environment error handler? > No, but I have a couple of programs which are my tests of using CEEHDLR. I could try merging them together. Actually, they are based on some sample code I got from IBM & Andy Robertson. > If so, can you share with me what you did to make it work? > > I have gone thru the LE manuals and found several COBOL examples where > there are program "boxes" with flow of control indicated but none of them > appear to be ENTRY type points of code within a single program. > Furthermore, I can't find anything in the LE manuals that say that using an > ENTRY to gain access to an error handler routine isn't allowed, at least > not in clear enough terminology that I can see. > > There is, however, a warning that an error handler should be issued in a > COBOL nested environment. > Did you leave out the "not" in the above? Looking at: https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ceea300/clchdlr.htm it says the exact OPPOSITE <quote> - COBOL consideration—You should not call CEEHDLR from a nested COBOL program. </quote> > Unfortunately, it doesn't describe a COBOL nested environment. > COBOL Language Reference Chapter 10 http://publibfp.boulder.ibm.com/epubs/pdf/igy6lr10.pdf <quote> Nested programs A nested program is a program that is contained in another program. Contained programs can reference some of the resources of the programs that contain them. If program B is contained in program A, it is directly contained if there is no program contained in program A that also contains program B. Program B is indirectly contained in program A if there exists a program contained in program A that also contains program B. For more information about nested programs, see Nested programs in the Enterprise COBOL Programming Guide. </quote> E.g. (very shortened) IDENTIFICATION DIVISION. PROGRAM-ID. EXTPROG. ... IDENTIFICATION DIVISION. PROGRAM-ID. INTPROG. ... END PROGRAM INTPROG END PROGRAM EXTPROG. INTPROG is nested within EXTPROG and is not visible outside of it. More at http://publibfp.boulder.ibm.com/epubs/pdf/igy6pg10.pdf on page 479. > > Thanks in advance, > Chuck > > Charles (Chuck) Hardee<mailto:[email protected]> > Senior Systems Engineer/Database Administration > EAS Information Technology > > Thermo Fisher Scientific > 300 Industry Drive | Pittsburgh, PA 15275 > Phone +1 (724) 517-2633 | Mobile +1 (412) 877-2809 | FAX: +1 (412) 490-9230 > [email protected]<mailto:[email protected]> | > www.thermofisher.com > > WORLDWIDE CONFIDENTIALITY NOTE: Dissemination, distribution or copying of > this e-mail or the information herein by anyone other than the intended > recipient, or an employee or agent of a system responsible for delivering > the message to the intended recipient, is prohibited. If you are not the > intended recipient, please inform the sender and delete all copies. > > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > -- Klein bottle for rent -- inquire within. Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
