Compare SYSOUT Files
Line Sequential or ASCII/Text Files
  Table of Contents  v-15.07.28 - cpsout01.htm 
  Introduction
  Primary Functions
  CMD Files for Data File Comparison
  Equal Compare Results
  NOT Equal Compare Results
  COBOL Program, Data File Compare
  Secondary Functions
  Generate a File Compare Program
  The Process Control File, an Example
  Ancillary Functionality
  Set the Environment
  Display and Log Messages
  Create Test Files
  Create Test Files using a Windows CMD File
  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

The 1st section (Primary Functions) of this document will focus on doing an actual compare of two line sequential (or ASCII/Text) files. The 2nd section (Secondary Functions) will focus on the preparation tasks required prior to doing file compare. The 3rd section (Ancillary Functions) will describe some of the supporting tasks (such as creating test files) that are required.

This example will use the Windows ECHO command to create three line sequential files. The files will be used to demonstrate the capabilities of the data file compare processes. The first two files contain the same record content and produce an equal compare result. The third file has a record with different content and the compare process will identify the difference.

This example includes Windows CMD Files and a COBOL program. In the world of programming there are many ways to solve a problem. This suite of programs is provided as one of the many possible solutions for comparing data files. The files used in this suite of sample programs use Line Sequential files with variable length record and a maximum record length of 4,096 bytes. The positions within the records to be compared are defined at execution time. When the files are compared and if a difference is found the COBOL compare program will call SIMOHEX4.CBL and SIMOLOGS.CBL. These programs and their associated copy files are part of the SIMOLIBR package. Refer to the Downloads and Links section of this document for additional information.

Many companies are looking for ways to compare data files using a mainframe system and a distributed system (i.e. Linux, UNIX and/or Windows or "LUW") running Micro Focus sub-systems. This utility program (UTCOMPRT) is intended to assist in these efforts. The UTCOMPRT program runs in the Windows environment and generates comparison programs (COBOL Source Code) that may be compiled and executed on a distributed LUW platform 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-2018
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Primary Functions

This section will focus on the items (process and procedures) that do the actual data file comparison. A second group of items will be used to generate the comparison program and prepare the environment for the compare tasks. These secondary command files and programs will be described in the Secondary Functions section of this document.

Table of Contents Previous Section Next Section CMD Files for Data File Comparison

This section will focus on two CMD Files that execute a simple file compare process. The first CMD File will compare to files that are identical.. The second CMD File will compare two files that have a difference embedded within the files. The Data File Compare programs will find the difference and produce a NOT-Equal result.

Table of Contents Previous Section Next Section Equal Compare Results

This CMD File (CPLS4KW1.cmd) will compare two sequential files that are identical. The job execution will result in a zero return code and display the record counts to the SYSOUT device.

@echo OFF
rem  * *******************************************************************
rem  *               CPLS4KW1.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2018 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two line sequential files
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This set of programs will run on a mainframe under MVS or on a
rem  * Personal Computer with Windows and Micro Focus Net Express.
rem  *
rem  *                     ************
rem  *                     * CPLS4KW1 *
rem  *                     ********cmd*
rem  *                          *
rem  *                          *
rem  *    ************     ************     ************
rem  *    *  SYSUT1  *-----* CPLS4KC1 *-----*  SYSLOG  *
rem  *    *******lseq*  *  ********cbl*     ************
rem  *                  *       *
rem  *    ************  *       *
rem  *    *  SYSUT2  *--*       *
rem  *    *******lseq*          *
rem  *                  *       *
rem  *    ************  *       *
rem  *    *  SYSUT3  *--*       *
rem  *    *******lseq*          *
rem  *                          *
rem  *                     ************
rem  *                     *   EOJ    *
rem  *                     ************
rem  *
rem  * *******************************************************************
rem  * Step   1   Delete any previously created file...
rem  *
     set CmdName=CPLS4KW1
     call ..\Env1BASE %CmdName%
     set JobStatus=0000
     set SYSLOG=%BaseLib1%\LOGS\CPLS4K01_SYSLOG.DAT
     call SYSLOGW9
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
:PrepareQSAM
     call SimoNOTE "StepInfo Prepare the File Name Mapping"
     set SYSUT1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS4KD1.TXT
     set SYSUT2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS4KD2.TXT
     set SYSUT3=%BaseLib1%\PARMLIB\CPLS4KT1.CTL
rem  *
     echo 0000000010>%SYSUT1%
     echo 0000000030>>%SYSUT1%
     echo 0000000050>>%SYSUT1%
     echo 0000000070>>%SYSUT1%
     echo 0000000090>>%SYSUT1%
     echo 0000000100>>%SYSUT1%
     echo 0000000110>>%SYSUT1%
     echo 0000000130>>%SYSUT1%
     echo 0000000150>>%SYSUT1%
     echo 0000000170>>%SYSUT1%
     echo 0000000190>>%SYSUT1%
rem  *
     echo 0000000020>%SYSUT2%
     echo 0000000040>>%SYSUT2%
     echo 0000000050>>%SYSUT2%
rem  *
     call SIMONOTE "SYSLOG is %SYSLOG% "
rem  *
rem  * *******************************************************************
rem  * Step   2   Compare the two files...
rem  *
:ExecuteCompareRoutine
     call SimoNOTE "StepInfo Execute the Compare Program"
     run CPLS4KC1
     set ERRORLEVELTWO=%ERRORLEVEL%
     if not "%ERRORLEVELTWO%" == "0" set JobStatus=0010
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "Compare-One is %SYSUT1%"
     call SimoNOTE "Compare-Two is %SYSUT2%"
rem  *
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
rem  * Convert VREC to LSEQ and display using NotePad...
     if "SIMOGENS" == "BATCH" goto End2
     if %JobStatus% == 0004 call VRECCVW1
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     pause
:End2
     exit /b

Table of Contents Previous Section Next Section NOT Equal Compare Results

This CMD File (CPLS4KW2.cmd) will compare two sequential files that have a difference embedded within the files. The Data File Compare programs will find the difference and produce a NOT-Equal or non-Zero result. The record counts and the difference will be displayed to the SYSOUT device.

@echo OFF
rem  * *******************************************************************
rem  *               CPLS4KW2.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2018 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two line sequential files
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This set of programs will run on a mainframe under MVS or on a
rem  * Personal Computer with Windows and Micro Focus Net Express.
rem  *
rem  *                     ************
rem  *                     * CPLS4KW2 *
rem  *                     ********cmd*
rem  *                          *
rem  *                          *
rem  *    ************     ************     ************
rem  *    *  SYSUT1  *-----* CPLS4KC1 *-----*  SYSLOG  *
rem  *    *******lseq*  *  ********cbl*     ************
rem  *                  *       *
rem  *    ************  *       *
rem  *    *  SYSUT2  *--*       *
rem  *    *******lseq*          *
rem  *                  *       *
rem  *    ************  *       *
rem  *    *  SYSUT3  *--*       *
rem  *    *******lseq*          *
rem  *                          *
rem  *                     ************
rem  *                     *   EOJ    *
rem  *                     ************
rem  *
rem  * *******************************************************************
rem  * Step   1   Delete any previously created file...
rem  *
     set CmdName=CPLS4KW2
     call ..\Env1BASE %CmdName%
     set JobStatus=0000
     set SYSLOG=%BaseLib1%\LOGS\CPLS4K01_SYSLOG.DAT
     call SYSLOGW9
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
:PrepareQSAM
     call SimoNOTE "StepInfo Prepare the File Name Mapping"
     set SYSUT1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS4KD1.TXT
     set SYSUT2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS4KD2.TXT
     set SYSUT3=%BaseLib1%\PARMLIB\CPLS4KT1.CTL
