ILE C/C++ Programmer's Guide

Handling Unresolved Import Requests Using the *UNRSLVREF Parameter

The following example shows:

The example

Example:

  1. To create service program SP1 from m2.cpp, enter:
    CRTSRVPGM SRVPGM(MYLIB/SP1) MODULE(MYLIB/M2)
    	SRCFILE(MYLIB/QSRVSRC) SRCMBR(BNDLANG1)
    	OPTION(*UNRSLVREF)
    

    Because the *UNRSLVREF option is specified, service program SP1 is created even though the import request for func2() is not resolved.

  2. To create service program SP2 from module M3 and service program SP1, enter:
    CRTSRVPGM SRVPGM(MYLIB/SP2) MODULE(MYLIB/M3)
    	SRCFILE(MYLIB/QSRVSRC) SRCMBR(BNDLANG2)
    	BNDSRVPGM(MYLIB/SP1)
    

    Because service program SP1 now exists, the binder resolves all the import requests required, and service program SP2 is created successfully.

  3. To re-create the service program SP1, enter:
    CRTSRVPGM SRVPGM(MYLIB/SP1) MODULE(MYLIB/M2)
    	SRCFILE(MYLIB/QSRVSRC) SRCMBR(BNDLANG1)
    	BNDSRVPGM(MYLIB/SP2)
    

    Although service program SP1 does exist, the import request for func2() is not resolved. Therefore, the re-creation of service program SP1 is required. Because service program SP2 now exists, the binder resolves all import requests required and, service program SP1 is created successfully.

  4. To create program A, enter:
    CRTPGM PGM(MYLIB/A) MODULE(MYLIB/M1) BNDSRVPGM(MYLIB/SP1 MYLIB/SP2)
    

    Because service programs SP1 and SP2 do exist, the binder creates the program A.


[ Top of Page | Previous Page | Next Page | Table of Contents ]