COBOL Driver Example - Finalist - 10.0

Finalist Guide

Product type
Software
Portfolio
Verify
Product family
Data Quality - Postals
Product
Finalist
Version
10.0
Language
English
Product name
Finalist
Title
Finalist Guide
Copyright
2023
First publish date
1984
Last updated
2024-05-15
Published on
2024-05-15T00:57:22.811031
       IDENTIFICATION DIVISION.
       PROGRAM-ID. 'ADDRTEST'.
       DATE-COMPILED.
      ** ===========================================================
      *
      *
      *  AUTHOR.
      *     PITNEY BOWES INC
      *     ALL RIGHTS RESERVED.
      *
      *     PROGRAMS AND DESIGN (C) COPYRIGHT 2013
      *
      ** ===========================================================
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER. IBM-3270 WITH DEBUGGING MODE.
      *OBJECT-COMPUTER. IBM-3270.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      *
      * PROGRAM = ADDRTEST
      *
      * PROGRAM TYPE = BATCH DRIVER
      *
      * APPLICATION = FINALIST
      *
      * CALLED PROGRAMS:
      *     ADDRSCAN - AN EXTERNAL ROUTINE FOR IDENTIFYING
      *                ADDRESS LINES
      *
      * INPUTS:
      *     NONE
      *
      * OUTPUTS:
      *     NONE
      *
      * PROGRAM NARRATIVE:
      *     ADDRTEST IS TEST DRIVER PROGRAM.
      *     ITS PURPOSE IS TO DEMONSTRATE HOW TO CALL ADDRSCAN.
      *
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
       DATA DIVISION.
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
       FILE SECTION.
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
       WORKING-STORAGE SECTION.
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
       01  LOOP-COUNTER                PIC 99.
       77  FILLER                      PIC X(45)   VALUE
           '** ADDRTEST WORKING STORAGE STARTS HERE **'.
      * ADDRPASS-CALL-AREA
           COPY ADDR021D.
       77  FILLER                      PIC X(43)   VALUE
           '** ADDRRTEST WORKING STORAGE ENDS HERE **'.
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
       LINKAGE SECTION.
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
       PROCEDURE DIVISION.
      *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
       0000-MAIN-LOGIC.
      *
      *
      * ONE TIME INITIALIZATION
      * - SET ANCHOR TO -1 (OR HIGH VALUES) FOR FIRST CALL
      *
           MOVE HIGH-VALUES TO ADDRPASS-ANCHOR
      *
      * MAKE MULTIPLE CALLS TO ADDRSCAN
      * (IN ACTUALITY, ADDRESSES WOULD BE FROM A DATABASE OR FILE)
      *
           PERFORM VARYING LOOP-COUNTER FROM 2 BY -1
               UNTIL LOOP-COUNTER < 1
      *
      * SETTINGS FOR EACH CALL TO ADDRSCAN (INCLUDING FIRST CALL)
      * - SET PROCESSING OPTIONS {ADDRPASS-OPTIONS}
      * - SET RETURN LINE ORDER {ADDRPASS-RTN-ORDER}
      * - SET (OR CLEAR) ADVANCED PROCESSING OPTIONS {ADDRPASS-TYPES}
      * - SET LINE LENGTH {ADDRPASS-LNMX-NUM}
      * - SET (OR CLEAR) ALL 6 INPUT LINES {ADDRPASS-PASSED-LINES}
      *
           MOVE '9BN' TO ADDRPASS-OPTIONS
           MOVE 'N' TO ADDRPASS-RTN-ORD1
           MOVE SPACES TO ADDRPASS-TYPES
           MOVE 70 TO ADDRPASS-LNMX-NUM
           MOVE 'PITNEY BOWES'    TO ADDRPASS-INLINE1
           MOVE '2200 WESTERN CT' TO ADDRPASS-INLINE2
           MOVE 'STE 100'         TO ADDRPASS-INLINE3
           MOVE 'LISLE'           TO ADDRPASS-INLINE4
           MOVE 'IL'              TO ADDRPASS-INLINE5
           MOVE '60532-3618'      TO ADDRPASS-INLINE6
      *
      * DISPLAY INPUT DATA
      *
           DISPLAY 'ADDRSCAN INPUT VALUES'
           DISPLAY 'ADDROPTS:' ADDRPASS-OPTIONS
           DISPLAY 'ADDRRORD:' ADDRPASS-RTN-ORDER
           DISPLAY 'ADDRTYPS:' ADDRPASS-TYPES
           DISPLAY 'LNLENGTH:' ADDRPASS-LNMX-NUM
           DISPLAY 'INLINE1 :' ADDRPASS-INLINE1
           DISPLAY 'INLINE2 :' ADDRPASS-INLINE2
           DISPLAY 'INLINE3 :' ADDRPASS-INLINE3
           DISPLAY 'INLINE4 :' ADDRPASS-INLINE4
           DISPLAY 'INLINE5 :' ADDRPASS-INLINE5
           DISPLAY 'INLINE6 :' ADDRPASS-INLINE6
           DISPLAY ' '
      *
      * CALL ADDRSCAN
      *
           CALL 'ADDRSCAN' USING BY REFERENCE ADDRPASS-CALL-AREA
      *
      * DISPLAY OUTPUT DATA
      *
           DISPLAY 'ADDRSCAN OUTPUT VALUES'
           DISPLAY 'OUTLINE1      :' ADDRPASS-OUTLINE1
           DISPLAY 'OUTLINE2      :' ADDRPASS-OUTLINE2
           DISPLAY 'OUTLINE3(CS)  :' ADDRPASS-OUTLINE3
           DISPLAY 'OUTLINE4(FIRM):' ADDRPASS-OUTLINE4
           DISPLAY 'URB           :' ADDRPASS-OUTURB
           DISPLAY 'ADDRNDX1      :' ADDRPASS-INDEX1
           DISPLAY 'ADDRNDX2      :' ADDRPASS-INDEX2
           DISPLAY 'ZIP-ZIP4      :' ADDRPASS-ZIP-PLUS-4
           DISPLAY 'LINE TYPES    :' ADDRPASS-TYPES
           DISPLAY 'UNIVERSITY    :' ADDRPASS-UNIV-WORD
           DISPLAY 'DORMITORY     :' ADDRPASS-DORM-WORD
           DISPLAY ' '
           END-PERFORM.
      *
      * TERMINATE ADDRSCAN
      *
           MOVE HIGH-VALUES TO ADDRPASS-OPTIONS
           CALL 'ADDRSCAN' USING BY REFERENCE ADDRPASS-CALL-AREA
           GOBACK.
      *
       0000-EXIT.
           EXIT.
       END PROGRAM 'ADDRTEST'.