rem  *
     echo 0000000010>%SYSUT1%
     echo 0000000030>>%SYSUT1%
     echo 0000000050>>%SYSUT1%
     echo 0000000070>>%SYSUT1%
     echo 0000000090>>%SYSUT1%
     echo 0000000100>>%SYSUT1%
     echo 0000000110>>%SYSUT1%
     echo 0000000130>>%SYSUT1%
     echo 0000000150>>%SYSUT1%
     echo 0000000170>>%SYSUT1%
     echo 0000000190>>%SYSUT1%
rem  *
     echo 0000000020>%SYSUT2%
     echo 0000000040>>%SYSUT2%
     echo 0000000050>>%SYSUT2%
rem  *
     call SIMONOTE "SYSLOG is %SYSLOG% "
rem  *
rem  * *******************************************************************
rem  * Step   2   Compare the two files...
rem  *
:ExecuteCompareRoutine
     call SimoNOTE "StepInfo Execute the Compare Program"
     run CPLS4KC1
     set ERRORLEVELTWO=%ERRORLEVEL%
     if not "%ERRORLEVELTWO%" == "0" set JobStatus=0010
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "Compare-One is %SYSUT1%"
     call SimoNOTE "Compare-Two is %SYSUT2%"
rem  *
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
rem  * Convert VREC to LSEQ and display using NotePad...
     if "SIMOGENS" == "BATCH" goto End2
     if %JobStatus% == 0004 call SYSLOGW1
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     pause
:End2
     exit /b

Table of Contents Previous Section Next Section COBOL Program, Data File Compare

