Compare, Partial Records
Predetermined Positions
  Table of Contents  v-16.01.01 - cup303x1.htm 
  Introduction
  COBOL Code for CUP303C1.cbl
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page

Table of Contents Previous Section Next Section Introduction

This document contains the COBOL source code that does a partial record-by-record comparison of two VSAM key-sequenced-Data-Sets (KSDS's). The partial compared is done to bypass the known variables (such as a time stamp) within a record. The positions within the record to be compared are determined at the time the program is compiled. This approach has the advantage of limiting the number of parameters for the execution process. However, it limits the scope of the comparison to the pre-defined positions to be compared.

The COBOL source code was generated to comply with the COBOL/390 dialect. It may be compiled and executed on an IBM Mainframe System with ZOS or VSE. It may be compiled and executed on a Linux, UNIX or Windows System with Micro Focus.

Note: The COBOL Source code was generated using SimoTime Technologies. The generation program (UTCOMPRT) must be executed on a Windows System with Micro Focus.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2016
SimoTime Technologies
All Rights Reserved

Table of Contents Previous Section Next Section COBOL Code for CUP303C1.cbl

The following (CUP303C1.cbl) is the COBOL source code for a program that compares two VSAM Key-Sequenced-Data Sets (KSDS's).

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CUP303C1.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2012-07-09  Generation Time: 11:25:43:52    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     CUACTUAL INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  OUTPUT    CUEXPECT INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT CUACTUAL-FILE  ASSIGN TO       CUACTUAL
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUACTUAL-PKEY-00001-00012
                  FILE STATUS   IS CUACTUAL-STATUS.
           SELECT CUEXPECT-FILE  ASSIGN TO       CUEXPECT
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUEXPECT-PKEY-00001-00012
                  FILE STATUS   IS CUEXPECT-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  CUACTUAL-FILE
           DATA RECORD    IS CUACTUAL-REC
           .
       01  CUACTUAL-REC.
           05  CUACTUAL-PKEY-00001-00012        PIC X(00012).
           05  CUACTUAL-DATA-00013-00500        PIC X(00500).

       FD  CUEXPECT-FILE
           DATA RECORD    IS CUEXPECT-REC
           .
       01  CUEXPECT-REC.
           05  CUEXPECT-PKEY-00001-00012        PIC X(00012).
           05  CUEXPECT-DATA-00013-00500        PIC X(00500).

      *****************************************************************
      * This program was created using the SYSCOMP1.TXT file as the   *
      * template for the data file comparison. The positions to be    *
      * compared are determined at compile time.                      *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 11.01.08          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CUP303C1 '.
           05  T2 pic X(34) value 'Comparison, CustMAST from 1 to 303'.
           05  T3 pic X(10) value ' v12.04.19'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CUP303C1 '.
           05  C2 pic X(32) value 'This Data File Compare Member wa'.
           05  C3 pic X(32) value 's generated by SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-01.
           05  C1 pic X(11) value '* CUP303C1 '.
           05  C2 pic X(32) value 'A Data File Compare Program gene'.
           05  C3 pic X(32) value 'rated by using SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* CUP303C1 '.
           05  C2 pic X(32) value 'Please send all inquires or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

       01  CUACTUAL-STATUS.
           05  CUACTUAL-STATUS-L     pic X.
           05  CUACTUAL-STATUS-R     pic X.
       01  CUACTUAL-EOF              pic X       value 'N'.
       01  CUACTUAL-OPEN-FLAG        pic X       value 'C'.

       01  CUEXPECT-STATUS.
           05  CUEXPECT-STATUS-L     pic X.
           05  CUEXPECT-STATUS-R     pic X.
       01  CUEXPECT-EOF              pic X       value 'N'.
       01  CUEXPECT-OPEN-FLAG        pic X       value 'C'.

      *****************************************************************
      * The following buffers are used to create a four-byte status   *
      * code that may be displayed.                                   *
      *****************************************************************
       01  IO-STATUS.
           05  IO-STAT1            pic X.
           05  IO-STAT2            pic X.
       01  IO-STATUS-04.
           05  IO-STATUS-0401      pic 9     value 0.
           05  IO-STATUS-0403      pic 999   value 0.
       01  TWO-BYTES-BINARY        pic 9(4)  BINARY.
       01  TWO-BYTES-ALPHA         redefines TWO-BYTES-BINARY.
           05  TWO-BYTES-LEFT      pic X.
           05  TWO-BYTES-RIGHT     pic X.

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* CUP303C1 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

      *****************************************************************
       01  APPL-RESULT             pic S9(9)    comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  READ-FLAGS.
           05  READ-1      pic X       value 'Y'.
           05  READ-2      pic X       value 'Y'.
       01  DUMP-FLAGS.
           05  DUMP-ASC    pic X       value 'Y'.
           05  DUMP-EBC    pic X       value 'Y'.
           05  DUMP-HEX    pic X       value 'Y'.

       01  FUNCTION-FLAGS.
           05  FF-01       pic X       value '1'.
           05  FF-02       pic X       value '0'.
           05  FF-03       pic X       value '0'.

       01  COMPACT-STATUS  pic XX      value 'EQ'.
       01  COMPACT-PENDED  pic XX      value 'EQ'.
       01  COMPARE-STATUS  pic XX      value 'EQ'.
       01  FLAG-EQ         pic XX      value 'EQ'.
       01  FLAG-NE         pic XX      value 'NE'.
       01  FLAG-QT         pic XX      value 'QT'.
       01  DELTA-LINE-1    pic X(1024) value all '-'.
       01  DELTA-LINE-2    pic X(1024) value all '-'.
       01  PTR-1           pic 9(5)    value 0.
       01  PTR-2           pic 9(5)    value 0.
       01  IDX-1           pic 9(5)    value 0.
       01  IDX-2           pic 9(5)    value 0.
       01  DELTA-MAXIMUM-X pic X(5)    value '00005'.
       01  DELTA-MAXIMUM   redefines DELTA-MAXIMUM-X pic 9(5).
       01  DELTA-PROCESS   pic X(4)    value 'EOF '.
       01  BYPASS-UT1-CTR  pic 9(3)    value 0.
       01  BYPASS-UT2-CTR  pic 9(3)    value 0.
       01  WORK-05         pic X(5)    value SPACES.

       01  YES-YES         pic XX      value 'YY'.
       01  N-BYTE          pic X       value 'N'.
       01  Y-BYTE          pic X       value 'Y'.

       01  KEY-ACTIVE      pic X       value 'Y'.
       01  KEY-CONTROL-1.
           05  PS-1        pic 9(5)    value 00001.
           05  LN-1        pic 9(5)    value 00012.
       01  KEY-CONTROL-2.
           05  PS-2        pic 9(5)    value 00001.
           05  LN-2        pic 9(5)    value 00012.

       01  CUACTUAL-LRECL    pic 9(5)    value 00512.
       01  LEN-1           pic 9(5)    value 128.
       01  POS-1           pic 9(5)    value 1.
       01  CUEXPECT-LRECL    pic 9(5)    value 00512.
       01  LEN-2           pic 9(5)    value 128.
       01  POS-2           pic 9(5)    value 1.

       01  D-LEN           pic 9(5)    value 128.
       01  D-POS           pic 9(5)    value 1.

       01  W-LEN           pic 9(5)    value 0.
       01  W-POS           pic 9(5)    value 10.

       01  CONTINUE-FLAG   pic X       value 'Y'.

       01  ASC-OR-EBC      pic 9(3)    comp    value 0.
       01  ASC-OR-EBC-R    redefines ASC-OR-EBC.
           05  ASC-A       pic X.
           05  EBC-A       pic X.

      *    Header row for positional indicator...
       01  DUMP-H10.
           05  FILLER      pic X(5)    value '....:'.
           05  POS-NO      pic 9(5)    value 10.
       01  DUMP-HEADER     pic X(1024) value all '.'.
       01  D-P1            pic 9(5)    value 0.

       01  RECORD-HEADER.
           05  RECORD-ID   pic X(8)    value 'CUACTUAL'.
           05  filler      pic X(2)    value '..'.
           05  REC-NUMBER  pic 9(9)    value 0.
           05  filler      pic X       value '('.
           05  RECORD-POS  pic 9(5)    value 0.
           05  filler      pic X       value ':'.
           05  RECORD-LEN  pic 9(5)    value 0.
           05  filler      pic X(2)    value ') '.
           05  REC-CTYPE   pic X(10)   value 'UNKNOWN   '.
           05  filler      pic X(2)    value SPACES.
           05  REC-CMODE   pic X(10)   value 'UNKNOWN   '.

       01  SYSLOG-OUTPUT   pic X(4)    value 'OUT1'.

       01  INFO-STATEMENT.
           05  INFO-SHORT.
               10  INFO-ID pic X(8)    value 'Starting'.
               10  filler  pic X(4)    value '  - '.
               10  INFO-34 pic X(34)
                   value   'Comparison, CustMAST from 1 to 303'.
           05  filler      pic X(33)
               value '          http://www.SimoTime.com'.

       01  CUACTUAL-TOTAL.
           05  CUACTUAL-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for CUACTUAL'.
       01  CUEXPECT-TOTAL.
           05  CUEXPECT-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for CUEXPECT'.
       01  COMPARE-NE-TOTAL.
           05  COMPARE-NE  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  COMPARE-TAG pic X(25) value 'All Equal result for comp'.
           05  filler      pic X(25) value 'are of existing records  '.
       01  COMPACT-NE-TOTAL.
           05  COMPACT-NE  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  COMPACT-TAG pic X(25) value 'All Equal result for comp'.
           05  filler      pic X(25) value 'act of existing records  '.

       01  FORMAT-TYPE     pic X     value 'B'.

       COPY PASSHEX4.
       COPY PASSLOGS.
       COPY PAENVARS.

      *****************************************************************
       PROCEDURE DIVISION.
           perform JOB-STARTING

           perform
               until COMPARE-STATUS = 'QT'
               or    CUACTUAL-STATUS not = '00'
               or    CUEXPECT-STATUS not = '00'
               if  READ-1 = 'Y'
                   perform CUACTUAL-READ
               end-if
               if  READ-2 = 'Y'
                   perform CUEXPECT-READ
               end-if
               if  CUACTUAL-STATUS = '00'
               and CUEXPECT-STATUS = '00'
                   move 'EQ' to COMPARE-STATUS
                   if  KEY-ACTIVE = 'Y'
                   and COMPARE-STATUS = FLAG-EQ
                       perform COMPARE-KEYS
                   end-if
                   if  COMPARE-STATUS = FLAG-EQ
                       perform COMPARE-RECORDS
                   end-if
                   if  COMPARE-STATUS = FLAG-NE
                       add 1 to COMPARE-NE
                   end-if
               end-if
               if  DELTA-PROCESS = 'QUIT'
               and COMPARE-NE > DELTA-MAXIMUM
                   move 'The Not Equal count exceeds Maximum limit...'
                     to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
               if  DELTA-PROCESS = 'EOF '
               and COMPARE-NE > DELTA-MAXIMUM
                   move 'The Not Equal count exceeds Maximum limit...'
                     to MESSAGE-TEXT
                   perform Z-DISPLAY-TO-CONSOLE
                   move 'QT' to COMPARE-STATUS
               end-if
           end-perform

           perform JOB-FINISHED

           GOBACK.

      *****************************************************************
       COMPARE-RECORDS.
      *    Physical Comparison...
           move 'COMPARISON' to REC-CTYPE
           move 'PHYSICAL  ' to REC-CMODE
           if CUACTUAL-REC(00001:00303) not = CUEXPECT-REC(00001:00303)
              move FLAG-NE to COMPARE-STATUS
              if  COMPARE-NE < DELTA-MAXIMUM
                  add 00001 to ZERO  giving POS-1
                  add 00001 to ZERO  giving POS-2
                  add 00303 to ZERO  giving LEN-1
                  add 00303 to ZERO  giving LEN-2
                  add 00303 to ZERO  giving PASSHEX4-LENGTH
                  perform DUMP-PRIMARY-RECORD
                  perform DUMP-SECONDARY-RECORD
                  perform DUMP-POSITION-DIFFERENCE
              end-if
           end-if
           exit.


      *****************************************************************
       COMPARE-KEYS.
           move YES-YES to READ-FLAGS
           if  CUACTUAL-REC(PS-1:LN-1)
            <  CUEXPECT-REC(PS-2:LN-2)
               move N-BYTE to READ-2
               move FLAG-NE to COMPARE-STATUS
               perform DUMP-PRIMARY-MISSING
           end-if
           if  CUACTUAL-REC(PS-1:LN-1)
            >  CUEXPECT-REC(PS-2:LN-2)
               move N-BYTE to READ-1
               move FLAG-NE to COMPARE-STATUS
               perform DUMP-SECONDARY-MISSING
           end-if
           exit.

      *****************************************************************
       DUMP-TO-LOG.
      *    HexDump...
      *    Dump DD Name, Record-Number, (position,length)
           move RECORD-HEADER to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
      *    DUMP position indicator
           perform DUMP-POSITION-INDICATOR
           if  DUMP-ASC = 'Y'
               move PASSHEX4-ASCII(1:D-LEN) to SIMOLOGS-MESSAGE
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if
           if  DUMP-HEX = 'Y'
               move PASSHEX4-UPPER(1:D-LEN) to SIMOLOGS-MESSAGE
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
               move PASSHEX4-LOWER(1:D-LEN) to SIMOLOGS-MESSAGE
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if
           if  DUMP-EBC = 'Y'
               move PASSHEX4-EBCDIC(1:D-LEN) to SIMOLOGS-MESSAGE
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if
           exit.

      *****************************************************************
      *    Build the position header row...
      *****************************************************************
       DUMP-POSITION-INDICATOR.
           add 9 to D-POS giving POS-NO
           perform varying D-P1 from 1 by 10 until D-P1 > 1020
               move DUMP-H10 to DUMP-HEADER(D-P1:10)
               inspect DUMP-HEADER(D-P1 + 5:5)
                       replacing leading ZEROES by '.'
               add 10 to POS-NO
           end-perform
           move DUMP-HEADER(1:D-LEN) to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           exit.

      *****************************************************************
       DUMP-PRIMARY-MISSING.
           move 'CUACTUAL Record is missing from CUEXPECT file'
             to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move SPACES to PASSHEX4-SOURCE
           add CUACTUAL-RDR to ZERO giving REC-NUMBER
           add PS-1 to ZERO giving RECORD-POS
           add LN-1 to ZERO giving RECORD-LEN
           add PS-1 to ZERO giving D-POS
           add LN-1 to ZERO giving D-LEN
           move 'CUACTUAL..' to RECORD-ID
           move CUACTUAL-REC(PS-1:LN-1) to PASSHEX4-SOURCE
           call 'SIMOHEX4' using PASSHEX4-PASS-AREA
           perform DUMP-TO-LOG
           perform DUMP-POSITION-DIFFERENCE
           exit.

      *****************************************************************
       DUMP-PRIMARY-RECORD.
           add POS-1 to ZERO giving RECORD-POS
           add LEN-1 to ZERO giving RECORD-LEN
           add POS-1 to ZERO giving D-POS
           add LEN-1 to ZERO giving D-LEN
           move 'CUACTUAL..' to RECORD-ID
           add CUACTUAL-RDR to ZERO giving REC-NUMBER
           move CUACTUAL-REC(D-POS:D-LEN) to PASSHEX4-SOURCE
           call 'SIMOHEX4' using PASSHEX4-PASS-AREA
           display 'DEBUB-01A ' PASSHEX4-UPPER(1:5)
           display 'DEBUB-01B ' PASSHEX4-LOWER(1:5)
           perform DUMP-TO-LOG
           exit.

      *****************************************************************
       DUMP-SECONDARY-MISSING.
           move 'CUEXPECT Record is missing from CUACTUAL file'
             to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move SPACES to PASSHEX4-SOURCE
           add CUEXPECT-RDR to ZERO giving REC-NUMBER
           add PS-2 to ZERO giving RECORD-POS
           add LN-2 to ZERO giving RECORD-LEN
           add PS-2 to ZERO giving D-POS
           add LN-2 to ZERO giving D-LEN
           move 'CUEXPECT..' to RECORD-ID
           move CUEXPECT-REC(PS-2:LN-2) to PASSHEX4-SOURCE
           call 'SIMOHEX4' using PASSHEX4-PASS-AREA
           perform DUMP-TO-LOG
           perform DUMP-POSITION-DIFFERENCE
           exit.

      *****************************************************************
       DUMP-SECONDARY-RECORD.
           move SPACES to PASSHEX4-SOURCE
           add POS-2 to ZERO giving RECORD-POS
           add LEN-2 to ZERO giving RECORD-LEN
           add POS-2 to ZERO giving D-POS
           add LEN-2 to ZERO giving D-LEN
           move 'CUEXPECT..' to RECORD-ID
           add CUEXPECT-RDR to ZERO giving REC-NUMBER
           move CUEXPECT-REC(D-POS:D-LEN) to PASSHEX4-SOURCE
           call 'SIMOHEX4' using PASSHEX4-PASS-AREA
           perform DUMP-TO-LOG
           exit.

      *****************************************************************
       DUMP-POSITION-DIFFERENCE.
           if  READ-FLAGS = 'YY'
               move all '-' to DELTA-LINE-2
               add POS-1 to ZERO giving PTR-1
               add POS-2 to ZERO giving PTR-2
               add 1 to ZERO giving IDX-2
               perform until IDX-2 > 1024
                          or IDX-2 > D-LEN
                   if  CUACTUAL-REC(PTR-1:1)
                    =  CUEXPECT-REC(PTR-2:1)
                       move '=' to DELTA-LINE-2(IDX-2:1)
                   else
                       move '#' to DELTA-LINE-2(IDX-2:1)
                   end-if
                   add 1 to PTR-1
                   add 1 to PTR-2
                   add 1 to IDX-2
               end-perform
           else
               move all '#' to DELTA-LINE-2
           end-if
           move DELTA-LINE-2(1:D-LEN) to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move '*' to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           exit.

      *****************************************************************
       JOB-FINISHED.
           if  CUACTUAL-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform
                   until CUACTUAL-STATUS not = '00'
                   if  READ-1 = 'Y'
                       perform CUACTUAL-READ
                   end-if
               end-perform
           end-if
           if  CUEXPECT-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform
                   until CUEXPECT-STATUS not = '00'
                   if  READ-2 = 'Y'
                       perform CUEXPECT-READ
                   end-if
               end-perform
           end-if
           perform CUEXPECT-CLOSE
           perform CUACTUAL-CLOSE

           move 'Conclude' to INFO-ID
           move INFO-SHORT to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move 'Finished' to INFO-ID

           move CUACTUAL-TOTAL to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA

           move CUEXPECT-TOTAL to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA

           if  CUACTUAL-RDR not = CUEXPECT-RDR
               move 'WARNING!  - Record counts are not equal'
                 to SIMOLOGS-MESSAGE
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
               move 'ABENDING' to INFO-ID
           end-if

           if  FF-01 = '1'
               if  COMPARE-NE > 0
                   move 'ABENDING' to INFO-ID
                   move 'NOT' to COMPARE-TAG(1:3)
               end-if
               move COMPARE-NE-TOTAL to SIMOLOGS-MESSAGE
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if

           if  FF-02 = '1'
               if  COMPACT-NE > 0
                   move 'ABENDING' to INFO-ID
                   move 'NOT' to COMPACT-TAG(1:3)
               end-if
               move COMPACT-NE-TOTAL to SIMOLOGS-MESSAGE
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if

           if  CUACTUAL-EOF not = 'Y'
           or  CUEXPECT-EOF not = 'Y'
               move 'ABENDING' to INFO-ID
           end-if
           move INFO-STATEMENT to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA

           move INFO-SHORT to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           perform Z-THANK-YOU.

           if  COMPARE-NE > 0
           or  CUACTUAL-RDR not = CUEXPECT-RDR
               add 4 to ZERO giving RETURN-CODE
           end-if
           exit.

      *****************************************************************
       JOB-STARTING.
           perform Z-POST-COPYRIGHT
           perform Z-DETERMINE-ENVIRONMENT
           perform CUACTUAL-OPEN
           perform CUEXPECT-OPEN
           move 'Y' to READ-1
           move 'Y' to READ-2
           if  DELTA-MAXIMUM not numeric
               add 100 to ZERO giving DELTA-MAXIMUM
           end-if
           if  PS-1 > 0
           and PS-2 > 0
           and LN-1 > 0
           and LN-2 > 0
               move 'Y' to KEY-ACTIVE
               move 'Key control is ENABLED...'
                 to MESSAGE-TEXT
           else
               move 'N' to KEY-ACTIVE
               move 'Key control is NOT enabled...'
                 to MESSAGE-TEXT
           end-if
           perform Z-DISPLAY-MESSAGE-TEXT

           move 'DUMP' to PASSHEX4-REQUEST
           add 128 to ZERO giving PASSHEX4-LENGTH
           move SYSLOG-OUTPUT to SIMOLOGS-REQUEST
           move SPACES       to SIMOLOGS-MESSAGE
           move all '*' to SIMOLOGS-MESSAGE(1:80)
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move INFO-STATEMENT to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move all '*' to SIMOLOGS-MESSAGE(1:80)
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move SIM-TITLE to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move SIM-COPYRIGHT to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           exit.

      *****************************************************************
      * I/O Routines for the Primary File...                          *
      *****************************************************************
       CUACTUAL-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close CUACTUAL-FILE
           if  CUACTUAL-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with CUACTUAL' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUACTUAL-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       CUACTUAL-READ.
           read CUACTUAL-FILE
           if  CUACTUAL-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               add 1 to CUACTUAL-RDR
           else
               if  CUACTUAL-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if
           if  APPL-AOK
               CONTINUE
           else
               if  APPL-EOF
                   move 'Y' to CUACTUAL-EOF
               else
                   move 'READ Failure with CUACTUAL' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move CUACTUAL-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       CUACTUAL-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input CUACTUAL-FILE
           if  CUACTUAL-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to CUACTUAL-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with CUACTUAL' to MESSAGE-TEXT
               perform Z-DISPLAY-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUACTUAL-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the Secondary File...                        *
      *****************************************************************
       CUEXPECT-READ.
           read CUEXPECT-FILE
           if  CUEXPECT-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               add 1 to CUEXPECT-RDR
           else
               if  CUEXPECT-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if.
           if  APPL-AOK
               CONTINUE
           else
               if  APPL-EOF
                   move 'Y' to CUEXPECT-EOF
               else
                   move 'READ Failure with CUEXPECT' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move CUEXPECT-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       CUEXPECT-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input CUEXPECT-FILE
           if  CUEXPECT-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to CUEXPECT-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with CUEXPECT' to MESSAGE-TEXT
               perform Z-DISPLAY-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUEXPECT-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       CUEXPECT-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close CUEXPECT-FILE
           if  CUEXPECT-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to CUEXPECT-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with CUEXPECT' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUEXPECT-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * The following Z-ROUTINES provide administrative functions     *
      * for this program.                                             *
      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-DETERMINE-ENVIRONMENT.
           add 16833 to ASC-OR-EBC
           if  ASC-A = 'A'
               move 'Compiled for an ASCII environment...'
                 to MESSAGE-TEXT
           else
               if  EBC-A = 'A'
                   move 'Compiled for an EBCDIC environment...'
                     to MESSAGE-TEXT
               else
                   move 'Compiled for an UNKNOWN environment...'
                     to MESSAGE-TEXT
               end-if
           end-if
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display to SYSOUT Device...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79)
           else
               display MESSAGE-BUFFER
           end-if
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-TO-CONSOLE.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79) upon console
           else
               display MESSAGE-BUFFER upon console
           end-if
           exit.

      *****************************************************************
      * Display the file status bytes. This routine will display as   *
      * four digits. If the full two byte file status is numeric it   *
      * will display as 00nn. If the 1st byte is a numeric nine (9)   *
      * the second byte will be treated as a binary number and will   *
      * display as 9nnn.                                              *
      *****************************************************************
       Z-DISPLAY-IO-STATUS.
           if  IO-STATUS not NUMERIC
           or  IO-STAT1 = '9'
               move IO-STAT1 to IO-STATUS-04(1:1)
               subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY
               move IO-STAT2 to TWO-BYTES-RIGHT
               add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
           else
               move '0000' to IO-STATUS-04
               move IO-STATUS to IO-STATUS-04(3:2)
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           move SIM-TITLE to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           move SIM-COPYRIGHT to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           move SIM-THANKS-01 to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           move SIM-THANKS-02 to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2012-07-09  Generation Time: 11:25:43:56    *
      *****************************************************************

