Sample generated COBOL code
This code sample is derived from the sample COBOL copybook miniloan.cpy.
Note:
Deprecated feature: The
COBOL code generation feature is deprecated in V8.5. This feature
will be removed in a future release of the product. Use the COBOL
Generation Project Migration wizard to migrate your Rules
for COBOL project to a zRule
Execution Server for z/OS® compatible
rule project. See Deprecated features for migration
details.
The following code shows a section of the code generated for a copybook named miniloan.cpy. When you have generated your COBOL code, you can compile, link, and then run the code inside a batch, CICS®, or IMS application.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY LOCLMINI.
01 LOCALAREA.
02 MAPPEDMETHOD1-MSG PIC X(40).
02 STRTEMP1 PIC X(33) VALUE
"The age exceeds the maximum line.".
02 STRTEMP2 PIC X(30) VALUE "The loan cannot exceed 1000000".
02 STRTEMP3 PIC X(28) VALUE "Too big Debt-To-Income ratio".
02 STRTEMP4 PIC X(22) VALUE "Credit score below 200".
02 STRTEMP5 PIC X(48) VALUE
"The income after tax is lower than basic request".
02 METHOD3-INCOMEAFTERTAX PIC 9(10).
02 METHOD3-TABLE OCCURS 100 TIMES.
03 METHOD3-SUB-ITEM PIC 9(10).
02 METHOD3-IX PIC 99 VALUE 0.
LINKAGE SECTION.
COPY MINILOAN.
PROCEDURE DIVISION USING BORROWER LOAN.
* Task: mainflow
TASK1-MAINFLOW.
PERFORM TASK2-MAINFLOW-VALIDATION
PERFORM TASK3-MAINFLOW-ELIGIBILITY
GOBACK.