This File Compare program (CPLS4KC1.cbl) was generated by the SimoTime Utility for Data File Compare. For addition information refer to the Generating a Data File Comparison Program section of this document for additional information.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CPLS4KC1.
       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: 2015-01-17  Generation Time: 20:02:57:27    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   SYSUT1   ASCII/CRLF    FIXED      04096            *
      *                                                               *
      *  SECONDARY SYSUT2   ASCII/CRLF    FIXED      04096            *
      *                                                               *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT SYSUT1-FILE  ASSIGN TO       SYSUT1
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT1-STATUS.
           SELECT SYSUT2-FILE  ASSIGN TO       SYSUT2
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT2-STATUS.
           SELECT SYSUT3-FILE  ASSIGN TO       SYSUT3
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT3-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  SYSUT1-FILE
           DATA RECORD    IS SYSUT1-REC
           .
       01  SYSUT1-REC.
           05  SYSUT1-DATA-01 PIC X(04096).

       FD  SYSUT2-FILE
           DATA RECORD    IS SYSUT2-REC
           .
       01  SYSUT2-REC.
           05  SYSUT2-DATA-01 PIC X(04096).

       FD  SYSUT3-FILE
           DATA RECORD    IS SYSUT3-REC
           .
       01  SYSUT3-REC.
           05  SYSUT3-DATA-01 PIC X(80).

      *****************************************************************
      * This program was created using the SYSCOMP2.TXT file as the   *
      * template for the data file comparison. The positions to be    *
      * compared are determined by reading a control file at          *
      * execution time.                                               *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 13.09.12          *
      *                                                               *
      *        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 '* CPLS4KC1 '.
           05  T2 pic X(34) value 'Compare LSEQ, SYSUT3 and KEYFIELD '.
           05  T3 pic X(10) value ' v15.10.31'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CPLS4KC1 '.
           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 '* CPLS4KC1 '.
           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 '* CPLS4KC1 '.
           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  SYSUT1-STATUS.
           05  SYSUT1-STATUS-L     pic X.
           05  SYSUT1-STATUS-R     pic X.
       01  SYSUT1-EOF              pic X       value 'N'.
       01  SYSUT1-OPEN-FLAG        pic X       value 'C'.

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

       01  SYSUT3-STATUS.
           05  SYSUT3-STATUS-L     pic X.
           05  SYSUT3-STATUS-R     pic X.
       01  SYSUT3-EOF              pic X       value 'N'.
       01  SYSUT3-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 '* CPLS4KC1 '.
           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  KEY-ACTIVE              pic X       value 'Y'.
       01  KEY-CONTROL-1.
           05  K-PS-1              pic 9(5)    value 00001.
           05  K-LN-1              pic 9(5)    value 00010.
       01  KEY-CONTROL-2.
           05  K-PS-2              pic 9(5)    value 00001.
           05  K-LN-2              pic 9(5)    value 00010.

       01  KEYRECID-ACTIVE         pic X       value 'N'.
       01  KEYRECID-CONTROL-1.
           05  E-PS-1              pic 9(5)    value 00000.
           05  E-LN-1              pic 9(5)    value 00000.
       01  KEYRECID-CONTROL-2.
           05  E-PS-2              pic 9(5)    value 00000.
           05  E-LN-2              pic 9(5)    value 00000.

       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'.
           05  DUMP-DET-GRP.
               10  DUMP-DET    pic X       value 'Y'.
               10  DUMP-DET-2  pic XX      value 'EQ'.
           05  DUMP-SUM        pic X       value 'Y'.

       01  FUNCTION-FLAGS.
           05  FF-01       pic X       value '0'.
           05  FF-02       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(9)    value '000500000'.
       01  DELTA-MAXIMUM   redefines DELTA-MAXIMUM-X pic 9(9).
       01  DELTA-PROCESS   pic X(4)    value 'EOF '.

       01  IFNECODE-GROUP.
           05  IFNECODE-VALUE pic 9(4) value 0004.

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

       01  SYSUT1-LRECL    pic 9(5)    value 04096.
       01  SYSUT2-LRECL    pic 9(5)    value 04096.
       01  D-LEN           pic 9(5)    value 128.
       01  D-POS           pic 9(5)    value 1.

       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.
           05  FILLER      pic X(10)   value '....:.....'.
       01  DUMP-W10.
           05  FILLER      pic X(5)    value '....:'.
           05  W10-POS-NO  pic X(5)    value '00000'.
           05  FILLER      pic X(10)   value '....:.....'.

       01  DUMP-HEADER     pic X(1024) value all '.'.
       01  D-P1            pic 9(5)    value 0.
       01  WK-1            pic 9(5)    value 0.
       01  WK-2            pic 9(5)    value 0.

       01  RECORD-HEADER.
           05  RECORD-ID   pic X(8)    value 'SYSUT1'.
           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       value ')'.
           05  REC-CTYPE   pic X(10)   value 'SYSUT3    '.
           05  filler      pic X(2)    value SPACES.
           05  REC-CMODE   pic X(10)   value 'SYSUT3    '.

       01  SYSLOG-OUTPUT   pic X(4)    value 'LOG1'.
       01  SYSUT3-KEYWORD  pic X(10)   value SPACES.

       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   'Compare LSEQ, SYSUT3 and KEYFIELD '.
           05  filler      pic X(33)
               value '          http://www.SimoTime.com'.

       01  UT1-MISSING.
           05  filler      pic X(5)  value 'This '.
           05  filler      pic X(31)
                           value 'record is MISSING from SYSUT1'.
           05  filler      pic X(7)  value ' - the '.
           05  filler      pic X(29)
                           value 'record is PRESENT in SYSUT2'.

       01  UT2-MISSING.
           05  filler      pic X(5)  value 'This '.
           05  filler      pic X(29)
                           value 'record is PRESENT in SYSUT1'.
           05  filler      pic X(7)  value ' - the '.
           05  filler      pic X(31)
                           value 'record is MISSING from SYSUT2'.

       01  SYSUT1-TOTAL.
           05  SYSUT1-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for SYSUT1'.
       01  SYSUT2-TOTAL.
           05  SYSUT2-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for SYSUT2'.
       01  SYSUT3-TOTAL.
           05  SYSUT3-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for SYSUT3  '.
       01  COMPARE-NE-TOTAL.
           05  COMPARE-NE  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  COMPARE-TAG.
               10  filler  pic X(25) value 'NOT Equal count for compa'.
               10  filler  pic X(25) value 're of existing records   '.
       01  COMPACT-NE-TOTAL.
           05  COMPACT-NE  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  COMPACT-TAG.
               10  filler  pic X(25) value 'NOT Equal count for compa'.
               10  filler  pic X(25) value 'ct of existing records   '.
       01  COMPARE-EQ-TOTAL.
           05  COMPARE-EQ  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Number of matching record'.
           05  filler      pic X(25) value ' pairs for Compare Task  '.
       01  COMPACT-EQ-TOTAL.
           05  COMPACT-EQ  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Number of matching record'.
           05  filler      pic X(25) value ' pairs for Compact Task  '.

       01  FORMAT-TYPE     pic X     value 'B'.
       01  WORK-05-X.
           05  WORK-05-N   pic 9(5).

       01  COMPARE-TABLE.
           05  POS-1       pic 9(5)    value 0 occurs 32 times.
           05  LEN-1       pic 9(5)    value 0 occurs 32 times.
           05  POS-2       pic 9(5)    value 0 occurs 32 times.
           05  LEN-2       pic 9(5)    value 0 occurs 32 times.

       01  CX-LIMIT            pic 9(3)    value 32.
       01  CX-1                pic 9(3)    value 0.
       01  CX-ACTIVE           pic 9(3)    value 0.
       01  SYSUT3-STMTS        pic 9(3)    value 0.

       01  PARSE-TABLE.
           05  PT-OSET         pic 9(3)    value 0 occurs 15 times.
           05  PT-SIZE         pic 9(3)    value 0 occurs 15 times.
       01  PT-LIMIT            pic 9(3)    value 15.

       01  PX-1                pic 9(3)    value 0.
       01  PX-2                pic 9(3)    value 0.
       01  PX-MAX-ITEMS        pic 9(3)    value 15.
       01  PX-ACTIVE           pic 9(3)    value 0.
       01  PX-BUFFER-SIZE      pic 9(3)    value 80.
       01  PX-LAST-SIG-BYTE    pic 9(5)    value 0.
       01  B-COUNT             pic 9(3)    value 0.
       01  DISPLAY-MODE        pic X(10)   value 'CONSOLE   '.
       01  SYSLOG-MODE         pic X(10)   value 'DISABLE   '.
       01  SYSLOG-OUTPUT-FLAG  pic X       value 'N'.
       01  FIVE-BYTES          pic X(5)    value SPACES.
       01  LOOP-FLAG           pic X       value 'A'.

       01  COMPARE-MSG-DATA.
           05  FILLER pic X(30) value 'Error, /COMPARE               '.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT1        '.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT1 POS    '.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT1 POS nnn'.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT1 LEN    '.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT1 LEN nnn'.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT2        '.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT2 POS    '.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT2 POS nnn'.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT2 LEN    '.
           05  FILLER pic X(30) value 'Error, /COMPARE SYSUT2 LEN nnn'.
       01  COMPARE-MSG-DATA-R   redefines COMPARE-MSG-DATA.
           05  COMPARE-MSG      pic X(30)  occurs 11 times.

       01  U-CASE      pic X(26) value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
       01  L-CASE      pic X(26) value 'abcdefghijklmnopqrstuvwxyz'.

       COPY PASSHEX4.
       COPY PASSLOGS.
       COPY PAENVARS.

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

           perform
               until COMPARE-STATUS = 'QT'
               or    SYSUT1-STATUS not = '00'
               or    SYSUT2-STATUS not = '00'
               if  READ-1 = 'Y'
                   perform SYSUT1-READ
               end-if
               if  READ-2 = 'Y'
                   perform SYSUT2-READ
               end-if
               if  SYSUT1-STATUS = '00'
               and SYSUT2-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
               else
                   move 'NE' to COMPARE-STATUS
               end-if
               if  COMPARE-STATUS = 'EQ'
                   add 1 to COMPARE-EQ
               end-if
               if  DELTA-PROCESS = 'QUIT'
               and COMPARE-NE > DELTA-MAXIMUM
                   perform JOB-FINISHED
                   move 'ABENDING, Not Equal count exceeds Limit...'
                     to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
               if  DELTA-PROCESS = 'EOF '
               and COMPARE-NE > DELTA-MAXIMUM
                   move 'ABENDING, Not Equal count exceeds Limit...'
                     to MESSAGE-TEXT
                   perform Z-DISPLAY-TO-CONSOLE
                   move 'QT' to COMPARE-STATUS
               end-if
           end-perform

           perform JOB-FINISHED

           GOBACK.

      *****************************************************************
       COMPARE-RECORDS.
      *    Compare using SYSUT3 parameters...
           move 'SYSUT3    ' to REC-CTYPE
           move 'SYSUT3    ' to REC-CMODE
           add 1 to ZERO giving CX-1
           perform until CX-1 > CX-LIMIT
                      or CX-1 > CX-ACTIVE
             if  SYSUT1-REC(POS-1(CX-1):LEN-1(CX-1))
                 not = SYSUT2-REC(POS-2(CX-1):LEN-2(CX-1))
                 move FLAG-NE to COMPARE-STATUS
             end-if
             if  DUMP-DET = 'Y'
             and COMPARE-STATUS = 'NE'
                 add POS-1(CX-1) to ZERO giving D-POS
                 add POS-1(CX-1) to ZERO giving RECORD-POS
                 add LEN-1(CX-1) to ZERO giving D-LEN
                 add LEN-1(CX-1) to ZERO giving PASSHEX4-LENGTH
                 add LEN-1(CX-1) to ZERO giving RECORD-LEN
                 if  DUMP-DET-GRP = 'YNE'
                     if  GROUP-DELIMITER = 'Y'
                         move SPACES  to SIMOLOGS-MESSAGE
                         move all '*' to SIMOLOGS-MESSAGE(1:79)
                         move COMPARE-STATUS
                           to SIMOLOGS-MESSAGE(78:2)
                         call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
                     end-if
                     add POS-2(CX-1) to ZERO giving D-POS
                     add POS-2(CX-1) to ZERO giving RECORD-POS
                     add LEN-2(CX-1) to ZERO giving D-LEN
                     add LEN-2(CX-1) to ZERO giving PASSHEX4-LENGTH
                     add LEN-2(CX-1) to ZERO giving RECORD-LEN
                     perform DUMP-PRIMARY-RECORD
                     perform DUMP-SECONDARY-RECORD
                     perform DUMP-POSITION-DIFFERENCE
                 end-if
             end-if
             if  READ-FLAGS not = 'YY'
                 add CX-LIMIT to 1 giving CX-1
             else
                 add 1 to CX-1
             end-if
           end-perform
           exit.

      *****************************************************************
       COMPARE-KEYS.
           move YES-YES to READ-FLAGS
           if  SYSUT1-REC(K-PS-1:K-LN-1)
            <  SYSUT2-REC(K-PS-2:K-LN-2)
               move N-BYTE to READ-2
               move FLAG-NE to COMPARE-STATUS
               if  COMPARE-NE < DELTA-MAXIMUM
               and DUMP-DET-GRP = 'YNE'
                   perform DUMP-SECONDARY-MISSING
               end-if
           end-if
           if  SYSUT1-REC(K-PS-1:K-LN-1)
            >  SYSUT2-REC(K-PS-2:K-LN-2)
               move N-BYTE to READ-1
               move FLAG-NE to COMPARE-STATUS
               if  COMPARE-NE < DELTA-MAXIMUM
               and DUMP-DET-GRP = 'YNE'
                   perform DUMP-PRIMARY-MISSING
               end-if
           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 10 to ZERO giving POS-NO
           subtract 1 from D-POS giving WK-1
           divide 10 into WK-1 giving WK-1 remainder WK-2
           add 1 to WK-2
           perform varying D-P1 from 1 by 10 until D-P1 > 1020
               move DUMP-H10 to DUMP-W10
               inspect W10-POS-NO replacing leading ZEROES by '.'
               move DUMP-W10(WK-2:10) to DUMP-HEADER(D-P1:10)
               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.
           if  GROUP-DELIMITER = 'Y'
               move SPACES  to SIMOLOGS-MESSAGE
               move all '*' to SIMOLOGS-MESSAGE(1:79)
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if
           move UT1-MISSING to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move SPACES to PASSHEX4-SOURCE
           add SYSUT2-RDR to ZERO giving REC-NUMBER
           add K-PS-1 to ZERO giving RECORD-POS
           add K-LN-1 to ZERO giving RECORD-LEN
           add K-PS-1 to ZERO giving D-POS
           add K-LN-1 to ZERO giving D-LEN
           move 'KEYFIELD..' to RECORD-ID
           move SYSUT2-REC(K-PS-2:K-LN-2) to PASSHEX4-SOURCE
           call 'SIMOHEX4' using PASSHEX4-PASS-AREA
           perform DUMP-TO-LOG
           perform DUMP-POSITION-DIFFERENCE
           if  E-PS-1 > ZERO
           and E-LN-1 > ZERO
           and E-PS-2 > ZERO
           and E-LN-2 > ZERO
               move SPACES to PASSHEX4-SOURCE
               add E-PS-1 to ZERO giving RECORD-POS
               add E-LN-1 to ZERO giving RECORD-LEN
               add E-PS-1 to ZERO giving D-POS
               add E-LN-1 to ZERO giving D-LEN
               move 'KEYRECID..' to RECORD-ID
               move SYSUT2-REC(E-PS-2:E-LN-2) to PASSHEX4-SOURCE
               call 'SIMOHEX4' using PASSHEX4-PASS-AREA
               perform DUMP-TO-LOG
           end-if
           exit.

      *****************************************************************
       DUMP-PRIMARY-RECORD.
           move SPACES to PASSHEX4-SOURCE
           if  READ-1 = 'Y'
           and SYSUT1-EOF = 'N'
               move 'SYSUT1..' to RECORD-ID
               add SYSUT1-RDR to ZERO giving REC-NUMBER
               move SYSUT1-REC(D-POS:D-LEN) to PASSHEX4-SOURCE
               call 'SIMOHEX4' using PASSHEX4-PASS-AREA
               perform DUMP-TO-LOG
           else
               move 'SYSUT1..Record is missing from SYSUT1 file'
                 to SIMOLOGS-MESSAGE
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if
           exit.

      *****************************************************************
       DUMP-SECONDARY-MISSING.
           if  GROUP-DELIMITER = 'Y'
               move SPACES  to SIMOLOGS-MESSAGE
               move all '*' to SIMOLOGS-MESSAGE(1:79)
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if
           move UT2-MISSING to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move SPACES to PASSHEX4-SOURCE
           add SYSUT1-RDR to ZERO giving REC-NUMBER
           add K-PS-2 to ZERO giving RECORD-POS
           add K-LN-2 to ZERO giving RECORD-LEN
           add K-PS-2 to ZERO giving D-POS
           add K-LN-2 to ZERO giving D-LEN
           move 'KEYFIELD..' to RECORD-ID
           move SYSUT1-REC(K-PS-1:K-LN-1) to PASSHEX4-SOURCE
           call 'SIMOHEX4' using PASSHEX4-PASS-AREA
           perform DUMP-TO-LOG
           perform DUMP-POSITION-DIFFERENCE
           if  E-PS-1 > ZERO
           and E-LN-1 > ZERO
           and E-PS-2 > ZERO
           and E-LN-2 > ZERO
               move SPACES to PASSHEX4-SOURCE
               add E-PS-2 to ZERO giving RECORD-POS
               add E-LN-2 to ZERO giving RECORD-LEN
               add E-PS-2 to ZERO giving D-POS
               add E-LN-2 to ZERO giving D-LEN
               move 'KEYRECID..' to RECORD-ID
               move SYSUT1-REC(E-PS-1:E-LN-1) to PASSHEX4-SOURCE
               call 'SIMOHEX4' using PASSHEX4-PASS-AREA
               perform DUMP-TO-LOG
           end-if
           exit.

      *****************************************************************
       DUMP-SECONDARY-RECORD.
           move SPACES to PASSHEX4-SOURCE
           move 'SYSUT2..' to RECORD-ID
           add SYSUT2-RDR to ZERO giving REC-NUMBER
           move SYSUT2-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(CX-1) to ZERO giving PTR-1
               add POS-2(CX-1) to ZERO giving PTR-2
               add 1 to ZERO giving IDX-2
               perform until IDX-2 > 1024
                          or IDX-2 > D-LEN
                   if  SYSUT1-REC(PTR-1:1)
                    =  SYSUT2-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  SYSUT1-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform until SYSUT1-STATUS not = '00'
                 perform SYSUT1-READ
                 add 1 to COMPARE-NE
               end-perform
           end-if
           if  SYSUT2-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform until SYSUT2-STATUS not = '00'
                 perform SYSUT2-READ
                 add 1 to COMPARE-NE
               end-perform
           end-if
           perform SYSUT2-CLOSE
           perform SYSUT1-CLOSE

           if  GROUP-DELIMITER = 'Y'
               move SPACES  to SIMOLOGS-MESSAGE
               move all '*' to SIMOLOGS-MESSAGE(1:79)
               call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           end-if

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

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

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

           if  SYSUT1-RDR not = SYSUT2-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  COMPARE-NE = 0
               inspect COMPARE-TAG
               replacing first ' of existing records '
                            by ' is ZERO             '
           else
               move 'ABENDING' to INFO-ID
           end-if
           move COMPARE-NE-TOTAL to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move COMPARE-EQ-TOTAL to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA

           if  COMPACT-NE = 0
               inspect COMPACT-TAG
               replacing first ' of existing records '
                            by ' is ZERO             '
           else
               move 'ABENDING' to INFO-ID
           end-if
           move COMPACT-NE-TOTAL to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA

           if  SYSUT1-EOF not = 'Y'
           or  SYSUT2-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  SYSUT1-RDR not = SYSUT2-RDR
               add IFNECODE-VALUE to ZERO giving RETURN-CODE
           end-if
           exit.

      *****************************************************************
       JOB-STARTING.
           perform Z-POST-COPYRIGHT
           perform Z-DETERMINE-ENVIRONMENT
           perform JOB-STARTING-GET-CONTROL
           perform SYSUT1-OPEN
           perform SYSUT2-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  K-PS-1 > 0
           and K-PS-2 > 0
           and K-LN-1 > 0
           and K-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 SIM-TITLE to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           move SIM-COPYRIGHT to SIMOLOGS-MESSAGE
           call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
           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
           exit.
      *****************************************************************
       JOB-STARTING-GET-CONTROL.
           perform SYSUT3-OPEN
           perform INITIALIZE-TABLE-CX
           perform until SYSUT3-STATUS not = '00'
             perform SYSUT3-READ
             if  SYSUT3-STATUS = '00'
                 move SYSUT3-REC to MESSAGE-TEXT-1
                 perform Z-DISPLAY-MESSAGE-TEXT
                 if  SYSUT3-REC(1:1) = '/'
                     perform INITIALIZE-TABLE-PX
                     inspect SYSUT3-REC converting L-CASE to U-CASE
                     perform PARSE-BUFFER
                     perform PROCESS-CONTROL-RECORD
                  else
                     if  SYSUT3-REC(1:1) not = '*'
                         move 'Preceding Control statement is invalid'
                           to MESSAGE-TEXT
                         perform Z-ABEND-PROGRAM
                     end-if
                  end-if
             else
                 if  SYSUT3-EOF = 'Y'
                     move 'SYSUT3 - End of File...' to MESSAGE-TEXT
                     perform Z-DISPLAY-MESSAGE-TEXT
                     move 'SYSUT3 - Active Compare Statements = &&&'
                       to MESSAGE-TEXT
                     inspect MESSAGE-TEXT replacing first '&&&'
                                                       by CX-ACTIVE
                     perform Z-DISPLAY-MESSAGE-TEXT
                     move 'SYSUT3 - Active Statement Count is = &&&'
                       to MESSAGE-TEXT
                     inspect MESSAGE-TEXT replacing first '&&&'
                                                       by SYSUT3-STMTS
                     perform Z-DISPLAY-MESSAGE-TEXT
                 end-if
             end-if
           end-perform
           perform SYSUT3-CLOSE
           if  SYSLOG-OUTPUT-FLAG = 'Y'
               if  SYSLOG-MODE = 'ENABLE    '
                   evaluate DISPLAY-MODE
                     when 'CONSOLE   ' move 'OPR2' to SYSLOG-OUTPUT
                     when 'SYSOUT    ' move 'OUT2' to SYSLOG-OUTPUT
                     when other        move 'LOG1' to SYSLOG-OUTPUT
                   end-evaluate
               else
                   evaluate DISPLAY-MODE
                     when 'CONSOLE   ' move 'OPR1' to SYSLOG-OUTPUT
                     when 'SYSOUT    ' move 'OUT1' to SYSLOG-OUTPUT
                   end-evaluate
               end-if
           end-if
           exit.

      *****************************************************************
       INITIALIZE-TABLE-CX.
           add 1 to ZERO giving CX-1
           perform until CX-1 > CX-LIMIT
             move 0 to POS-1(CX-1)
             move 0 to LEN-1(CX-1)
             move 0 to POS-2(CX-1)
             move 0 to LEN-2(CX-1)
             add  1 to CX-1
           end-perform
           move ZERO to RETURN-CODE
           subtract CX-1 from CX-1
           exit.

      *****************************************************************
       INITIALIZE-TABLE-PX.
           add 1 to ZERO giving PX-1
           perform until PX-1 > PT-LIMIT
             move 0 to PT-OSET(PX-1)
             move 0 to PT-SIZE(PX-1)
             add  1 to PX-1
           end-perform
           add 1 to ZERO giving PX-1
           add 1 to ZERO giving PX-2
           exit.

      *****************************************************************
       PARSE-BUFFER.
           if  SYSUT3-REC(PX-1:1) not = SPACE
               add PX-1 to ZERO giving PX-LAST-SIG-BYTE
           end-if

           perform until PX-1 > PX-BUFFER-SIZE
             if  SYSUT3-REC(PX-1:1) = SPACE
                 add 1 to B-COUNT
                 if  B-COUNT = 1
                 and PT-SIZE(PX-2) > 0
                     if  PX-2 < PX-MAX-ITEMS
                         add 1 to PX-2
                         add 1 to PX-MAX-ITEMS
                     else
                         move PX-BUFFER-SIZE to PX-2
                     end-if
                 end-if
             else
                 subtract B-COUNT from B-COUNT
                 add 1 to PT-SIZE(PX-2)
                 if  PT-SIZE(PX-2) = 1
                     move PX-1 to PT-OSET(PX-2)
                 end-if
             end-if
             add 1 to PX-1
           end-perform

           exit.

      *****************************************************************
       PROCESS-CONTROL-RECORD.
           add 1 to ZERO giving PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) < 11
               move SPACES to SYSUT3-KEYWORD
               move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                 to SYSUT3-KEYWORD
               evaluate SYSUT3-KEYWORD
                 when '/COMPARE  '
                      perform PROCESS-CONTROL-RECORD-COMPARE
                 when '/DFORMAT  '
                      perform PROCESS-CONTROL-RECORD-DFORMAT
                 when '/DISPLAY  '
                      add 1 to PX-1
                      move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                        to DISPLAY-MODE
                      move 'Y' to SYSLOG-OUTPUT-FLAG
                      add 1 to SYSUT3-STMTS
                 when '/SYSLOG   '
                      add 1 to PX-1
                      move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                        to SYSLOG-MODE
                      move 'Y' to SYSLOG-OUTPUT-FLAG
                      add 1 to SYSUT3-STMTS
                 when '/SYSOUT   '
                      add 1 to PX-1
                      if  SYSUT3-REC(PT-OSET(PX-1):8) = 'SYSOUT  '
                      or  SYSUT3-REC(PT-OSET(PX-1):8) = 'CONSOLE '
                      or  SYSUT3-REC(PT-OSET(PX-1):8) = 'NONE    '
                          move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                            to DISPLAY-MODE
                            add 1 to SYSUT3-STMTS
                      end-if
                 when other
                      move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                      perform Z-ABEND-PROGRAM
               end-evaluate
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if

           exit.

      *****************************************************************
       PROCESS-CONTROL-RECORD-COMPARE.
           add 1 to CX-1
           add 1 to CX-ACTIVE
           add 2 to ZERO giving PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) = 6
               if  SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                   not = 'SYSUT1'
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) = 3
               if  SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                   not = 'POS'
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) < 6
               move SPACES to WORK-05-X
               move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                    to WORK-05-X
               perform RIGHT-ADJUST-05
               if  WORK-05-X is NUMERIC
                   add WORK-05-N to ZERO giving POS-1(CX-1)
               else
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) = 3
               if  SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                   not = 'LEN'
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) < 6
               move SPACES to WORK-05-X
               move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                    to WORK-05-X
               perform RIGHT-ADJUST-05
               if  WORK-05-X is NUMERIC
                   add WORK-05-N to ZERO giving LEN-1(CX-1)
               else
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if

           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) = 6
               if  SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                   not = 'SYSUT2'
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) = 3
               if  SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                   not = 'POS'
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) < 6
               move SPACES to WORK-05-X
               move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                    to WORK-05-X
               perform RIGHT-ADJUST-05
               if  WORK-05-X is NUMERIC
                   add WORK-05-N to ZERO giving POS-2(CX-1)
               else
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) = 3
               if  SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                   not = 'LEN'
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to PX-1
           if  PT-OSET(PX-1) > ZERO
           and PT-SIZE(PX-1) < 6
               move SPACES to WORK-05-X
               move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                    to WORK-05-X
               perform RIGHT-ADJUST-05
               if  WORK-05-X is NUMERIC
                   add WORK-05-N to ZERO giving LEN-2(CX-1)
               else
                   move COMPARE-MSG(PX-1) to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
            else
               move COMPARE-MSG(PX-1) to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           add 1 to SYSUT3-STMTS
           exit.

      *****************************************************************
       PROCESS-CONTROL-RECORD-DFORMAT.
           add 2 to ZERO giving PX-1
           move 'A' to LOOP-FLAG
           perform until LOOP-FLAG = 'Q'
               if  PX-1 < 5
               and PT-OSET(PX-1) > ZERO
               and PT-SIZE(PX-1) < 6
                   move SPACES to FIVE-BYTES
                   move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
                     to FIVE-BYTES
                   evaluate FIVE-BYTES
                     when 'ASC  ' move 'Y' to DUMP-ASC
                     when 'NOASC' move 'N' to DUMP-ASC
                     when 'EBC  ' move 'Y' to DUMP-EBC
                     when 'NOEBC' move 'N' to DUMP-EBC
                     when 'HEX  ' move 'Y' to DUMP-HEX
                     when 'NOHEX' move 'N' to DUMP-HEX
                   end-evaluate
               else
                   move 'Q' to LOOP-FLAG
               end-if
               add 1 to PX-1
           end-perform
           add 1 to SYSUT3-STMTS
           exit.

      *****************************************************************
       RIGHT-ADJUST-05.
           if  WORK-05-X(5:1) = SPACES
               perform until WORK-05-X(5:1) not = SPACE
                   move WORK-05-X(4:1) to WORK-05-X(5:1)
                   move WORK-05-X(3:1) to WORK-05-X(4:1)
                   move WORK-05-X(2:1) to WORK-05-X(3:1)
                   move WORK-05-X(1:1) to WORK-05-X(2:1)
                   move "0"            to WORK-05-X(1:1)
               end-perform
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the Control File...                          *
      *****************************************************************
       SYSUT3-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT3-FILE
           if  SYSUT3-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 SYSUT3' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT3-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT3-READ.
           read SYSUT3-FILE
           if  SYSUT3-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               add 1 to SYSUT3-RDR
           else
               if  SYSUT3-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 SYSUT3-EOF
               else
                   move 'READ Failure with SYSUT3' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move SYSUT3-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT3-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input SYSUT3-FILE
           if  SYSUT3-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT3-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with SYSUT3' to MESSAGE-TEXT
               perform Z-DISPLAY-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT3-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

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

      *****************************************************************
      * I/O Routines for the Secondary File...                        *
      *****************************************************************
       SYSUT2-READ.
           read SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               add 1 to SYSUT2-RDR
           else
               if  SYSUT2-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 SYSUT2-EOF
               else
                   move 'READ Failure with SYSUT2  ' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move SYSUT2-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with SYSUT2  ' to MESSAGE-TEXT
               perform Z-DISPLAY-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SYSUT2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with SYSUT2  ' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-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: 2015-01-17  Generation Time: 20:02:57:35    *
      *****************************************************************

