design document for procedures
Post on 03-Apr-2018
214 Views
Preview:
TRANSCRIPT
-
7/28/2019 Design Document for Procedures
1/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
FEE State ExclusionPCR# 984597
ProjectOwner
Nancy SukeforthDivision/Department Remittance ProcessingOwner Cost CenterBilled Cost Center(s)
ProjectManager
Dan ZechmanCSSD
Prepared By Lakshmi Narayana
Date 06/21/02Revised By
152004362.doc Page 1 of 11 06/15/13
CSSD
-
7/28/2019 Design Document for Procedures
2/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
Table of Contents
1 INTRODUCTION ....................................................................................................................................................3
2 PROCEDURE @CHKSTATEEXCLN ..................................................................................................................4
2.1 PROTOTYPEFORPROCEDURE @CHKSTATEEXCLN .........................................................................................42.2 MODULEFORNEWPROCEDURE (FEESTEXM)...............................................................................................52.3 BINDING SOURCEFORCOMPILATION (PPCBND02S)......................................................................................82.4 COMPILATION ...............................................................................................................................................8
3 PROCEDURE @GETFEEAMT .............................................................................................................................9
3.1 PROTOTYPEFORTHEPROCEDURE @GETFEEAMT ........................................................................................103.2 MODULEFORNEWPROCEDURE @GETFEEAMT ...........................................................................................103.3 BINDING SOURCEFORCOMPILATION ...........................................................................................................113.4 COMPILATION ............................................................................................................................................. 11
152004362.doc Page 2 of 11 06/15/13
-
7/28/2019 Design Document for Procedures
3/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
1 Introduction
The Current Fees due system calculates and assigns fees regardless of the state for which the loanbelongs to. Now there is change in law specifying that borrowers in some states should not be billedfor 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 stateexclusion 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 todetermine whether state exclusion exists for a loan on a fee code and a procedure, which shall beused to calculate total fees due.
152004362.doc Page 3 of 11 06/15/13
-
7/28/2019 Design Document for Procedures
4/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
2 Procedure @ChkStateExcln
This procedure shall be created which receives account number and fee code as mandatoryparameters and state code, county, loan type and subclass as optional parameters and returnsindicator 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 callingprogram 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. Thisprocedure receives the account number and gets the required key field values like state, county, loantype and checks whether there is record in the state exclusion file and accordingly it returns indicatorstatus.
Acquisition programs on CLASS system shall be provided with the same procedure to determine thestate exclusion using different set of files.
Structure of the new file Fee State exclusion file shall be as shown below. All the fields mentionedin the table shall be used as composite key
Field Name Length Decimals Type Description Remark
FETRCD 5 0 S Transaction Code New field
LNTYPE 1 A Loan Type Primary ' '
SUBCLS 1 A Loan Type Secondary ' '
STATCD 2 0 S State Code ' '
CNTYCD 3 0 P County Code ' '
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 procedureincluding the module in this procedure will be coded. This prototype defines the call interface andincludes 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)
Fig 1: Header Copybook defines the Call Interface
152004362.doc Page 4 of 11 06/15/13
d @ChkStateExcln PR N
d Acct# LIKE(@acct#) CONST
d FeeCode LIKE(@FeeCode) CONST
d StatCd 2 0 CONST OPTIONS(*NOPASS)
d CntyCd 3 0 CONST OPTIONS(*NOPASS)
d Lntype 1 CONST OPTIONS(*NOPASS)
d SubCls 1 CONST OPTIONS(*NOPASS)
-
7/28/2019 Design Document for Procedures
5/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
In the above prototype, it is specified that the return parameter from the procedure is of Indicatordata type and it requires two mandatory parameters Acct#, FeeCode. Other parameters withOPTION(*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 copybookmentioned above shall be used in this module to declare the prototype.
Files CHMSTRAA, HHMSTRPL (AQLOANPL for programs on CLASS system) shall be declared ininput mode in the file specifications. The files shall be opened in user open mode using usropnkeyword, which shall be used to fetch the details state code, county, loan type and subclass if notpassed as parameters.
File FESTEXCP shall be declared in input mode and shall be opened in user open mode, which shallbe 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 procedurethat 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 fileused on CLASS m/c. State exclusion table shall be used as DDM file on CLASS m/c. This procedurecode shall be conditioned to use different files based on the system for which they are created usingcompile directive define. Define is compiler directive which can be used in ILE programs tocondition the statements based on the system name. If the system name changes the portion ofcode used for compilation shall be changed. Files CHMSTRAA/HHMSRTPL , FESTEXCP shall beused in the procedure if it compiled on system AS400LS otherwise AQLOANPL, DDM copy ofFESTEXCP shall be used for CLASS m/c. The entire functionality remains same in procedure or LSand 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 filefor FESTEXCP on CLASS system. Open the DDM copy for file FESTEXCP use the followingcommands by calling QCMDEXC or by calling separate CL program.
Keylist1 shall be declared to access the FESTEXCP file and shall contain all the 5 key fields feecode, state code, county, loan type and subclass.
Check whether optional parameters are received in the module. If optional parameters are notreceived then open the file CHMSTR and using the account number received set file pointer to lowerlimit (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 subclass. 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 fileAQLOANPL. Close the opened file(s).
Populate the values state code, county, loan type and sub class from the file (or received asparameters) 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), thenmove *ON to the return parameter specifying that state exclusion exists for the fee code and accountnumber.
152004362.doc Page 5 of 11 06/15/13
RTVOBJD OBJ(SYSMGRLS) OBJTYPE(*FILE) RTNLIB(&LIBDDM)
CRTDUPOBJ OBJ(SYSMGRLS) FROMLIB(&LIBDDM)OBJTYPE(*FILE) TOLIB(QTEMP)
NEWOBJ(FEETRCD)
-
7/28/2019 Design Document for Procedures
6/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
If record does not exist in FESTEXCP file for values of all five key fields, blank out the last key fieldand try again, if record does not exist continue checking the record by blanking out fields one by oneuntil county is blank. If record exists for any of the combination move *ON to return parameterotherwise move *OFF to return parameter. Close the opened file FESTEXCP. Combination of thekey field values to check the existence of the record in FESTEXCP file shall be as follows:
Fee Code State County Loan Type Sub ClassTry1 Value Value Value Value ValueTry2 Value Value Value Value *Blanks
Try3 Value Value Value *Blanks *BlanksTry4 Value Value *Zeros *Blanks *Blanks
Standard errors while executing the procedure shall be monitored and handled. If any kind of erroroccurs move *OFF to return parameter.
152004362.doc Page 6 of 11 06/15/13
-
7/28/2019 Design Document for Procedures
7/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
Diagram1: Flow chart of procedure
152004362.doc Page 7 of 11 06/15/13
Start
If optional
parameters values
received
Receive ACCT#, TRNCD asmandatory parameter and STATCD,
CNTYCD, LNTYPE , SUBCLS as
optional parameter
Using ACCT# chain to CHMSTRAA/HHMSTRPL(for HELOC loans) for programs onAS400LS m/c
or chain AQLOANPL for loans on CLASS m/c
and fetch
values of State code, County, Loan type,
Subclass
Set the key (FETRCD, STATCD,
CNTYCD,LNTYPE,SUBCLS)with the values obtained above
If record
exists in FESTEXCP
for any of the
combinations
above
Return *ON End
Return *OFF
End
Yes
Yes
No
Check record in file FESTEXCPfile with all 5 key values
If record exists
in FESTEXCPReturn *ON End
Yes
Blank out key field value one byone from last and check whether
record exists in FESTEXCP until
CNTYCD is blank
No
No
Return Parameter
*ON ----> State exclusion exists
*OFF ----> State exclusion does not exists
A
A
-
7/28/2019 Design Document for Procedures
8/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
2.3 Binding Source for compilation (PPCBND02S)
This binding source (export source) shall contain the export statements of all exported procedures, inthis case the exported procedure is @ChkStateExcln. This binding source shall be used as exportsource while creating the service program. Service program can be created with our own signatureusing the export source. If binding source is used to create a service program, the program that usesthe procedure in the service program does not require recompilation even if the procedure ischanged.
PPCBND02S is the existing binding source, add the following export statement to it and use thesame binding source for compilation.
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 serviceprogram in which the procedure will be available.
Creating module:
Creating service program:
Binding directory:
PPCBNDR03 is an existing binding directory used for PPC programs, and service programPPCSRV02 is an entry in the binding directory. New procedures shall be available in this bindingdirectory as the module FESTEXCM shall be added to the service program PPCSRV02. If anyprogram has to refer the new procedure, binding directory PPCBNDR03 should be included while
compilation.
152004362.doc Page 8 of 11 06/15/13
EXPORT SYMBOL('@ChkStateExcln')
CRTRPGMOD MODULE(Library/FESTEXCM)
SRCFILE(Library/Source File)
SRCMBR(FESTEXCM)
CRTSRVPGM SRVPGM(Library/PPCSRV02)MODULE(PPCMOD01 PPCMOD02 PPCMOD03 LMSRVMOD INSPMTMOD
LATECHAR LATECHR1 PAY000R FESTEXCM)
EXPORT(*SRCFILE) SRCFILE(Library/QSRVSRC)
SRCMBR(FESTEXCP) ACTGRP(*CALLER)
-
7/28/2019 Design Document for Procedures
9/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
3 Procedure @GetFeeAmt
This procedure shall be created which receives account number, fee code and other filter criterionfields like Owed By Borrower, Billable, Waivable, Claimable also new Field State exclusion asparameters 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 Type100), and debits (Transaction Type 600) and remaining balance.
E.g. If for an account fee transaction file has the following image.
AccountNumber
Fee Code TransactionType
FeeAmount
1605 10052 600 10.001605 10052 600 10.001605 10052 600 10.00
1605 10052 100 10.001605 10026 600 30.001605 10026 600 40.00
1605 10026 100 20.00
The new procedure will return the value in the following layout (array) to the calling program.
Fee Code Credit Amount Debit Amount RemainingAmount
10052 10.00 30.00 20.00
10026 20.00 70.00 50.0000000 30.00 100.00 70.00
The last row of the array will contain the total debits, credits and remaining balance of all the feecodes.
The procedure can be used for the following purposes
1. To get total fee details for a fee code by passing fee code.
2. To get total fee details for all fee codes available by passing zeros to fee code3. Calling program can specify the filter criteria for calculating the total fee4. The total fee details for a loan(returned as the last element of the array)
152004362.doc Page 9 of 11 06/15/13
-
7/28/2019 Design Document for Procedures
10/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
3.1 Prototype for the procedure @GetFeeAmt
The header copybook for this procedure shall contain the prototype declarations of the procedureand shall be included in the same copybook (FEESTEXH) mentioned in section 2.1. This copybookshall be included in any program that requires this procedure including the module in which this
procedure will be coded.
3.2 Module for new procedure @GetFeeAmt
This module shall contain the code of the procedure, this procedure code shall be included in thesame module (FEESTEXM) mention in section 2.2.
Fee transaction file FEETRNAB shall be declared in file specification in input mode and user openmode. Transaction records from this file shall be read using account and fee code (if provided) askeys. 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 bemoved to an element of return parameter array. Each element of this array shall contain the valuesfor 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 isreceived, then set the key as account number and fee code to access the file, otherwise set the keywith 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 correspondingfield in the fee transaction file. Set a flag to Y if the filter criteria satisfies and use the flag valuefurther in the procedure while calculating the total fees. Please see the sample code below. Use thesame code for all the fields in the filter criteria. If the filter criteria results in Y then include thatrecord in total fees calculation
152004362.doc Page 10 of 11 06/15/13
d @GetFeeAmt PR 40 Dim(100)
d Acct# LIKE(@acct#) CONST
d FeeCode 5 0 CONST OPTIONS(*NOPASS)
d OBYBFLG 1 CONST OPTIONS(*NOPASS)
d BILLFLG 1 CONST OPTIONS(*NOPASS)
d WAIVFLG 1 CONST OPTIONS(*NOPASS)
d CLIMBFLG 1 CONST OPTIONS(*NOPASS)
d STEXFLG 1 CONST OPTIONS(*NOPASS)
-
7/28/2019 Design Document for Procedures
11/11
FEE State Exclusion Design Document for ProceduresPCR# - 984597
If fee code is received as a parameter then read records for the account number for that fee codeonly. Otherwise, read records for the account number and for all fee codes. Based on the filtercriteria result, include or exclude the record for fee calculation. If the transaction type is 600, add thetransaction fee amount to debits. If transaction type is 100 add the amount to credits. Add feeamount 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 andremaining balance) to return parameter array element. If procedure called for total fee for all feecodes then calculate total debits, credits and remaining balance for all fee codes and move to arrayelements. Calculate the cumulative total of credits, debits, and remaining balance moved to arrayelement 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 sourcePPCBND02S mentioned in section 2.3.
3.4 Compilation
Procedure @GetFeeAmt shall be included in the same module FEESTEXM. Hence this procedureshall be included in the same service program PPCSRV02.
152004362.doc Page 11 of 11 06/15/13
C Eval Filter = 'Y'
C If ObyBFlg and Filter
C If FEOBYB = No
C Eval fileter = No
C EndIf
C EndIf
*C If BillFlg and Filter
C If FEBILL = No
C Eval fileter = No
C EndIf
C EndIf
EXPORT SYMBOL('@GetFeeAmt')
top related