Phil, In order for MVS program management to find load module CALL2222, I think you need to add an ALIAS statement in the Binder Control cards: INCLUDE TESTPGMS(DCALLEE) ALIAS CALL2222 NAME DCALLEE(R)
=============================================== Wayne Driscoll OMEGAMON DB2 L3 Support/Development wdrisco(AT)us.ibm.com =============================================== From: Phil Smith <p...@voltage.com> To: IBM-MAIN@bama.ua.edu Date: 03/18/2011 03:05 PM Subject: Dynamic calls from COBOL Sent by: IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu> Hoping someone here has more experience with dynamic linking than I do. I'm trying to get something to be dynamically callable from COBOL on z/OS. This is old-style dynamic calling, not DLL stuff. So I've found http://publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=/com.ibm.entcobol.doc_4.1/PGandLR/ref/rpsub08.htm and have followed that (I believe), but get S806 ABENDs when calling the *second* entry point in the target module. So either I've missed something, the example is wrong, I'm using some wrong option on the linkedit, or it's gremlins. The callee, with entry points DCALLEE and CALL2222 (yeah, stupid names, but I've been tinkering): ------------------------------------------- Identification Division. Program-ID. DCALLEE. Environment Division. Configuration Section. Data Division. Working-Storage Section. Procedure Division. Display "DCALLEE got called". goback. Entry "CALL2222". Display "CALL2222 got called". GOBACK. End Program "DCALLEE". ------------------------------------------- JCL to compile/linkedit the callee: ------------------------------------------- //IGYWC PROC //COBOL EXEC PGM=IGYCRCTL,REGION=2048K, // PARM='LIB,DYNAM,NODLL' //STEPLIB DD DISP=SHR,DSNAME=IGY340.SIGYCOMP //SYSPRINT DD SYSOUT=* //SYSLIB DD DISP=SHR,DSN=PHS.PDS.SOURCE(DCALLEE) // DD DISP=SHR,DSN=VSH.BASE230.SAMPLIB //SYSLIN DD DISP=SHR,DSN=PHS.PDS.OBJ(DCALLEE) //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT5 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT6 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) // PEND // EXEC IGYWC //* //COBOL.SYSIN DD DSN=PHS.PDS.SOURCE(DCALLEE),DISP=SHR //* //LKED EXEC PGM=IEWBLINK,COND=(8,LT), // PARM='LIST,AMODE=31,MAP,LET,RENT,DYNAM(NO)' //SYSPRINT DD SYSOUT=* //SYSLIB DD DISP=SHR,DSN=CEE.SCEELKED //TESTPGMS DD DISP=SHR,DSN=PHS.PDS.OBJ //SYSLMOD DD DISP=SHR,DSN=PHS.PDS.LOAD //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(3,1)) //SYSLIN DD * INCLUDE TESTPGMS(DCALLEE) NAME DCALLEE(R) /* ------------------------------------------- The caller: ------------------------------------------- PROCESS DYNAM NODLL Identification Division. Program-ID. "DCALLER". Environment Division. Configuration Section. Data Division. Working-Storage Section. 77 pgm Pic X(8). Procedure Division. move "DCALLEE " to pgm. call pgm. move "CALL2222" to pgm. call pgm. Stop Run . End Program "DCALLER". ------------------------------------------- JCL to compile/linkedit/run the caller: ------------------------------------------- //IGYWC PROC //COBOL EXEC PGM=IGYCRCTL,REGION=2048K, // PARM='LIB,DYNAM,NODLL' //STEPLIB DD DISP=SHR,DSNAME=IGY340.SIGYCOMP //SYSPRINT DD SYSOUT=* //SYSLIB DD DISP=SHR,DSN=PHS.PDS.SOURCE(DCALLER) // DD DISP=SHR,DSN=VSH.BASE230.SAMPLIB //SYSLIN DD DISP=SHR,DSN=PHS.PDS.OBJ(DCALLER) //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT5 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT6 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) // PEND // EXEC IGYWC //* //COBOL.SYSIN DD DSN=PHS.PDS.SOURCE(DCALLER),DISP=SHR //* //LKED EXEC PGM=IEWBLINK,COND=(8,LT), // PARM='LIST,AMODE=31,MAP,LET,RENT,DYNAM(NO)' //SYSPRINT DD SYSOUT=* //SYSLIB DD DISP=SHR,DSN=CEE.SCEELKED //TESTPGMS DD DISP=SHR,DSN=PHS.PDS.OBJ //SYSLMOD DD DISP=SHR,DSN=PHS.PDS.LOAD //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(3,1)) //SYSLIN DD * INCLUDE TESTPGMS(DCALLER) NAME DCALLER(R) /* //RUN EXEC PGM=DCALLER,REGION=0K //* //STEPLIB DD DISP=SHR,DSN=PHS.PDS.LOAD //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //* ------------------------------------------- Any and all ideas greatly appreciated! -- ...phsiii Phil Smith III p...@voltage.com Voltage Security, Inc. www.voltage.com ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html