Table of Contents Previous Section Next Section Secondary Functions

This section will focus on the items (process and programs) that do the generation and compilation of a data file compare programs.

Table of Contents Previous Section Next Section Generate a File Compare Program

The SimoTime Utility Program for Data File Comparison runs on a Windows System with Micro Focus and will generate the COBOL source code for a program that will do a compare of two data files. The generation of the COBOL source code requires a Windows System with Micro Focus Studio or Micro Focus Server, version 6.0 or later. The generated COBOL source code may be compiled and executed on the following systems and will do the actual comparison of the two data files.

IBM Mainframe The Compilation and Execution of the generated COBOL source code is supported. COBOL for OS/390 or later should be used (this provided for Y2K compliance) to compile the generated source code.
Note: the SimoTime Utility program has the capability of generating COBOL Source code that can compare ASCII/Text (or LINE SEQUENTIAL) files. Programs that are generated with Line Sequential dependencies will not compile and execute in the ZOS environment of an IBM Mainframe.
Windows The Generation, Compilation and Execution of the generated COBOL source code is supported. To compile and execute the generated COBOL programs the Micro Focus Studio is recommended. However, Net Express and Mainframe Express may be used. Once a program is compiled with Micro Focus Studio it may be executed using Micro Focus Server.
Linux The Compilation and Execution of the generated COBOL source code is supported. To compile and execute the generated COBOL programs the Micro Focus Server Express is recommended. Once a program is compiled with Micro Focus Server Express it may be executed using Micro Focus Server.
UNIX The Compilation and Execution of the generated COBOL source code is supported.
  Express is recommended. Once a program is compiled with Micro Focus Server Express it may be executed using Micro Focus Server.
  System Possibilities for Generated Data File Comparison Programs