Table of Contents Previous Section Next Section Summary

This document contains the COBOL source code that does a partial record-by-record comparison of two VSAM key-sequenced-Data-Sets (KSDS's). The positions within the record to be compared are determined at the time the program is compiled. This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives.

The documentation and software were developed and tested on systems that are configured for a SimoTime environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SimoTime Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SimoTime Services or Technologies please send an e-mail to: helpdesk@simotime.com or call 415 883-6565. We appreciate hearing from you.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Enterprises. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Enterprises.

SimoTime Enterprises makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Enterprises shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note:  A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore How to Generate a Data File Compare, Validate or Hex-Dump Program using simple specification statements in a Process Control File (PCF). This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do a data file compare, accumulate summary totals with a record count or produce a Hex-Dump of records in a VSAM, KSDS based on a list of user-defined keys. The User Guide contains a list of the PCF statements that are used for the data file compare, validate or dump process.

Link to Internet   Link to Server   Explore How to Generate a Data File Convert Program using simple specification statements in a Process Control File (PCF). This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do the actual data file conversion. The User Guide contains a list of the PCF statements that are used for the data file convert process.

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

A good place to start is The SimoTime Home Page via Internet Connect for access to white papers, program examples and product information.

Explore The Micro Focus Web Site via Internet Connect for more information about products and services available from Micro Focus.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Comments or Feedback

This document was created and is copyrighted and maintained by SimoTime Technologies.

If you have any questions, suggestions, comments or feedback please call or send an e-mail to: helpdesk@simotime.com

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

Founded in 1987, SimoTime Technologies is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
Data File Compare, Partial Records with Predetermined Positions
Copyright © 1987-2016
SimoTime Technologies
All Rights Reserved
When technology complements business
http://www.simotime.com