Sunteți pe pagina 1din 11

FEE State Exclusion

PCR# - 984597

Design Document for Procedures

CSSD
FEE State Exclusion PCR# 984597

Project Owner Project Manager Prepared By Date Revised By

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

FEE State Exclusion


PCR# - 984597

Design Document for Procedures

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

FEE State Exclusion


PCR# - 984597

Design Document for Procedures

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

FEE State Exclusion


PCR# - 984597

Design Document for Procedures

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

Length Decimals Type Description


5 1 1 2 3 0 0 0 S A A S P Transaction Code Loan Type Primary Loan Type Secondary State Code County Code

Remark
New field '' '' '' ''

Table1: Structure of new file FESTEXCP FEE State exclusion

2.1

Prototype for procedure @ChkStateExcln


A header copybook FEESTEXH shall contain the prototype information of the procedure @ChkStateExcln. This copybook shall be included in any program that requires this procedure including the module in this procedure will be coded. This prototype defines the call interface and includes the following information. Whether the call is bound (procedure) or dynamic (program) The number and nature of the parameters Which parameters must be passed, and which are optionally passed The data type of the return value, if any (for a procedure) d d d d d d d @ChkStateExcln Acct# FeeCode StatCd CntyCd Lntype SubCls PR 2 3 1 1 N LIKE(@acct#) CONST LIKE(@FeeCode) CONST 0 CONST OPTIONS(*NOPASS) 0 CONST OPTIONS(*NOPASS) CONST OPTIONS(*NOPASS) CONST OPTIONS(*NOPASS)

Fig 1: Header Copybook defines the Call Interface

152004362.doc

Page 4 of 11

06/15/13

FEE State Exclusion


PCR# - 984597

Design Document for Procedures

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

Module for new procedure (FEESTEXM)


This module shall contain the original code for the @ChkStateExcln procedure. The copybook mentioned above shall be used in this module to declare the prototype. Files CHMSTRAA, HHMSTRPL (AQLOANPL for programs on CLASS system) shall be declared in input mode in the file specifications. The files shall be opened in user open mode using usropn keyword, which shall be used to fetch the details state code, county, loan type and subclass if not passed as parameters. File FESTEXCP shall be declared in input mode and shall be opened in user open mode, which shall be used to check whether a record exists in this table for the values received (fee code, state code, county, loan type and subclass). Acquisition system uses different programs and files on separate m/c called CLASS, this procedure that determines state exclusion shall be compatible on both LS and CLASS system. Acquisition programs uses different master files, and transaction files for processing. File AQLOAN is master file used on CLASS m/c. State exclusion table shall be used as DDM file on CLASS m/c. This procedure code shall be conditioned to use different files based on the system for which they are created using compile directive define. Define is compiler directive which can be used in ILE programs to condition the statements based on the system name. If the system name changes the portion of code used for compilation shall be changed. Files CHMSTRAA/HHMSRTPL , FESTEXCP shall be used in the procedure if it compiled on system AS400LS otherwise AQLOANPL, DDM copy of FESTEXCP shall be used for CLASS m/c. The entire functionality remains same in procedure or LS and CLASS systems except the use of different files for different systems. If the system name is not AS400LS use file AQLOANPL (instead of CHMSTRAA) and use DDM file for FESTEXCP on CLASS system. Open the DDM copy for file FESTEXCP use the following commands by calling QCMDEXC or by calling separate CL program.
RTVOBJD OBJ(SYSMGRLS) OBJTYPE(*FILE) RTNLIB(&LIBDDM) CRTDUPOBJ OBJ(SYSMGRLS) FROMLIB(&LIBDDM)OBJTYPE(*FILE) NEWOBJ(FEETRCD) CHGDDMF FILE(QTEMP/FEETRCD) RMTFILE(MTGLIBP1/FEETRCD) LVLCHK(*NO)

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

FEE State Exclusion


PCR# - 984597

Design Document for Procedures

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

Try1 Try2 Try3 Try4

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

FEE State Exclusion


PCR# - 984597

Design Document for Procedures

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

If optional parameters values received

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

If record exists in FESTEXCP

Yes Return *ON End

No

Diagram1: Flow chart of procedure

152004362.doc

Page 7 of 11

06/15/13

FEE State Exclusion


PCR# - 984597 2.3 Binding Source for compilation (PPCBND02S)

Design Document for Procedures

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

FEE State Exclusion


PCR# - 984597

Design Document for Procedures

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

FEE State Exclusion


PCR# - 984597 3.1 Prototype for the procedure @GetFeeAmt

Design Document for Procedures

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

Module for new procedure @GetFeeAmt


This module shall contain the code of the procedure, this procedure code shall be included in the same module (FEESTEXM) mention in section 2.2. Fee transaction file FEETRNAB shall be declared in file specification in input mode and user open mode. Transaction records from this file shall be read using account and fee code (if provided) as keys. Open and close of file shall be done in program. A data structure shall be declared with sub fields credits, debits and remaining balance, which will be moved to an element of return parameter array. Each element of this array shall contain the values for total debits, total credits and remaining balance for each fee code. Check the key whether the parameter FeeCode is received in the procedure. If Fee Code is received, then set the key as account number and fee code to access the file, otherwise set the key with only account number. Check the filter criteria received as the parameters (OwedByBorrower, Billable, Waivable, Claimable, and State exclusion). For all the fields used in the filter criteria, there is corresponding field in the fee transaction file. Set a flag to Y if the filter criteria satisfies and use the flag value further in the procedure while calculating the total fees. Please see the sample code below. Use the same code for all the fields in the filter criteria. If the filter criteria results in Y then include that record in total fees calculation

152004362.doc

Page 10 of 11

06/15/13

FEE State Exclusion


PCR# - 984597
C C C C C C * C C C C C Eval If If Eval EndIf EndIf If If Eval EndIf EndIf

Design Document for Procedures

Filter = 'Y' ObyBFlg and Filter FEOBYB = No fileter = No

BillFlg and Filter FEBILL = No fileter = No

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

Binding Source for compilation


Include the export statement for the procedure @GetFeeAmt in the same export source PPCBND02S mentioned in section 2.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

S-ar putea să vă placă și