The SimoTime Utility for Data File Compare will provide additional detail about creating a Process Control File and generating the COBOL source code for a data file compare program.

Table of Contents Previous Section Next Section The Process Control File, an Example

The following is the Process Control File (CPLS4K01.pcf) that will define the process and parameters required for generating a COBOL program that will compare two record sequential file (RSEQ) containing 80-byte, fixed length records.

***********************************************************************
*                CPLS4K01.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*             (C) Copyright 1987-2018 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* This is an example of the advanced compare specifications that
* track inserts and/or deletes and determines the record positions to
* be compared at execution time using a control file (SYSUT3).
***********************************************************************
*
* The following group of statements will define the high level
* functions and processes to be performed.
*
&SIMOPREP  call ..\..\ENV1BASE
&USERPREP  call USERCOMP
&FUNCTION  COMPARE
&CONFORM   MF
*
* The following statements will cause an HTML document to be created
* for the record structure defined by a COBOL copy file. For this
* example the statements have been commented.
*
*COPYFILE  CHAR80B1.CPY
*HTMLFILE  cpls80h1.htm
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the file I/O
* functions within the Program to be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Compare LSEQ, SYSUT3 and KEYFIELD
&PROGID    CPLS4KC1
&SYSUT1    org=ASCII/Text recfm=FIXED rlen=4096
&SYSUT2    org=ASCII/Text recfm=FIXED rlen=4096
&SYSUT3    org=ASCII/Text recfm=FIXED rlen=4096
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the compare functions
* within the Program to be generated.
*
&KEYFIELD  SYSUT1 pos  1 len 10 SYSUT2 pos  1 len 10
*COMPARE   SYSUT1 pos  1 len 80 SYSUT2 pos  1 len 80

