COBOLパススルーINMODの例 - MultiLoad

Teradata® MultiLoadリファレンス

Product
MultiLoad
Release Number
17.10
Published
2021年6月
Language
日本語
Last Update
2021-09-23
dita:mapPath
ja-JP/fel1608578437279.ditamap
dita:ditavalPath
ja-JP/fel1608578437279.ditaval
dita:id
B035-2409
Product Category
Teradata Tools and Utilities
                       IDENTIFICATION DIVISION.
                       PROGRAM-ID. INMOD2.
                       AUTHOR. STV.
                       INSTALLATION. TERADATA.
                       DATE-WRITTEN. 18 SEPTEMBER 1989.
                       DATE-COMPILED.
                       SECURITY. OPEN.
                       REMARKS.
                          THIS PROGRAM IS AN EXAMPLE OF A COBOL INMOD ROUTINE
                          WHICH RECEIVES A RECORD FROM MLOAD THEN MODIFIES OR
                          REJECTS IT.
                       ENVIRONMENT DIVISION.
                       CONFIGURATION SECTION.
                       SOURCE-COMPUTER. IBM-370.
                       OBJECT-COMPUTER. IBM-370.
                       DATA DIVISION.
                       WORKING-STORAGE SECTION.
                       01  COUNTROWS                  PICTURE S9(4) COMP VALUE +0.
                       01  REJROWS                    PICTURE S9(4) COMP VALUE +0.
                       01  INSROWS                    PICTURE S9(4) COMP VALUE +0.
                       01  I                          PICTURE S9(4) COMP.
                       01  MATCHFLAG  PIC 9.
                             88 NOTMATCH  VALUE 0.
                             88 MATCH     VALUE 1.
                       LINKAGE SECTION.
                       01  STRUCT-1.
                           02  RETURN-INDICATE        PIC S9(9) COMP.
                           02  RECORD-LEN             PIC S9(9) COMP.
                           02  RECORD-BODY OCCURS 80 TIMES.
                             03  DATA-AREA1           PIC X.
                       01  STRUCT-2.
                           02  SEQ-NUMBER             PIC S9(9) COMP.
                           02  PARM-LIST.
                               05 PARM-LENGTH          PIC S9(4) COMP.
                               05 PARM-STRING OCCURS 80 TIMES.
                                  07 PARM-DATA         PIC X.
                       PROCEDURE DIVISION USING STRUCT-1, STRUCT-2.
                       BEGIN.
                       MAIN.
                           DISPLAY "============================================="
                           IF RETURN-INDICATE = 6 THEN
                              DISPLAY "INMOD2 CALLED - RETURN CODE 6 "
                              PERFORM INITIALIZE
                              GOBACK
                           ELSE
                           IF RETURN-INDICATE = 7 THEN
                              DISPLAY "INMOD2 CALLED - RETURN CODE 7 "
                              PERFORM PROCESS-RECORD
                              GOBACK
                           ELSE
                              IF RETURN-INDICATE = 5 THEN
                              DISPLAY "INMOD2 CALLED - RETURN CODE 5 "
                              PERFORM FINALIZE
                              GOBACK
                           ELSE
                              DISPLAY "BLKEXIT CALLED - RETURN CODE X "
                              MOVE 0 TO RETURN-INDICATE.
                              GOBACK.
                       INITIALIZE.
                           MOVE 0 TO COUNTROWS  INSROWS REJROWS.
                           MOVE 0 TO RETURN-INDICATE.
                       PROCESS-RECORD.
                           ADD 1 TO COUNTROWS.
                           MOVE 0 TO RETURN-INDICATE. MOVE 1 TO I.
                           MOVE 1 TO MATCHFLAG.
                           PERFORM COMPARE UNTIL (I > PARM-LENGTH) OR (NOTMATCH).
                           IF NOTMATCH THEN
                              DISPLAY "REJECTED"
                              ADD 1 TO REJROWS
                              MOVE 0 TO RECORD-LEN
                           ELSE
                              DISPLAY "ACCEPTED"
                              ADD 1 TO INSROWS.
                       COMPARE.
                           IF (RECORD-BODY(I) = PARM-STRING(I)) THEN
                              NEXT SENTENCE
                           ELSE
                              MOVE 0 TO MATCHFLAG.
                           ADD 1 TO I.
                       FINALIZE.
                           MOVE 0 TO RETURN-INDICATE.
                       DISPLAY "NUMBER OF TOTAL RECORDS    = " COUNTROWS.
                       DISPLAY "NUMBER OF REJECTED RECORDS = " REJROWS.
                       DISPLAY "NUMBER OF ACCEPTED RECORDS = " INSROWS.
                       GOBACK.