Instead of messing with the binder control cards you can specify the COBOL 
compile option NAME(ALIAS) (which, in fact, adds the relevant binder control 
cards).
"If you specify NAME(ALIAS), and your program contains ENTRY statements, a 
link-edit ALIAS card is generated for each ENTRY statement."
-- 

Frank Swarbrick
Applications Architect - Mainframe Applications Development
FirstBank Data Corporation - Lakewood, CO  USA
P: 303-235-1403


On 3/18/2011 at 2:17 PM, in message
<of27de444e.0baf690d-on86257857.006f2f1d-86257857.006f6...@us.ibm.com>, Wayne
Driscoll <wdri...@us.ibm.com> wrote:
> 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.i 
> bm.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!

>>> 

The information contained in this electronic communication and any document 
attached hereto or transmitted herewith is confidential and intended for the 
exclusive use of the individual or entity named above.  If the reader of this 
message is not the intended recipient or the employee or agent responsible for 
delivering it to the intended recipient, you are hereby notified that any 
examination, use, dissemination, distribution or copying of this communication 
or any part thereof is strictly prohibited.  If you have received this 
communication in error, please immediately notify the sender by reply e-mail 
and destroy this communication.  Thank you.

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

Reply via email to