*
* The following group of statements will define the behavioral
* characteristics and environment variable for the compare functions
* within the Program to be generated.
*
&DELTAMAX  500000 EOF
&IFNECODE  0004
*
&DFORMAT   ASC HEX EBC EQDETAIL
&DISPLAY   NONE
&SYSLOG    ENABLE
*
&END

Table of Contents Previous Section Next Section Ancillary Functionality

This section provides additional detail about the CMD files and programs that are used to support this set of sample programs.

Table of Contents Previous Section Next Section Set the Environment

A Windows command file (ENV1BASE.cmd) is called from other command files to set commonly used environment variables. This provides a single point of definition. The following is a listing of the contents of the command file.

@echo OFF
rem  * *******************************************************************
rem  *               ENV1BASE.cmd - a Windows Command File               *
rem  *        This program is provided by SimoTime Technologies          *
rem  *           (C) Copyright 1987-2018 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Provide a single point to set common environment variables.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * Set the commonly used environment variables. This is used to provide
rem  * a single point for managing the commonly used environment variables.
rem  *
     set SimoLIBR=c:\SimoLIBR
     set BASELIB1=c:\SIMOSAM1\DEVL
     set BASELIB8=c:\SimoSAM8
     set BaseWIP1=c:\SimoSAM1\WIP1
     set DATAZERO=c:\SIMODATA\DEVL\DATA\ZERO
     set BASEAPP=%BaseLib1%
     set BASESYS=%BaseLib1%\SYS1
     set BASECAT=%BaseLib1%\DATA
     set SYSLOG=%BASESYS%\LOGS\SYSLOG_USER.DAT
     set SYSOUT=%BASEAPP%\LOGS\SYSOUT_SIMSAM01.TXT
     set SLZMSG=%BASEAPP%\LOGS\SLZMSG_USER.TXT
     set PostNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT
     set SimoNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT
     call SIMONOTE "* SIMONOTE Job Log File is %SIMONOTE% "
