Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Linking programs which dynamically load the C or COBOL runtime systems (partial bind linkage technique)

&pagelevel(4)&pagelevel

Static linkage with BINDER

  1. C or COBOL program (object module or link-and-load module)

    /START-BINDER
    //START-LLM-CREATION INT-NAME=internal-name ------------------------ (1)
    //INCLUDE-MODULES LIB=..., ELEM=... -------------------------------- (2)
    //RESOLVE-BY-AUTOLINK LIB=userlibrary ------------------------------ (3)
    //RESOLVE-BY-AUTOLINK LIB=$.SYSLNK.CRTE.PARTIAL-BIND --------------- (4)
    //SAVE-LLM LIB=..., ELEM=... --------------------------------------- (5)
    //END
    

    (1)

    A link-and-load module with the name internal-name is generated.

    (2)

    The program modules are explicitly included.

    (3)

    The user library is statically linked using the Autolink function.

    (4)

    The library $.SYSLNK.CRTE.PARTIAL-BIND (standard partial bind) which, among other things, contains the complete C and COBOL runtime system (see "CRTE V11.1A selectable unit"), is statically linked with the Autolink function.

    Alternatively, you can use the complete partial bind linkage method. To do this, use the library $.SYSLNK.CRTE.COMPL instead of $.SYSLNK.CRTE.PARTIAL-BIND.

    (5)

    The current link-and-load module is saved.

  2. C++ program (link-and-load module) for compiler versions <= V2.2

    /START-BINDER 
    //START-LLM-CREATION INT-NAME=internal-name --------------------------- (1)
    //INCLUDE-MODULES LIB=..., ELEM=... ----------------------------------- (2)
    //RESOLVE-BY-AUTOLINK LIB=user library -------------------------------- (3)
    //RESOLVE-BY-AUTOLINK LIB=($.SYSLNK.CRTE.PARTIAL-BIND,$.SYSLNK.CRTE.CPP)(4)
    //SAVE-LLM LIB=..., ELEM=... ------------------------------------------ (5)
    //END
    

    (1)

    A link-and-load module with the name internal-name is generated.

    (2)

    The program modules are explicitly included.

    (3)

    The user library is statically linked using the Autolink function.

    (4)

    The following are also statically linked with the Autolink function:

    (5)

    The current link-and-load module is saved.

  3. C++ program (link-and-load module) for compiler versions as of V3.0

    /START-CPLUS-COMPILER ----------------------------------------------- (1)
    //MODIFY-BIND-PROPERTIES INCLUDE=*LIB(LIB=...,ELEM=...) 
    //MODIFY-BIND-PROPERTIES RESOLVE=*AUTOLINK(userlibrary)
    //MODIFY-BIND-PROPERTIES RUNTIME-LANG=CPLUSPLUS(CPP), STDLIB=DYNAMIC
    //BIND OUTPUT=*LIB(LIB=...,ELEM=...)
    

    (1)

    The linkage editor is implicitly called by the C++ compiler.The following statements for the C++ compiler have the same functionality as the BINDER statements in Example 2.

Loading and starting link and load modules

/START-PROGRAM *MODULE(LIB=...,ELEM=...,RUN-MODE=ADVANCED)