Professional Documents
Culture Documents
Design Document For Procedures
Design Document For Procedures
Design Document For Procedures
PCR# - 984597
CSSD
FEE State Exclusion PCR# 984597
Nancy Sukeforth Division/Department Remittance Processing Owner Cost Center Billed Cost Center(s) Dan Zechman CSSD Lakshmi Narayana 06/21/02
152004362.doc
Page 1 of 11
06/15/13
Table of Contents
1 INTRODUCTION ....................................................................................................................................................3 2 PROCEDURE @CHKSTATEEXCLN ..................................................................................................................4 2.1 PROTOTYPE FOR PROCEDURE @CHKSTATEEXCLN .........................................................................................4 2.2 MODULE FOR NEW PROCEDURE (FEESTEXM)............................................................................................... 5 2.3 BINDING SOURCE FOR COMPILATION (PPCBND02S)......................................................................................8 2.4 COMPILATION ............................................................................................................................................... 8 3 PROCEDURE @GETFEEAMT .............................................................................................................................9 3.1 PROTOTYPE FOR THE PROCEDURE @GETFEEAMT ........................................................................................10 3.2 MODULE FOR NEW PROCEDURE @GETFEEAMT ........................................................................................... 10 3.3 BINDING SOURCE FOR COMPILATION ........................................................................................................... 11 3.4 COMPILATION ............................................................................................................................................. 11
152004362.doc
Page 2 of 11
06/15/13
Introduction
The Current Fees due system calculates and assigns fees regardless of the state for which the loan belongs to. Now there is change in law specifying that borrowers in some states should not be billed for certain fees. This project aims at modifying the programs to exclude certain types of fees for loans belonging to certain states. A procedure shall be used in programs to determine whether state exclusion exists on any type of fee for a loan. This document specifies the ILE procedures that shall be used in the FEE State Exclusion project to determine whether state exclusion exists for a loan on a fee code and a procedure, which shall be used to calculate total fees due.
152004362.doc
Page 3 of 11
06/15/13
Procedure @ChkStateExcln
This procedure shall be created which receives account number and fee code as mandatory parameters and state code, county, loan type and subclass as optional parameters and returns indicator value *ON or *OFF to exclude or include fee for the fee code. If the program uses master files like CHMST/HHMSTR (or corresponding logical) or AQLOAN for programs on CLASS system, calling programs can pass state code, county, loan type, and subclass parameters to this procedure, so that this procedure need not do another IO operation on master file to get the details. If the calling program does not have master file declared in it, it requires to pass only loan number and fee code. A file shall be created which contains the fee code, state code, county, loan type and subclass. This procedure receives the account number and gets the required key field values like state, county, loan type and checks whether there is record in the state exclusion file and accordingly it returns indicator status. Acquisition programs on CLASS system shall be provided with the same procedure to determine the state exclusion using different set of files. Structure of the new file Fee State exclusion file shall be as shown below. All the fields mentioned in the table shall be used as composite key
Field Name
FETRCD LNTYPE SUBCLS STATCD CNTYCD
Remark
New field '' '' '' ''
2.1
152004362.doc
Page 4 of 11
06/15/13
In the above prototype, it is specified that the return parameter from the procedure is of Indicator data type and it requires two mandatory parameters Acct#, FeeCode. Other parameters with OPTION(*NOPASS) are optional and may not be required to be passed to procedure.
2.2
TOLIB(QTEMP)
Keylist1 shall be declared to access the FESTEXCP file and shall contain all the 5 key fields fee code, state code, county, loan type and subclass. Check whether optional parameters are received in the module. If optional parameters are not received then open the file CHMSTR and using the account number received set file pointer to lower limit (Setll) on CHMSTRAA, to check whether the loan exists in the file. If %equal returns *ON i.e. record exists in the file, then read the file to get the values state code, county, loan type and sub class. If record does not exist in the CHMSTRAA, then open file HHMSRTRPL and using CHAIN opcode fetch the record from HHMSTRPL. If program is for CLASS system fetch the record from file AQLOANPL. Close the opened file(s). Populate the values state code, county, loan type and sub class from the file (or received as parameters) and fee code received as parameter to key fields of KeyList1. Open the file FESTEXCP. Setll on the FEE state exclusion file FESTEXCP, If records exists in the file (i.e. %equal is on), then move *ON to the return parameter specifying that state exclusion exists for the fee code and account number.
152004362.doc
Page 5 of 11
06/15/13
If record does not exist in FESTEXCP file for values of all five key fields, blank out the last key field and try again, if record does not exist continue checking the record by blanking out fields one by one until county is blank. If record exists for any of the combination move *ON to return parameter otherwise move *OFF to return parameter. Close the opened file FESTEXCP. Combination of the key field values to check the existence of the record in FESTEXCP file shall be as follows:
Fee Code Value Value Value Value State Value Value Value Value County Value Value Value *Zeros Loan Type Value Value *Blanks *Blanks Sub Class Value *Blanks *Blanks *Blanks
Standard errors while executing the procedure shall be monitored and handled. If any kind of error occurs move *OFF to return parameter.
152004362.doc
Page 6 of 11
06/15/13
Start
Receive ACCT#, TRNCD as mandatory parameter and STATCD, CNTYCD, LNTYPE , SUBCLS as optional parameter Return Parameter *ON ----> State exclusion exists *OFF ----> State exclusion does not exists
Yes
A
No Using ACCT# chain to CHMSTRAA/ HHMSTRPL(for HELOC loans) for programs on AS400LS m/c or chain AQLOANPL for loans on CLASS m/c and fetch values of State code, County, Loan type, Subclass Blank out key field value one by one from last and check whether record exists in FESTEXCP until CNTYCD is blank
Set the key (FETRCD, STATCD, CNTYCD,LNTYPE,SUBCLS) with the values obtained above
If record exists in FESTEXCP for any of the combinations above No Return *OFF
Yes
Return *ON
End
Check record in file FESTEXCP file with all 5 key values End
No
152004362.doc
Page 7 of 11
06/15/13
This binding source (export source) shall contain the export statements of all exported procedures, in this case the exported procedure is @ChkStateExcln. This binding source shall be used as export source while creating the service program. Service program can be created with our own signature using the export source. If binding source is used to create a service program, the program that uses the procedure in the service program does not require recompilation even if the procedure is changed. PPCBND02S is the existing binding source, add the following export statement to it and use the same binding source for compilation. EXPORT SYMBOL('@ChkStateExcln')
2.4
Compilation
Procedure @ChkStateExcln shall be available in module FESTEXCM, which shall be included in the existing service program PPCSRV02. The following steps shall be followed for creating the service program in which the procedure will be available. Creating module: CRTRPGMOD MODULE(Library/FESTEXCM) SRCFILE(Library/Source File) SRCMBR(FESTEXCM)
Creating service program: CRTSRVPGM SRVPGM(Library/PPCSRV02) MODULE(PPCMOD01 PPCMOD02 PPCMOD03 LMSRVMOD INSPMTMOD LATECHAR LATECHR1 PAY000R FESTEXCM) EXPORT(*SRCFILE) SRCFILE(Library/QSRVSRC) SRCMBR(FESTEXCP) ACTGRP(*CALLER)
Binding directory: PPCBNDR03 is an existing binding directory used for PPC programs, and service program PPCSRV02 is an entry in the binding directory. New procedures shall be available in this binding directory as the module FESTEXCM shall be added to the service program PPCSRV02. If any program has to refer the new procedure, binding directory PPCBNDR03 should be included while compilation.
152004362.doc
Page 8 of 11
06/15/13
Procedure @GetFeeAmt
This procedure shall be created which receives account number, fee code and other filter criterion fields like Owed By Borrower, Billable, Waivable, Claimable also new Field State exclusion as parameters and returns the total fee balance for each fee code in the form of an array. Each row of a Return parameter (array) will have details of each fee code like fee code, credits (Transaction Type 100), and debits (Transaction Type 600) and remaining balance. E.g. If for an account fee transaction file has the following image.
Account Number 1605 1605 1605 1605 1605 1605 1605 Fee Code 10052 10052 10052 10052 10026 10026 10026 Transaction Type 600 600 600 100 600 600 100 Fee Amount 10.00 10.00 10.00 10.00 30.00 40.00 20.00
The new procedure will return the value in the following layout (array) to the calling program.
Fee Code 10052 10026 00000 Credit Amount 10.00 20.00 30.00 Debit Amount 30.00 70.00 100.00 Remaining Amount 20.00 50.00 70.00
The last row of the array will contain the total debits, credits and remaining balance of all the fee codes. The procedure can be used for the following purposes 1. 2. 3. 4. To get total fee details for a fee code by passing fee code. To get total fee details for all fee codes available by passing zeros to fee code Calling program can specify the filter criteria for calculating the total fee The total fee details for a loan(returned as the last element of the array)
152004362.doc
Page 9 of 11
06/15/13
The header copybook for this procedure shall contain the prototype declarations of the procedure and shall be included in the same copybook (FEESTEXH) mentioned in section 2.1. This copybook shall be included in any program that requires this procedure including the module in which this procedure will be coded. d @GetFeeAmt d d d d d d d Acct# FeeCode OBYBFLG BILLFLG WAIVFLG CLIMBFLG STEXFLG PR 40 5 1 1 1 1 1 Dim(100) LIKE(@acct#) CONST 0 CONST OPTIONS(*NOPASS) CONST OPTIONS(*NOPASS) CONST OPTIONS(*NOPASS) CONST OPTIONS(*NOPASS) CONST OPTIONS(*NOPASS) CONST OPTIONS(*NOPASS)
3.2
152004362.doc
Page 10 of 11
06/15/13
If fee code is received as a parameter then read records for the account number for that fee code only. Otherwise, read records for the account number and for all fee codes. Based on the filter criteria result, include or exclude the record for fee calculation. If the transaction type is 600, add the transaction fee amount to debits. If transaction type is 100 add the amount to credits. Add fee amount to credits/debits of all records for a fee code. Calculate remaining balance using formula remaining balance = total debits total credits. Move the data structure (credits, debits and remaining balance) to return parameter array element. If procedure called for total fee for all fee codes then calculate total debits, credits and remaining balance for all fee codes and move to array elements. Calculate the cumulative total of credits, debits, and remaining balance moved to array element and store them in the next element of the array.
3.3
EXPORT
SYMBOL('@GetFeeAmt')
3.4
Compilation
Procedure @GetFeeAmt shall be included in the same module FEESTEXM. Hence this procedure shall be included in the same service program PPCSRV02.
152004362.doc
Page 11 of 11
06/15/13