rem  *
     set MQBASE=C:\Program Files\IBM\WebSphere MQ
rem  *
rem  * Set the location for the Apache-Tomcat Server...
     set CATALINA_HOME=C:\APACHETC\apache-tomcat-7.0.52
rem  *
rem  * Set the Environment for the Java Environment...
     set JAVABASE=C:\Program Files (x86)\Java\jdk1.8.0_112
     set JAVASDK="%JAVABASE%\bin"
     set JAVA_HOME=%JAVABASE%
     set JRE_HOME=%JAVABASE%
rem  *
rem  * Set the environment for the Micro Focus technology...
     set MIFOEDEV=C:\Program Files (x86)\Micro Focus\Enterprise Developer
     set MIFOVCBL=C:\Program Files (x86)\Micro Focus\Visual COBOL
     set MIFOESTU=C:\Program Files (x86)\Micro Focus\Studio Enterprise Edition 6.0
     set MIFOEMFE="C:\Program Files (x86)\Micro Focus\Mainframe Express"
rem  *
rem  * Large file support, performance tuning and record locking of the File Handler
     set EXTFH=%BASESYS%\CONFIG\EXTFHBIG.CFG
rem  *
rem  * For IMS Support
     set ES_IMSLIB=%BASEAPP%\IMSLIB
     set ES_ACBLIB=%BASEAPP%\IMSLIB
rem  *
rem  * EZASOKETS Check EZASOKETS Enabled box or set ES_EZASOKET_SUPPORT=YES
     set EZACONFG=BASESYS1\CONFIG\EZACONFG.dat
rem  *
rem  * Resource Allocation and Performance for SORT and non-Relational Data
rem  set MFJSENGINE=SYNCSORT
     set SORTSCHEME=1
     set SORTSPACE=750000000
     set TMP=C:\SORTWORK
rem  *
     set ES_ALLOC_OVERRIDE=%BASESYS%\CONFIG\CATMAPA1.cfg
rem  * For CORE_ON_ERROR function, ABEND Dump
rem  *     set COBCONFIG_=%BASESYS%\CONFIG\diagnose.cfg
rem  *
rem  * Consolidated Trace Facility (CTF)
rem  *     set MFTRACE_CONFIG=%BASESYS%\CONFIG\ctf.cfg
rem  *     set MFTRACE_LOGS=c:\ctflogs
rem  *
rem  * For Job Restart, ABEND Recovery
     set MF_UCC11=Y
     set ES_JES_RESTART=Y
rem  *
rem  * Set environment for MFBSI (Micro Focus Batch Scheduling Interface)
     set ES_EMP_EXIT_1=mfbsiemx
     set MFBSI_DIR=%BASESYS%\LOGS\%JESSERVERNAME%
     set MFBSIEOP_CMD=ENABLE
     set MFBSIEOP_CSV=ENABLE
     set MFBSIEOP_HTM=ENABLE
     set MFBSIEOP_XML=ENABLE
rem  *
rem  * Set Behavior and Trace Flags for GETJOBDD
rem  *   Position=12345678/12345678
     set JDDFLAGS=nnnWnnnn/YYnnnnnn
rem  *
     set MAINFRAME_FLOATING_POINT=true
     set COBIDY=%BASEAPP%\COBIDY
     set COBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;%SimoLIBR%
     set LIBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;%SimoLIBR%
     set TXDIR=%BASESYS%\LOADLIB;%MIFOBASE%
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%
rem  *
rem  * If not already set then set the PATH for Micro Focus Directories
     if "%SIMOPATH%" == "Y" goto JUMPPATH
     if "%MIFOSYS1%" == "EDEV" goto JUMPEDEV
     if "%MIFOSYS1%" == "VCBL" goto JUMPVCBL
     if "%MIFOSYS1%" == "ESTU" goto JUMPESTU
     if "%MIFOSYS1%" == "EMFE" goto JUMPEMFE
