ILE COBOL Programmer's Guide

Example of Creating a Service Program

This example shows you how to use the binder language to create a service program to perform financial calculations.

Assume that the following ILE COBOL source programs comprise the module objects that make up the service program.

  1. The binder language for the service program that makes the RATE, AMOUNT, PAYMENT, and TERM ILE COBOL programs available looks like the following:

    FILE: MYLIB/QSRVSRC  MEMBER: FINANCIAL
    STRPGMEXP  PGMLVL(*CURRENT)
      EXPORT SYMBOL('TERM')
      EXPORT SYMBOL('RATE')
      EXPORT SYMBOL('AMOUNT')
      EXPORT SYMBOL('PAYMENT')
    ENDPGMEXP
    

    You can use SEU to enter the binder language source statement. The syntax checker in SEU will prompt and validate the binder language input when you specify a source type of BND. To start an edit session to enter the binder language source, type:

    STRSEU SRCFILE(MYLIB/QSRVSRC) SRCMBR(FINANCIAL)
    TYPE(BND) OPTION(2)
    

    and press Enter.

  2. Compile the four ILE COBOL source programs into module objects using the CRTCBLMOD command. Assume that the module objects also have the names RATE, AMOUNT, PAYMENT, and TERM.

    To create the service program you can run the required binder statements with this command:

    CRTSRVPGM  SRVPGM(MYLIB/FINANCIAL)
               MODULE(MYLIB/TERM MYLIB/RATE MYLIB/AMOUNT MYLIB/PAYMENT)
               EXPORT(*SRCFILE)
               SRCFILE(MYLIB/QSRVSRC)
               SRCMBR(*SRVPGM)
    

    Notes:

    1. Source file QSRVSRC in library MYLIB is the file that contains the binder language source.

    2. A binding directory is not required here because all module objects needed to create the service program have been specified with the MODULE parameter.

    Further examples of using the binder language and creating service programs can be found in the ILE Concepts book.


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