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.
Computes the interest rate, given a loan amount, term, and payment amount.
Computes the loan amount, given an interest rate, term, and payment amount.
Computes the payment amount, given an interest rate, term, and loan amount.
Computes the term of payment, given an interest rate, loan amount, and payment amount.
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.
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:
Further examples of using the binder language and creating service programs can be found in the ILE Concepts book.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.