:JUMPEDEV
     set path=%BASESYS%\LOADLIB;%MIFOEDEV%\bin;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOEDEV%\CPYLIB
     set MIFOBASE=%MIFOEDEV%
     goto JUMPPATH
:JUMPVCBL
     set path=%MIFOVCBL%\bin;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set MIFOBASE=%MIFOVCBL%
     goto JUMPPATH
:JUMPESTU
     set MIFOBASE=%MIFOESTU%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
:JUMPEMFE
     set MIFOBASE=%MIFOEMFE%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
rem  *
:JUMPPATH
     set SIMOPATH=Y
rem  *
     set USERCLASS=%BASELIB1%\LOADLIB
     set CLASSPATH=.
     set CLASSPATH=%CLASSPATH%;%JAVABASE%
     set CLASSPATH=%CLASSPATH%;%JAVABASE%\lib
     set CLASSPATH=%CLASSPATH%;\%USERCLASS%\simpacks
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes\simpacks
     if "%MIFOSYS1%" == "ESTU" set CLASSPATH=%CLASSPATH%;%MIFOBIN%
     if "%MIFOSYS1%" == "EDEV" set CLASSPATH=%CLASSPATH%;%MIFOEDEV%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%\mfcobol.jar
rem  *
     set JobStatus=0000
     call SimoNOTE "* Settings CmdName ENV1BASE.cmd, Version 14.03.28, %MIFOSYS1%"
     call SimoNOTE "* BaseAPP ..... %BASEAPP%"
rem *      call SimoNOTE "* MFBSIDIR .... %MFBSI_DIR% "
     call SimoNOTE "* MIFOSYS1 is %MIFOSYS1% "
     call SimoNOTE "* MIFOBASE is %MIFOBASE% "
     call SimoNOTE "* SIMOLIBR is %SIMOLIBR% "

Table of Contents Previous Section Next Section Display and Log Messages

The following SIMONOTE.cmd) is a listing of the contents of the SimoNOTE.CMD command file.

@echo OFF
rem  * *******************************************************************
rem  *               SIMONOTE.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *            (C) Copyright 1987-2018 All Rights Reserved            *
rem  *              Web Site URL:   http://www.simotime.com              *
rem  *                    e-mail:   helpdesk@simotime.com                *
rem  * *******************************************************************
rem  *
rem  * Text    - Display message on screen and write to a log file.
rem  * Author  - SimoTime Technologies
rem  *
rem  * This script may be called from other scripts and expects a single
rem  * parameter enclosed in double quotes. The double quotes will be
rem  * removed. Before writing to the log file a date and time stamp
rem  * will be inserted in front of the message text.
rem  *
rem  * Note: The tilde (~) removes leading/trailing double-quotes.
rem  *
if "%SimoNOTE%" == "" set SimoNOTE=c:\SimoLIBR\LOGS\SimoTime.LOG
echo %date% %time% %~1>> %SimoNOTE%
echo %~1

Table of Contents Previous Section Next Section Create Test Files

This example uses three data files to demonstrate the basic functions of the data file compare process. the first two files are sequential files containing three records of identical content. The third file is different from the first two files and is used to shows the results when a NOT-Equal condition occurs.

Table of Contents Previous Section Next Section Create Test Files using a Windows CMD File

This Windows CMD file (CPRS80W8.cmd) will use the Windows ECHO Command to create three ASCII/Text (or Line Sequential) files. The ASCII/Text files will then be converted to sequential files that will be used to test the Data File Compare program that was generated.

@echo OFF
rem  * *******************************************************************
rem  *               CPLS4KW8.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2018 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two line sequential files
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This set of programs will run on a mainframe under MVS or on a
rem  * Personal Computer with Windows and Micro Focus Net Express.
rem  *
rem  * *******************************************************************
rem  * Step   1   Prepare the environment...
rem  *
     set CmdName=CPLS4KW1
     call ..\Env1BASE %CmdName%
     set JobStatus=0000
     set SYSLOG=%BaseLib1%\LOGS\CPLS4K01_SYSLOG.DAT
     call SYSLOGW9
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
:PrepareQSAM
     call SimoNOTE "StepInfo Prepare the File Name Mapping"
     set SYSUT1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS4KD1.TXT
     set SYSUT2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS4KD2.TXT
     set SYSUT3=%BaseLib1%\PARMLIB\CPLS4KT1.CTL
rem  *
     echo 0000000010>%SYSUT1%
     echo 0000000030>>%SYSUT1%
     echo 0000000050>>%SYSUT1%
     echo 0000000070>>%SYSUT1%
     echo 0000000090>>%SYSUT1%
     echo 0000000100>>%SYSUT1%
     echo 0000000110>>%SYSUT1%
     echo 0000000130>>%SYSUT1%
     echo 0000000150>>%SYSUT1%
     echo 0000000170>>%SYSUT1%
     echo 0000000190>>%SYSUT1%
rem  *
     echo 0000000020>%SYSUT2%
     echo 0000000040>>%SYSUT2%
     echo 0000000050>>%SYSUT2%
rem  *
     call SIMONOTE "SYSLOG is %SYSLOG% "
rem  *
rem  * *******************************************************************
rem  * Step   2   Compare the two files...
rem  *
:ExecuteCompareRoutine
     call SimoNOTE "StepInfo Execute the Compare Program"
     run CPLS4KC1
     set ERRORLEVELTWO=%ERRORLEVEL%
     if not "%ERRORLEVELTWO%" == "0" set JobStatus=0010
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "Compare-One is %SYSUT1%"
     call SimoNOTE "Compare-Two is %SYSUT2%"
rem  *
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
rem  * Convert VREC to LSEQ and display using NotePad...
     if "SIMOGENS" == "BATCH" goto End2
     if %JobStatus% == 0004 call VRECCVW1
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     pause
:End2
     exit /b

Table of Contents Previous Section Next Section Summary

The purpose of this document is 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 choice of alternatives.

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 Technologies. 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 Technologies.

SimoTime Technologies 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 Technologies 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 the Principles of Data File Validation. This link includes guidelines for defining requirements and determining the scope of effort for a data validation effort. This effort includes a data file compare process, a technique for accumulating summary totals with a record count and a technique for reading a VSAM, KSDS and producing a hex-dump output based on a list of user-defined keys.

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 a Data File Compare Utility Program that is used to compare the content of two sequential files with 80 byte records. The positions within the record that are to be compared are determined at execution time. When a difference occurs the output may be written to SYSOUT or a log file. The COBOL source code for the program was generated using SimoTime technologies.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

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 for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products and services available from Micro Focus. This link requires an Internet Connection.

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

SIMOTIME Technologies was founded in 1987 and 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. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

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. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SIMOTIME has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions or need assistance with converting non-relational data structures simply give us a call at 415 883-6565 or check the web site at http://www.simotime.com


Return-to-Top
Compare SYSOUT Files
Copyright © 1987-2018
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com