VSAM Data Set, KSDS
Compare All or Selected Positions
  Table of Contents  v-24.01.01 - cuscp101.htm 
  Introduction
  Test Case & Batch Jobs
  Flowchart, Compare via SYSUT3
  Job Scripts
  Job 1, Full Record, Pre-Defined
  Windows CMD File
  Job 2, Multiple Segments, Pre-Defined
  Windows CMD File
  Job 3, Full Record, via SYSUT3
  Windows CMD File
  Compare NE Results
  Job 4, Multiple Segments, via SYSUT3
  Windows CMD File
  Job 5, Multi-Segment, log SIMOL32K
  Windows CMD File
  Compare NE Results
  The COBOL Source Code
  Pre-Defined Record Compare
  Pre-Defined Segment Compare
  Compare via SYSUT3
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

The requirement for this Test Case is to create data file compare programs that will compare two VSAM, KSDS's or Indexed Files. The compare programs have the capability of comparing the full record content or a segment of data within a record. For this test case both the files have 512 byte records with a 12 byte key starting in position 1. The compare programs have been compiled and executed on an IBM Mainframe System using Enterprise COBOL, a Windows System using Micro Focus COBOL and a Linux System using GnuCOBOL.


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-2024
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Test Case & Batch Jobs

This section provides an overview of the batch jobs included in this test case. The jobs will describe and demonstrate various techniques for comparing files on a record by record basis. Techniques for doing a full record compare or comparing segments within a record will be discussed.

Note: A Full Record compare may be described as a single segment compare. The compare specifications would contain a single COMPARE statement. The compare process would start at position is 1. The length of the compare process would be the maximum record length of the file being compared.

Table of Contents Previous Section Next Section Flowchart, Compare via SYSUT3

The following flowchart provides a brief overview of a job that obtains the compare specifications from a SYSUT3 File.

             
Entry Point
Windows
Start the processing to compare the Indexed Files
   
CUSCPW3
cmd
 
 
JOBLOG
simonote
Call SIMONOTE.cmd to post job information
   
CUACTUAL
ksds
   
   
CUSCP1C3
cbl
   
   
SYSOUT
spool
Main Program that does the compare
   
   
   
CUEXCEPT
ksds
   
   
   
   
   
SYSUT4
lseq
   
   
SYSUT3
pdsm
   
   
   
Input for Compare specifications
   
EOJ
End-Of-Job
 
Note: SYSUT3 - Define compare specifications at Execution Time
Note: SYSUT4 - Post information for a NOT Equal condition
 
A Record-by-Record Compare of two Indexed Files

The following shows an example of the contents of a SYSUT3 File.

*...:....1....:....2....:....3....:....4....:....5....:....6
/COMPARE SYSUT1 pos 1 Len 512 SYSUT2 pos 1 Len 512
/SYSLOG SYSUT4
/DFORMAT ASC HEX EBC RPI
/DSTRING 1 512
/DISPLAY NONE

The following flowchart provides a brief overview of a job that obtains the compare specifications from a SYSUT3 File.

Table of Contents Previous Section Next Section Job Scripts

A job script may be defined as a text file containing job setup information followed by job steps that identify programs to be executed along with parameters unique to the job step. A job script may be created using a text editor. The naming of a job script is determined by the Operating System. A simple job script may contain a single job step that performs a single function. A typical job script will contain multiple job steps executed in a predefined sequence. The status of each job step may be tested at the end of each job step.

The following outline provides a brief overview of the individual jobs.

1. CUSCP1W1.cmd - Full Record, Pre-Defined
1.1. This job will execute CUSCP1C1, a generated COBOL Program.
1.1.1. The Compare specifications are contained within the compare program.
1.1.2. The compare results are posted to the SYSUT4 file.
2. CUSCP1W2.cmd - Multiple Segments, Pre-Defined
2.1. This job will execute CUSCP1C2, a generated COBOL Program.
2.1.1. The Compare specifications are contained within the compare program.
2.1.2. The compare results are posted to the SYSUT4 file.
3. CUSCP1W3.cmd - Full Record, via SYSUT3
3.1. This job will execute CUSCP1C3, a generated COBOL Program
3.1.1. The Compare specifications are obtained by reading the SYSUT3 file.
3.1.1.1. The SYSUT3 file is created by a job step within this job script.
3.1.1.2. The SYSUT3 file may be created created once and reused.
3.1.2. The compare results are posted to the SYSUT4 file.
4. CUSCP1W4.cmd - Multiple Segments, via SYSUT3
4.1. This job will execute CUSCP1C3, a generated COBOL Program
4.1.1. The Compare specifications are obtained by reading the SYSUT3 file.
4.1.1.1. The SYSUT3 file is created by a job step within this job script.
4.1.1.2. The SYSUT3 file may be created created once and reused.
4.1.2. The compare results are posted to the SYSUT4 file.

 

Note: The preceding Job Scripts are part of the SimoTime Quality Assurance Testing. The Job Scripts are executed as part of the preparation process for a new release or a maintenance release of the SimoTime Technologies.

Table of Contents Previous Section Next Section Job 1, Full Record, Pre-Defined

The CUSCP1W1 will compare the content of two VSAM, KSDS's or Indexed Files. Both of the files have 512 byte records with a 12 byte key starting in position 1. The positions within each record to be compared are internally pre-defined when the compare program is generated and compiled.

Table of Contents Previous Section Next Section Windows CMD File

This job script (CUSCP1W1.cmd) is a Windows CMD File that does a full record content compare. The compare results will be posted to a line sequential (or ASCII/Text) file.

@echo OFF
     set CmdName=CUSCP1W1
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *       This test case is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2020 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two Customer Master Files.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  *
rem  * The job will execute a program that will do a compare of the full
rem  * records in two Customer Files. Both files (or KSDS) are Indexed
rem  * files with a record length of 512 byte. The key location starts
rem  * in position 1 and the key length is 12 bytes.
rem  *
rem  * Since the files are in sequence by the key-field the program
rem  * will explicity identify deleted or added records.
rem  *
rem  *                    ************     ************
rem  *                    * CUSCP1W1 *-----*  JOBLOG  *
rem  *                    ********cmd*     ************
rem  *                         *
rem  *   ************     ************     ************
rem  *   * CUEXPECT *--*--* CUSCP1C1 *--*--*  SYSOUT  *
rem  *   *******ksds*  *  ********cbl*  *  *******lseq*
rem  *                 *       *        *
rem  *   ************  *       *        *  ************
rem  *   * CUACTUAL *--*       *        *--*  SYSUT4  *
rem  *   *******ksds*          *           *******lseq*
rem  *                         *
rem  *                    ************
rem  *                    *   EOJ    *
rem  *                    ************
rem  *
rem  * *******************************************************************
rem  * Compare two VSAM KSDS's or Customer Master Files...
rem  * The positions within the records to be compared are determined by
rem  * the single COMPARE statement in the Process Control File. This is
rem  * done when the compare program is generated.
rem  *
rem  * The results of the physical compare is posted to the SYSUT4 File.
rem  *
rem  * *******************************************************************
rem  * Step 01 of nn, Prepare the System Environment...
rem  *
     call ..\ENV1BASE %CmdName%
rem  *
     call SimoNOTE "*******************************************************************************%CmdName% "
     call SimoNOTE "* Job_Step 01 of 03, Preparing the System and Job Environment"
     set JobStatus=0
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_%CmdName%.txt
     set CUACTUAL=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSRCSV.CUSTMAST.DAT
     set CUEXPECT=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSLCSV.CUSTMAST.DAT
     set SYSUT4=%BaseLib1%\LOGS\SYSUT4_%CmdName%.txt
rem  *
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 02 of 03, Execute the Compare program"
     call SimoNOTE "* DataTake CUACTUAL=%CUACTUAL% "
     call SimoNOTE "* DataTake CUEXPECT=%CUEXPECT% "
     run CUSCP1C1
     if not "%ERRORLEVEL%" == "0" set JobStatus=10
rem  *
:EOJTAG
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 03 of 03, End of Job processing"
     if "%JobStatus%" == "0" goto :EOJAOK
:EOJNOK
     call SimoNOTE "* SYSUT4 is %SYSUT4%"
     call SimoNOTE "* ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJAOK
     call SimoNOTE "* SYSUT4 is %SYSUT4%"
     call SimoNOTE "* Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJEND
     call SimoNOTE "* Conclude SYSOUT is  %SYSOUT% "
     if not "SIMOGENS" == "BATCH" pause

Table of Contents Previous Section Next Section Job 2, Multiple Segments, Pre-Defined

The CUSCP1W2 will compare the content of two VSAM, KSDS's or Indexed Files. Both of the files have 512 byte records with a 12 byte key starting in position 1. The positions within each record to be compared are internally pre-defined when the compare program is generated and compiled.

Table of Contents Previous Section Next Section Windows CMD File

This job script (CUSCP1W2.cmd) is a Windows CMD File that does a full record content compare. The compare results will be posted to a line sequential (or ASCII/Text) file.

@echo OFF
     set CmdName=CUSCP1W2
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *       This test case is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two Customer Master Files.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This job will execute a program that will do a compare of multiple
rem  * record segments within two Customer Files. Both files (or KSDS)
rem  * are Indexed files with a record length of 512 byte. The key
rem  * location starts in position 1 and the key length is 12 bytes.
rem  *
rem  * Since the files are in sequence by the key-field the program
rem  * will explicity identify deleted or added records.
rem  *
rem  *                    ************     ************
rem  *                    * CUSCP1W2 *-----*  JOBLOG  *
rem  *                    ********cmd*     ************
rem  *                         *
rem  *   ************     ************     ************
rem  *   * CUEXPECT *--*--* CUSCP1C2 *--*--*  SYSOUT  *
rem  *   *******ksds*  *  ********cbl*  *  *******lseq*
rem  *                 *       *        *
rem  *   ************  *       *        *  ************
rem  *   * CUACTUAL *--*       *        *--*  SYSUT4  *
rem  *   *******ksds*          *           *******lseq*
rem  *                         *
rem  *                    ************
rem  *                    *   EOJ    *
rem  *                    ************
rem  *
rem  * *******************************************************************
rem  * Compare two VSAM KSDS's or Customer Master Files...
rem  * The positions within the records to be compared are determined by
rem  * multiple COMPARE statements in the Process Control File. This is
rem  * done when the compare program is generated.
rem  *
rem  * The results of the physical compare is posted to the SYSUT4 File.
rem  *
rem  * *******************************************************************
rem  * Step 01 of nn, Prepare the System Environment...
rem  *
     call ..\ENV1BASE %CmdName%
rem  *
     call SimoNOTE "*******************************************************************************%CmdName% "
     call SimoNOTE "* Job_Step 01 of 03, Preparing the System and Job Environment"
     set JobStatus=0
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_%CmdName%.txt
     set CUACTUAL=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSRCSV.CUSTMAST.DAT
     set CUEXPECT=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSLCSV.CUSTMAST.DAT
     set SYSUT4=%BaseLib1%\LOGS\SYSUT4_%CmdName%.txt
rem  *
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 02 of 03, Execute the Compare program"
     call SimoNOTE "* DataTake CUACTUAL=%CUACTUAL% "
     call SimoNOTE "* DataTake CUEXPECT=%CUEXPECT% "
     run CUSCP1C2
     if not "%ERRORLEVEL%" == "0" set JobStatus=10
rem  *
:EOJTAG
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 03 of 03, End of Job processing"
     if "%JobStatus%" == "0" goto :EOJAOK
:EOJNOK
     call SimoNOTE "* SYSUT4 is %SYSUT4%"
     call SimoNOTE "* ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJAOK
     call SimoNOTE "* SYSUT4 is %SYSUT4%"
     call SimoNOTE "* Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJEND
     call SimoNOTE "* Conclude SYSOUT is  %SYSOUT% "
     if not "SIMOGENS" == "BATCH" pause

Table of Contents Previous Section Next Section Job 3, Full Record, via SYSUT3

The CUSCP1W3 will compare the content of two VSAM, KSDS's or Indexed Files. Both of the files have 512 byte records with a 12 byte key starting in position 1. The positions within each record to be compared are externally defined via SYSUT3 when the compare program is executed.

Table of Contents Previous Section Next Section Windows CMD File

This job script (CUSCP1W3.cmd) is a Windows CMD File that does a full record content compare. The compare results will be posted to a line sequential (or ASCII/Text) file.

@echo OFF
     set CmdName=CUSCP1W3
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *       This test case is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two Customer Master Files.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * The job will execute a program that will do a compare of the full
rem  * records in two Customer Files. Both files (or KSDS) are Indexed
rem  * files with a record length of 512 byte. The key location starts
rem  * in position 1 and the key length is 12 bytes.
rem  *
rem  * Since the files are in sequence by the key-field the program
rem  * will explicity identify deleted or added records.
rem  *
rem  *                    ************     ************
rem  *                    * CUSCP1W3 *-----*  JOBLOG  *
rem  *                    ********cmd*     *******lseq*
rem  *                         *
rem  *   ************     ************     ************
rem  *   * INSTREAM *--*--* STEP_002 *-----*  SYSUT3  *
rem  *   ********cmd*  *  ********cmd*     *******lseq*
rem  *                         *
rem  *   ************     ************     ************
rem  *   * CUEXPECT *--*--* CUSCP1C3 *--*--*  SYSOUT  *
rem  *   *******ksds*  *  ********cbl*  *  *******lseq*
rem  *                 *       *        *
rem  *   ************  *       *        *  ************
rem  *   * CUACTUAL *--*       *        *--*  SYSUT4  *
rem  *   *******ksds*  *       *           *******lseq*
rem  *                 *       *
rem  *   ************  *       *
rem  *   *  SYSUT3  *--*       *
rem  *   *******lseq*          *
rem  *                         *
rem  *                    ************
rem  *                    *   EOJ    *
rem  *                    ************
rem  *
rem  * *******************************************************************
rem  * Compare two VSAM KSDS's or Customer Master Files...
rem  * The positions within the records to be compared are determined via
rem  * the SYSUT3 File. This is done when the compare program is executed.
rem  *
rem  * The results of the compare process are posted to the SYSUT4 File.
rem  *
rem  * *******************************************************************
rem  * Step 01 of 04, Prepare the System Environment...
rem  *
     call ..\ENV1BASE %CmdName%
rem  *
     call SimoNOTE "*******************************************************************************%CmdName% "
     call SimoNOTE "* Job_Step 01 of 04, Preparing the System and Job Environment"
     set JobStatus=0
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_%CmdName%.txt
     set CUACTUAL=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSRCSV.CUSTMAST.DAT
     set CUEXPECT=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSLCSV.CUSTMAST.DAT
     set SYSUT3=%BaseLib1%\PARMLIB\CUSCP1D3.ctl
     set SYSUT4=%BaseLib1%\LOGS\SYSUT4_%CmdName%.txt
rem  *
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 02 of 04, Create a Specifications File"
     echo * *******************************************************************>%SYSUT3%
     echo *     CUSCP1D3.ctl - Program Behavior Statements for Compare        *>>%SYSUT3%
     echo *    Processed at Execution Time by Generated Compare Program       *>>%SYSUT3%
     echo *         This Member is provided by SimoTime Technologies          *>>%SYSUT3%
     echo *           (C) Copyright 1987-2019 All Rights Reserved             *>>%SYSUT3%
     echo *             Web Site URL:   http://www.simotime.com               *>>%SYSUT3%
     echo *                   e-mail:   helpdesk@simotime.com                 *>>%SYSUT3%
     echo * *******************************************************************>>%SYSUT3%
     echo *...:....1....:....2....:....3....:....4....:....5....:....6>>%SYSUT3%
     echo /COMPARE   SYSUT1 pos  1 len 512 SYSUT2 pos  1 len 512>>%SYSUT3%
     echo /DFORMAT   ASC HEX EBC RPI>>%SYSUT3%
     echo /DSTRING   1 512>>%SYSUT3%
     echo /SYSLOG    SYSUT4>>%SYSUT3%
     echo /DISPLAY   NONE>>%SYSUT3%
rem  *
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 03 of 04, Execute a Full Record Compare"
     call SimoNOTE "* DataTake CUACTUAL=%CUACTUAL% "
     call SimoNOTE "* DataTake CUEXPECT=%CUEXPECT% "
     run CUSCP1C3
     if not "%ERRORLEVEL%" == "0" set JobStatus=10
rem  *
:EOJTAG
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 04 of 04, End of Job processing, %JobStatus% "
     if "%JobStatus%" == "0" goto :EOJAOK
:EOJNOK
     call SimoNOTE "* SYSOUT is %SYSOUT% "
     call SimoNOTE "* ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJAOK
     call SimoNOTE "* SYSOUT is %SYS% "
     call SimoNOTE "* Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJEND
     call SimoNOTE "* Conclude SYSOUT is  %SYSOUT% "
     if not "SIMOGENS" == "BATCH" pause

Table of Contents Previous Section Next Section Compare NE Results

The following is an example of the output when a NOT Equal condition occurs during the compare processing.

*******************************************************************************
* CUSCP1C3 Compare Input=SYSUT3 Output=SYSUT4 v19.00.00   helpdesk@simotime.com
* CUSCP1C3 This Data File Compare Member was generated by SimoTime Technologies
*******************************************************************************
* Starting  - Compare Input=SYSUT3 Output=SYSUT4        http://www.SimoTime.com
* Compare  CUACTUAL POS=00001 LEN=00512 CUEXPECT POS=00001 LEN=00512
*****************************************************************************NE
....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:...90....:..100....:..110....:..120....:..130....:..140....:..150....:..160....:..170....:..180....:..190....:..200....:..210....:..220....:..230....:..240....:..250....:..260....:..270....:..280....:..290....:..300....:..310....:..320....:..330....:..340....:..350....:..360....:..370....:..380....:..390....:..400....:..410....:..420....:..430....:..440....:..450....:..460....:..470....:..480....:..490....:..500....:..510..
CUACTUAL..000000010(00001:00512) SYSUT3      SYSUT3
000000000010 Taylor                      Elizabeth                               8 Hayes Street                                                                                  Angeles                     PR                          00611                                                             ......00000        ..00000        ..00000        2018021314392055000
33333333333325676672222222222222222222222466766676222222222222222222222222222222232467672577667222222222222222222222222222222222222222222222222222222222222222222222222222222222246666672222222222222222222225522222222222222222222222222333332222222222222222222222222222222222222222222222222222222222222000000333332222222200333332222222200333332222222233333333333333333332222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
0000000000100419CF200000000000000000000005C9A1254800000000000000000000000000000008081953034255400000000000000000000000000000000000000000000000000000000000000000000000000000000001E75C530000000000000000000000200000000000000000000000000006110000000000000000000000000000000000000000000000000000000000000000F00000000000000000000000000000000000000000000020180213143920550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
............../`%?........................%.:/....................................../`............................................................................................>..%.......................&..................................................................................................................................................................................................................................................................................................................
=============================================================================================================================================================================================================================================================================================================#=###########=========================================#=#=##=##====================================================================================================================================================
CUEXPECT..000000010(00001:00512) SYSUT3      SYSUT3
000000000010 Taylor                      Elizabeth                               8 Hayes Street                                                                                  Angeles                     PR                          00611                                                             ..%..M22333LIZA    ..00000        ..00000        2018021412303000000
33333333333325676672222222222222222222222466766676222222222222222222222222222222232467672577667222222222222222222222222222222222222222222222222222222222222222222222222222222222246666672222222222222222222225522222222222222222222222222333332222222222222222222222222222222222222222222222222222222222222002004333334454222200333332222222200333332222222233333333333333333332222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
0000000000100419CF200000000000000000000005C9A1254800000000000000000000000000000008081953034255400000000000000000000000000000000000000000000000000000000000000000000000000000000001E75C530000000000000000000000200000000000000000000000000006110000000000000000000000000000000000000000000000000000000000000005F1D22333C9A1000000000000000000000000000000000020180214123030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
............../`%?........................%.:/....................................../`............................................................................................>..%.......................&..................................................................................................(.....<.!.......................................................................................................................................................................................................
=============================================================================================================================================================================================================================================================================================================#=###########=========================================#=#=##=##====================================================================================================================================================
*****************************************************************************NE
....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:...90....:..100....:..110....:..120....:..130....:..140....:..150....:..160....:..170....:..180....:..190....:..200....:..210....:..220....:..230....:..240....:..250....:..260....:..270....:..280....:..290....:..300....:..310....:..320....:..330....:..340....:..350....:..360....:..370....:..380....:..390....:..400....:..410....:..420....:..430....:..440....:..450....:..460....:..470....:..480....:..490....:..500....:..510..
CUACTUAL..000000013(00001:00512) SYSUT3      SYSUT3
000000000013 Jackson                     Richard                                 1429 Buchanan Street                                                                            Arecibo                     PR                          00614                                                             ......00000        ..00000        ..00000        2018021314392055000
33333333333324666766222222222222222222222566667622222222222222222222222222222222233332476666662577667222222222222222222222222222222222222222222222222222222222222222222222222222247666662222222222222222222225522222222222222222222222222333332222222222222222222222222222222222222222222222222222222222222000000333332222222200333332222222200333332222222233333333333333333332222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
0000000000130A13B3FE00000000000000000000029381240000000000000000000000000000000001429025381E1E03425540000000000000000000000000000000000000000000000000000000000000000000000000000125392F0000000000000000000000200000000000000000000000000006140000000000000000000000000000000000000000000000000000000000000000F00000000000000000000000000000000000000000000020180213143920550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
............../.,.?>........................./............................................/>/>.........................................................................................?.....................&..................................................................................................................................................................................................................................................................................................................
===================================================================================================================================================================================================================================================================================================================================================================#=#=#####====================================================================================================================================================
CUEXPECT..000000013(00001:00512) SYSUT3      SYSUT3
000000000013 Jackson                     Richard                                 1429 Buchanan Street                                                                            Arecibo                     PR                          00614                                                             ......00000        ..00000        ..00000        2018021412304500000
33333333333324666766222222222222222222222566667622222222222222222222222222222222233332476666662577667222222222222222222222222222222222222222222222222222222222222222222222222222247666662222222222222222222225522222222222222222222222222333332222222222222222222222222222222222222222222222222222222222222000000333332222222200333332222222200333332222222233333333333333333332222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
0000000000130A13B3FE00000000000000000000029381240000000000000000000000000000000001429025381E1E03425540000000000000000000000000000000000000000000000000000000000000000000000000000125392F0000000000000000000000200000000000000000000000000006140000000000000000000000000000000000000000000000000000000000000000F00000000000000000000000000000000000000000000020180214123045000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
............../.,.?>........................./............................................/>/>.........................................................................................?.....................&..................................................................................................................................................................................................................................................................................................................
===================================================================================================================================================================================================================================================================================================================================================================#=#=#####====================================================================================================================================================
*******************************************************************************
* Conclude  - Compare Input=SYSUT3 Output=SYSUT4
* 000025000 - Record count for CUACTUAL
* 000025000 - Record count for CUEXPECT
* 000000002 - NOT Equal count for compare of existing records
* 000024998 - Number of matching record pairs for Compare Task
* ABENDING  - Compare Input=SYSUT3 Output=SYSUT4        http://www.SimoTime.com

The preceding results show a NOT Equal condition occurred when comparing records 10 and 13.

Note: The compare results will be posted to the user-defined device associated with SYSUT4

Table of Contents Previous Section Next Section Job 4, Multiple Segments, via SYSUT3

The CUSCP1W4 will compare the content of two VSAM, KSDS's or Indexed Files. Both of the files have 512 byte records with a 12 byte key starting in position 1. The positions within each record to be compared are externally defined via SYSUT3 when the compare program is executed.

Table of Contents Previous Section Next Section Windows CMD File

This job script (CUSCP1W4.cmd) is a Windows CMD File that compares multiple segments within a record. The compare results will be posted to a line sequential (or ASCII/Text) file.

@echo OFF
     set CmdName=CUSCP1W4
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *       This test case is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two Customer Master Files.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This job will execute a program that will do a compare of multiple
rem  * record segments within two Customer Files. Both files (or KSDS)
rem  * are Indexed files with a record length of 512 byte. The key
rem  * location starts in position 1 and the key length is 12 bytes.
rem  *
rem  * Since the files are in sequence by the key-field the program
rem  * will explicity identify deleted or added records.
rem  *
rem  *                    ************     ************
rem  *                    * CUSCP1W4 *-----* SIMONOTE *
rem  *                    ********cmd*     ********cmd*
rem  *                         *
rem  *   ************     ************     ************
rem  *   * INSTREAM *--*--* STEP_002 *-----*  SYSUT3  *
rem  *   ********cmd*  *  ********cmd*     *******lseq*
rem  *                         *
rem  *   ************     ************     ************
rem  *   * CUEXPECT *--*--* CUSCP1C3 *--*--*  SYSOUT  *
rem  *   *******ksds*  *  ********cbl*  *  *******lseq*
rem  *                 *       *        *
rem  *   ************  *       *        *  ************
rem  *   * CUACTUAL *--*       *        *--*  SYSUT4  *
rem  *   *******ksds*  *       *           *******lseq*
rem  *                 *       *
rem  *   ************  *       *
rem  *   *  SYSUT3  *--*       *
rem  *   *******lseq*          *
rem  *                         *
rem  *                    ************
rem  *                    *   EOJ    *
rem  *                    ************
rem  *
rem  * *******************************************************************
rem  * Compare two VSAM KSDS's or Customer Master Files...
rem  * The positions within the records to be compared are determined via
rem  * the SYSUT3 File. This is done when the compare program is executed.
rem  *
rem  * The results of the compare process are posted to the SYSUT4 File.
rem  *
rem  * *******************************************************************
rem  * Step 01 of 04, Prepare the System Environment...
rem  *
     call ..\ENV1BASE %CmdName%
rem  *
     call SimoNOTE "*******************************************************************************%CmdName% "
     call SimoNOTE "* Job_Step 01 of 04, Preparing the System and Job Environment"
     set JobStatus=0
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_%CmdName%.txt
     set SYSLUSER=%BaseLib1%\LOGS\SYSLUSER_%CmdName%.htm
     set CUACTUAL=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSRCSV.CUSTMAST.DAT
     set CUEXPECT=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSLCSV.CUSTMAST.DAT
     set SYSUT3=%BaseLib1%\PARMLIB\CUSCP1D4.ctl
     set SYSUT4=%BaseLib1%\LOGS\SYSUT4_%CmdName%.txt
rem  *
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 02 of 04, Create a Specifications File"
     echo * *******************************************************************>%SYSUT3%
     echo *     CUSCP1D4.ctl - Program Behavior Statements for Compare        *>>%SYSUT3%
     echo *    Processed at Execution Time by Generated Compare Program       *>>%SYSUT3%
     echo *         This Member is provided by SimoTime Technologies          *>>%SYSUT3%
     echo *           (C) Copyright 1987-2019 All Rights Reserved             *>>%SYSUT3%
     echo *             Web Site URL:   http://www.simotime.com               *>>%SYSUT3%
     echo *                   e-mail:   helpdesk@simotime.com                 *>>%SYSUT3%
     echo * *******************************************************************>>%SYSUT3%
     echo *...:....1....:....2....:....3....:....4....:....5....:....6>>%SYSUT3%
     echo /COMPARE   SYSUT1 pos   1 len 348 SYSUT2 pos   1 len 348>>%SYSUT3%
     echo /COMPARE   SYSUT1 pos 368 len 145 SYSUT2 pos 368 len 145>>%SYSUT3%
     echo /DFORMAT   ASC HEX EBC RPI>>%SYSUT3%
     echo /DSTRING   1 512>>%SYSUT3%
     echo /SYSLOG    SYSUT4>>%SYSUT3%
     echo /DISPLAY   NONE>>%SYSUT3%
rem  *
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 03 of 04, Execute a Multiple Segments Compare"
     call SimoNOTE "* DataTake CUACTUAL=%CUACTUAL% "
     call SimoNOTE "* DataTake CUEXPECT=%CUEXPECT% "
     run CUSCP1C3
     if not "%ERRORLEVEL%" == "0" set JobStatus=10
rem  *
:EOJTAG
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 04 of 04, End of Job processing, %JobStatus% "
     if "%JobStatus%" == "0" goto :EOJAOK
:EOJNOK
     call SimoNOTE "* SYSLUSER is %SYSLUSER% "
     call SimoNOTE "* ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJAOK
     call SimoNOTE "* SYSLUSER is %SYSLUSER% "
     call SimoNOTE "* Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJEND
     call SimoNOTE "* Conclude SYSOUT is  %SYSOUT% "
     if not "SIMOGENS" == "BATCH" pause

Table of Contents Previous Section Next Section Job 5, Multi-Segment, log SIMOL32K

The CUSCP1W5 will compare the content of two VSAM, KSDS's or Indexed Files. Both of the files have 512 byte records with a 12 byte key starting in position 1. The positions within each record to be compared are internally defined within the the compare program.

Table of Contents Previous Section Next Section Windows CMD File

This job script (CUSCP1W5.cmd) is a Windows CMD File that compares multiple segments within a record. The compare results will be posted to a line sequential (or ASCII/Text) file.

@echo OFF
     set CmdName=CUSCP1W5
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *       This test case is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2020 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two Customer Master Files.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * The job will compare the records in two Customer Files. Since
rem  * a date and time stamp is located in the second half of a record
rem  * only the first 303 bytes of each record are compared.
rem  *
rem  * Since the files are in sequence by the key-field the program
rem  * will explicity identify deleted or added records.
rem  *
rem  *                    ************
rem  *                    * CUSCP1W5 *
rem  *                    ********cmd*
rem  *                         *
rem  *   ************     ************     ************
rem  *   * CUEXPECT *--*--* CUSCP1C5 *--*--*  SYSOUT  *
rem  *   *******ksds*  *  ********cbl*  *  *******lseq*
rem  *                 *       *        *
rem  *   ************  *       *        *  ************     ************
rem  *   * CUACTUAL *--*       *        *--* SIMOL32K *-----* SYSLUSER *
rem  *   *******ksds*          *           ********cbl*     *******lseq*
rem  *                         *
rem  *                    ************
rem  *                    *   EOJ    *
rem  *                    ************
rem  *
rem  * *******************************************************************
rem  * Compare two VSAM KSDS's or Customer Master Files...
rem  * The positions within the records to be compared are determined by
rem  * the COMPARE statements in the Process Control File. This is done
rem  * when the compare program is generated.
rem  *
rem  * The results of the physical compare is posted to the SYSLUSER File.
rem  *
rem  * *******************************************************************
rem  * Step 01 of nn, Prepare the System Environment...
rem  *
     call ..\ENV1BASE %CmdName%
rem  *
     call SimoNOTE "*******************************************************************************%CmdName% "
     call SimoNOTE "* Job_Step 01 of 03, Preparing the System and Job Environment"
rem  *
     set JobStatus=0
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_%CmdName%.txt
     set SYSLUSER=%BaseLib1%\LOGS\SYSLUSER_%CmdName%.htm
rem  set CUACTUAL=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSRCSV.CUSTMAST.DAT
rem  set CUEXPECT=%BaseLib1%\DATA\WRK1\SIMOCONV.KSDSLCSV.CUSTMAST.DAT
     set CUACTUAL=%BaseLib1%\DATA\ASC1\SIMOTIME.TEST.CUSTQAT1.DAT
     set CUEXPECT=%BaseLib1%\DATA\ASC1\SIMOTIME.TEST.CUSTQAT2.DAT
rem  *
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 02 of 03, Execute the Compare program"
rem  *
     call SimoNOTE "* DataTake CUACTUAL=%CUACTUAL% "
     call SimoNOTE "* DataTake CUEXPECT=%CUEXPECT% "
     run CUSCP1C5
     if not "%ERRORLEVEL%" == "0" set JobStatus=10
rem  *
:EOJTAG
rem  *
     call SimoNOTE "* --------------------------------------------------------------------------- *"
     call SimoNOTE "* Job_Step 03 of 03, End of Job processing"
rem  *
     if "%JobStatus%" == "0" goto :EOJAOK
:EOJNOK
     call SimoNOTE "* SYSLUSER is %SYSLUSER%"
     call SimoNOTE "* ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJAOK
     call SimoNOTE "* SYSLUSER is %SYSLUSER%"
     call SimoNOTE "* Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :EOJEND
:EOJEND
     call SimoNOTE "* Conclude SYSOUT is  %SYSOUT% "
     if not "%SIMOGENS%" == "BATCH" pause

Table of Contents Previous Section Next Section Compare NE Results

The following is an example of the output when a NOT Equal condition occurs during the compare processing.

*******************************************************************************
* CUSCP1C5 Multi-Segment Compare Log=SIMOL32K v19.00.00   helpdesk@simotime.com
* CUSCP1C5 This Data File Compare Member was generated by SimoTime Technologies
*******************************************************************************
* Starting  - Multi-Segment Compare Log=SIMOL32K        http://www.SimoTime.com
*
....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:...90....:..100....:..110....:..120....:..130....:..140....:..150....:..160....:..170....:..180....:..190....:..200....:..210....:..220....:..230....:..240....:..250....:..260....:..270....:..280....:..290....:..300....:..310....:..320....:..330....:..340....:..350....:..360....:..370....:..380....:..390....:..400....:..410....:..420....:..430....:..440....:..450....:..460....:..470....:..480....:..490....:..500....:..510..
CUACTUAL..000000010(00001:00512) COMPARISON  PHYSICAL
000000000010 Taylor                      Elizabeth                               8 Hayes Street                                                                                  Angeles                     PR                          00611                                                             ......00000        ..00000        ..00000        2018021314392055000                                                                                                                                                 
33333333333325676672222222222222222222222466766676222222222222222222222222222222232467672577667222222222222222222222222222222222222222222222222222222222222222222222222222222222246666672222222222222222222225522222222222222222222222222333332222222222222222222222222222222222222222222222222222222222222000000333332222222200333332222222200333332222222233333333333333333332222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
0000000000100419CF200000000000000000000005C9A1254800000000000000000000000000000008081953034255400000000000000000000000000000000000000000000000000000000000000000000000000000000001E75C530000000000000000000000200000000000000000000000000006110000000000000000000000000000000000000000000000000000000000000000F00000000000000000000000000000000000000000000020180213143920550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
............€è/`%?Ê€€€€€€€€€€€€€€€€€€€€€€á%Ñ:/ÂÁÈÇ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€.€ç/`ÁË€ëÈÊÁÁÈ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€.>ÅÁ%ÁË€€€€€€€€€€€€€€€€€€€€€&ꀀ€€€€€€€€€€€€€€€€€€€€€€€€.....€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€...........€€€€€€€€.......€€€€€€€€.......€€€€€€€€...................€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€
=============================================================================================================================================================================================================================================================================================================#=###########==================================-------------------=================================================================================================================================================
CUEXPECT..000000010(00001:00512) COMPARISON  PHYSICAL
000000000010 Taylor                      Elizabeth                               8 Hayes Street                                                                                  Angeles                     PR                          00611                                                             ..%..M22333LIZA    ..00000        ..00000        2018021412303000000                                                                                                                                                 
33333333333325676672222222222222222222222466766676222222222222222222222222222222232467672577667222222222222222222222222222222222222222222222222222222222222222222222222222222222246666672222222222222222222225522222222222222222222222222333332222222222222222222222222222222222222222222222222222222222222002004333334454222200333332222222200333332222222233333333333333333332222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
0000000000100419CF200000000000000000000005C9A1254800000000000000000000000000000008081953034255400000000000000000000000000000000000000000000000000000000000000000000000000000000001E75C530000000000000000000000200000000000000000000000000006110000000000000000000000000000000000000000000000000000000000000005F1D22333C9A1000000000000000000000000000000000020180214123030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
............€è/`%?Ê€€€€€€€€€€€€€€€€€€€€€€á%Ñ:/ÂÁÈÇ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€.€ç/`ÁË€ëÈÊÁÁÈ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€.>ÅÁ%ÁË€€€€€€€€€€€€€€€€€€€€€&ꀀ€€€€€€€€€€€€€€€€€€€€€€€€.....€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€.....(.....<ñ!.€€€€.......€€€€€€€€.......€€€€€€€€...................€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€
=============================================================================================================================================================================================================================================================================================================#=###########==================================-------------------=================================================================================================================================================
*******************************************************************************
This record is MISSING from CUACTUAL - the record is PRESENT in CUEXPECT
....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:...90....:..100....:..110....:..120....:..130....:..140....:..150....:..160....:..170....:..180....:..190....:..200....:..210....:..220....:..230....:..240....:..250....:..260....:..270....:..280....:..290....:..300....:..310....:..320....:..330....:..340....:..350....:..360....:..370....:..380....:..390....:..400....:..410....:..420....:..430....:..440....:..450....:..460....:..470....:..480....:..490....:..500....:..510..
CUEXPECT..000025001(00001:00512) COMPARISON  PHYSICAL
000000027750 Newman                      John                                    21 Monte Verde Dr                                                                               Novato                      CA                          94949                                                             ......00000        ..00000        ..00000        2019091012304500000                                                                                                                                                 
33333333333324676662222222222222222222222466622222222222222222222222222222222222233246676256766247222222222222222222222222222222222222222222222222222222222222222222222222222222246767622222222222222222222224422222222222222222222222222333332222222222222222222222222222222222222222222222222222222222222000000333332222222200333332222222200333332222222233333333333333333332222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
0000000277500E57D1E0000000000000000000000AF8E000000000000000000000000000000000000210DFE450652450420000000000000000000000000000000000000000000000000000000000000000000000000000000EF614F00000000000000000000003100000000000000000000000000949490000000000000000000000000000000000000000000000000000000000000000F00000000000000000000000000000000000000000000020190910123045000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
............€+ÁÏ_/>€€€€€€€€€€€€€€€€€€€€€€¢?Ç>€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€..€(?>ÈÁ€îÁÊÀÁ€àÊ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€+?Î/È?€€€€€€€€€€€€€€€€€€€€€€ä.€€€€€€€€€€€€€€€€€€€€€€€€€€.....€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€...........€€€€€€€€.......€€€€€€€€.......€€€€€€€€...................€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€
############--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*******************************************************************************
Conclude  - Multi-Segment Compare Log=SIMOL32K
000025000 - Record count for CUACTUAL
000025001 - Record count for CUEXPECT
WARNING!  - Record counts are not equal
000000002 - NOT Equal count for compare of existing records
000024999 - Number of matching record pairs for Compare Task
*******************************************************************************
* ABENDING  - Multi-Segment Compare Log=SIMOL32K        http://www.SimoTime.com
*

In the preceding example the lines with the RED text show the possible ASCII-Text translation and the lines with the BLUE text show the possible EBCDIC-Text translation. The lines with the Light Green background color are the dump information. Two lines of hexadecimal information are displayed for each record. The first line is the high-order nibble or leftmost 4 bits. The second line is the low order nibble or rightmost four bits. The lines with the Yellow background color show the header information about the files and record segments. The lines with the Light Red background color show compare results by position with a record.

Note: The compare results will be posted to the user-defined device associated with SYSLUSER

Table of Contents Previous Section Next Section The COBOL Source Code

WIP

Table of Contents Previous Section Next Section Pre-Defined Record Compare

The following (CUSCP1C1.cbl) is the generated COBOL source code that compares the full record content of two VSAM, KSDS's. The compare specifications will be internally obtained from within the compare program. The compare results will be posted to a line sequential (or ASCII/Text) file.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CUSCP1C1.
       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: 2019-09-19  Generation Time: 13:38:48:13    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   CUACTUAL INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  SECONDARY CUEXPECT INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  OUTPUT    SYSUT4   ASCII/CRLF    VARIABLE   00512            *
      *                                              00512            *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT CUACTUAL-FILE  ASSIGN TO       CUACTUAL
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUACTUAL-PKEY-00001-00012
                  FILE STATUS   IS CUACTUAL-STATUS.
           SELECT CUEXPECT-FILE  ASSIGN TO       CUEXPECT
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUEXPECT-PKEY-00001-00012
                  FILE STATUS   IS CUEXPECT-STATUS.
           SELECT SYSUT4-FILE  ASSIGN TO       SYSUT4
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT4-STATUS.

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

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

       FD  SYSUT4-FILE
           DATA RECORD    IS SYSUT4-REC
           .
       01  SYSUT4-REC.
           05  SYSUT4-DATA-01 PIC X(00512).

      *****************************************************************
      * This program was created using the SYSCPX41.txt file as the   *
      * template for the data file comparison. This program template  *
      * has the following characteristics.                            *
      * 1. The positions to be compared are determined during the     *
      *    program generation and compilation based on the &COMPARE   *
      *    statements in the Process Control File.                    *
      * 2. For a "NOT Equal" condition the Hex-Dump information will  *
      *    be written to a Line Sequential (LSEQ) File (SYSUT4).      *
      * 3. The DRECLMAX function is supported using this template.    *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 19.00.00          *
      *                                                               *
      *        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 '* CUSCP1C1 '.
           05  T2 pic X(34) value 'Compare via PCF File Output=SYSUT4'.
           05  T3 pic X(10) value ' v19.00.00'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CUSCP1C1 '.
           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 '* CUSCP1C1 '.
           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 '* CUSCP1C1 '.
           05  C2 pic X(32) value 'Please send all comments or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

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

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

       01  SYSUT4-STATUS.
           05  SYSUT4-STATUS-L       pic X.
           05  SYSUT4-STATUS-R       pic X.
       01  SYSUT4-EOF                pic X       value 'N'.
       01  SYSUT4-OPEN-FLAG          pic X       value 'C'.
       01  SYSUT4-LRECL              pic 9(5)    value 00512.

      *****************************************************************
      * 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 for posting user-defined messages.             *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(011)  value '* CUSCP1C1 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(068)  value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.
       01  MSG-LSB                 pic 9(3)    value 267.

      *****************************************************************
       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 00012.
       01  KEY-CONTROL-2.
           05  K-PS-2              pic 9(5)    value 00001.
           05  K-LN-2              pic 9(5)    value 00012.

       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-RPI        pic X       value 'Y'.
           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 'NE'.
           05  DUMP-SUM        pic X       value 'Y'.
           05  DUMP-STATUS     pic x       VALUE 'Y'.
       01  DUMP-PGM            pic X(8)    value 'SYSUT4  '.

       01  DPOS-UT1            pic 9(5)    value 1.
       01  DLEN-UT1            pic 9(5)    value 00512.
       01  DPOS-UT2            pic 9(5)    value 1.
       01  DLEN-UT2            pic 9(5)    value 00512.

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

       01  COMPACT-STATUS  pic XX      value 'EQ'.
       01  COMPACT-PENDED  pic XX      value 'EQ'.
       01  COMPARE-STATUS  pic XX      value 'EQ'.
       01  FLAG-EQ         pic XX      value 'EQ'.
       01  FLAG-NE         pic XX      value 'NE'.
       01  FLAG-QT         pic XX      value 'QT'.
       01  DELTA-LINE-1    pic X(00512)  value all '-'.
       01  DELTA-LINE-2    pic X(00512)  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  BYPASS-UT1-CTR  pic 9(3)    value 0.
       01  BYPASS-UT2-CTR  pic 9(3)    value 0.

       01  FIVE-BYTES              pic X(5).

       01  DX-1                    pic 9(3)    BINARY.
       01  DX-1R                   REDEFINES DX-1.
           05  DX-1R-01            pic X.
           05  DX-1R-02            pic X.
       01  DX-2                    pic 9(3)    BINARY.
       01  DX-3                    pic 9(3)    BINARY.


       01  WORK-02-COMP            pic 9(4)  COMP.
       01  WORK-02-X               redefines WORK-02-COMP.
           05  WORK-02-X-X1        pic X.
           05  WORK-02-X-X2        pic X.

       01  WORK-LENGTH             pic 9(5)  value 0.

       01  WORK-05         pic X(5)    value SPACES.
       01  WORK-05-A       pic X(5)    value SPACES.
       01  WORK-05-E       pic X(5)    value SPACES.
       01  PTR-A-ZD-3      pic 999     value 0.
       01  PTR-E-ZD-3      pic 999     value 0.
       01  A-FLAG          pic X       value 'N'.
       01  E-FLAG          pic X       value 'N'.

       01  DELTA-MAX-ABEND.
           05  FILLER          pic X(10)
                               value 'ABENDING, '.
           05  FILLER          pic X(24)
                               value 'Not Equal count exceeds '.
           05  FILLER          pic X(22)
                               value 'user-defined limit of '.
           05  DELTA-MAXIMUM-X pic X(9)
                               value '&&&&&&&&&'.
           05  DELTA-MAXIMUM   redefines DELTA-MAXIMUM-X
                               pic 9(9).
           05  FILLER          pic X(19)
                               value ', ABEND process is '.
           05  DELTA-PROCESS   pic X(4)
                               value 'EOF '.

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

       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  CUACTUAL-LRECL    pic 9(5)    value 00512.
       01  LEN-UT1         pic 9(5)    value 128.
       01  POS-UT1         pic 9(5)    value 1.
       01  CUEXPECT-LRECL    pic 9(5)    value 00512.
       01  LEN-UT2         pic 9(5)    value 128.
       01  POS-UT2         pic 9(5)    value 1.

       01  CUACTUAL-LRECL-M  pic 9(5)    value 00512.
       01  CUEXPECT-LRECL-M  pic 9(5)    value 00512.

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

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

       01  DUMP-RECL-MAX-S pic X       value 'N'.
       01  DUMP-RECL-MAX   pic 9(5)    value 00000.

       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(00512)  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  DUMP-HDR-POS    pic 9(5)      value 1.
       01  DUMP-HDR-LEN    pic 9(5)      value 00512.

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

       01  INFO-STATEMENT.
           05  INFO-SHORT.
               10  filler  pic X(2)    value '* '.
               10  INFO-ID pic X(8)    value 'Starting'.
               10  filler  pic X(4)    value '  - '.
               10  INFO-34 pic X(34)
                   value   'Compare via PCF File Output=SYSUT4'.
           05  filler      pic X(31)
               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 CUACTUAL'.
           05  filler      pic X(7)  value ' - the '.
           05  filler      pic X(29)
                           value 'record is PRESENT in CUEXPECT'.

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

       01  CUACTUAL-TOTAL.
           05  filler      pic X(2)  value '* '.
           05  CUACTUAL-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for CUACTUAL'.
       01  CUEXPECT-TOTAL.
           05  filler      pic X(2)  value '* '.
           05  CUEXPECT-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for CUEXPECT'.
       01  CUACTUAL-OMIT.
           05  filler      pic X(2)  value '* '.
           05  CUACTUAL-OMT  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Bypass count for CUACTUAL'.
       01  CUEXPECT-OMIT.
           05  filler      pic X(2)  value '* '.
           05  CUEXPECT-OMT  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Bypass count for CUEXPECT'.
       01  COMPARE-NE-TOTAL.
           05  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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'.

       COPY HEXTABLE.
       COPY PAENVARS.

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

           perform
               until COMPARE-STATUS = 'QT'
               or    CUACTUAL-STATUS not = '00'
               or    CUEXPECT-STATUS not = '00'
               if  READ-1 = 'Y'
                   perform CUACTUAL-READ
               end-if
               if  READ-2 = 'Y'
                   perform CUEXPECT-READ
               end-if
               if  CUACTUAL-STATUS = '00'
               and CUEXPECT-STATUS = '00'
                   move 'EQ' to COMPARE-STATUS
                   move 'N' to DUMP-STATUS
                   move all '-' to DELTA-LINE-1
                   move all '-' to DELTA-LINE-2
                   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  DUMP-STATUS = 'Y'
                       if  GROUP-DELIMITER = 'Y'
                           perform DUMP-ASTERISK-ONE
                       end-if
                       add CUACTUAL-LRECL-M to ZERO giving D-LEN
                       if  DUMP-RPI = 'Y'
                           perform DUMP-POSITION-INDICATOR
                       end-if
                       perform DUMP-PRIMARY-RECORD
                       perform DUMP-SECONDARY-RECORD
                       add CUEXPECT-LRECL-M to ZERO giving D-LEN
                       move 'N' to DUMP-STATUS
                   end-if
               else
                   if  CUACTUAL-STATUS = '00'
                   or  CUEXPECT-STATUS = '00'
                       if  KEY-ACTIVE = 'Y'
                           perform COMPARE-KEYS
                       end-if
                   end-if
                   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 DELTA-MAX-ABEND to MESSAGE-TEXT
                   move MESSAGE-BUFFER to SYSUT4-REC
                   perform SYSUT4-WRITE-AND-CLEAR
                   perform Z-ABEND-PROGRAM
               end-if
               if  DELTA-PROCESS = 'EOF '
               and COMPARE-NE > DELTA-MAXIMUM
                   move DELTA-MAX-ABEND to MESSAGE-TEXT
                   move MESSAGE-BUFFER to SYSUT4-REC
                   perform SYSUT4-WRITE-AND-CLEAR
                   perform Z-POST-MESSAGE-TO-USER
                   move 'QT' to COMPARE-STATUS
               end-if
           end-perform

           perform JOB-FINISHED

           GOBACK.

      *****************************************************************
       COMPARE-RECORDS.
      *    Physical Comparison with NE Output of SYSUT4
           move 'COMPARISON' to REC-CTYPE
           move 'PHYSICAL  ' to REC-CMODE
           if CUACTUAL-REC(00001:00512) not = CUEXPECT-REC(00001:00512)
              move FLAG-NE to COMPARE-STATUS
              add 1 to COMPARE-NE
              move 'Y' to DUMP-STATUS
           end-if
           if  DUMP-DET    = 'Y'
               add 00001 to ZERO  giving POS-UT1
               add 00001 to ZERO  giving POS-UT2
               add 00512 to ZERO  giving LEN-UT1
               add 00512 to ZERO  giving LEN-UT2
               add 00512 to ZERO  giving WORK-LENGTH
               perform CALC-DELTA-FOR-NE-EQ-NO
           end-if
           exit.


      *****************************************************************
       COMPARE-KEYS.
           move YES-YES to READ-FLAGS
           if  CUACTUAL-REC(K-PS-1:K-LN-1)
            >  CUEXPECT-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  CUACTUAL-REC(K-PS-1:K-LN-1)
            <  CUEXPECT-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.

      *****************************************************************
      *    Build the position header row...
      *****************************************************************
       DUMP-ASTERISK-ONE.
           move SPACES to SYSUT4-REC
           move '*'    to SYSUT4-REC(1:1)
           perform SYSUT4-WRITE-AND-CLEAR
           exit.
      *****************************************************************
       DUMP-ASTERISK-ROW.
           move SPACES  to SYSUT4-REC
           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       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 > DUMP-HDR-LEN - 10
               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:DUMP-HDR-LEN) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-PRIMARY-MISSING.
           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if
           add DPOS-UT1 to ZERO giving RECORD-POS
           add DLEN-UT1 to ZERO giving RECORD-LEN
           add DPOS-UT1 to ZERO giving D-POS
           add DLEN-UT1 to ZERO giving D-LEN
      *    Present in CUEXPECT, missing from CUACTUAL...
           move UT1-MISSING to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           add CUEXPECT-LRECL-M to ZERO giving D-LEN
           if  DUMP-RPI = 'Y'
               perform DUMP-POSITION-INDICATOR
           end-if
           perform DUMP-SECONDARY-RECORD
           move all '#' to DELTA-LINE-1(1:WORK-LENGTH)
           perform DUMP-POSITION-DIFFERENCES-1
           exit.

      *****************************************************************
       DUMP-PRIMARY-RECORD.
           add DPOS-UT1 to ZERO giving RECORD-POS
           add DLEN-UT1 to ZERO giving RECORD-LEN
           add DPOS-UT1 to ZERO giving D-POS
           add DLEN-UT1 to ZERO giving D-LEN
           move 'CUACTUAL..' to RECORD-ID
           add CUACTUAL-RDR to ZERO giving REC-NUMBER

           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUACTUAL-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           end-if

           move RECORD-HEADER  to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           perform DUMP-CUACTUAL-TO-SYSUT4
           perform DUMP-POSITION-DIFFERENCES-1
           exit.

      *****************************************************************
       DUMP-SECONDARY-MISSING.
           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if
           add DPOS-UT2 to ZERO giving RECORD-POS
           add DLEN-UT2 to ZERO giving RECORD-LEN
           add DPOS-UT2 to ZERO giving D-POS
           add DLEN-UT2 to ZERO giving D-LEN
      *    Present in CUACTUAL, missing from CUEXPECT...
           move UT2-MISSING to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           add CUACTUAL-LRECL-M to ZERO giving D-LEN
           if  DUMP-RPI = 'Y'
               perform DUMP-POSITION-INDICATOR
           end-if
           perform DUMP-PRIMARY-RECORD
           move all '#' to DELTA-LINE-2(1:WORK-LENGTH)
           perform DUMP-POSITION-DIFFERENCES-2
           exit.

      *****************************************************************
       DUMP-SECONDARY-RECORD.
           add DPOS-UT2 to ZERO giving RECORD-POS
           add DLEN-UT2 to ZERO giving RECORD-LEN
           add DPOS-UT2 to ZERO giving D-POS
           add DLEN-UT2 to ZERO giving D-LEN
           move 'CUEXPECT..' to RECORD-ID
           add CUEXPECT-RDR to ZERO giving REC-NUMBER
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUEXPECT-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           end-if

           move RECORD-HEADER  to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           perform DUMP-CUEXPECT-TO-SYSUT4
           perform DUMP-POSITION-DIFFERENCES-2
           exit.

      *****************************************************************
       CALC-DELTA-FOR-NE-EQ-NO.
           add POS-UT1 to ZERO giving PTR-1
           add POS-UT2 to ZERO giving PTR-2
           perform until PTR-1 > POS-UT1 + LEN-UT1 - 1
                      or PTR-2 > POS-UT2 + LEN-UT2 - 1
               if CUACTUAL-REC(PTR-1:1)
                = CUEXPECT-REC(PTR-2:1)
                  move '=' to DELTA-LINE-1(PTR-1:1)
                  move '=' to DELTA-LINE-2(PTR-2:1)
               else
                  move '#' to DELTA-LINE-1(PTR-1:1)
                  move '#' to DELTA-LINE-2(PTR-2:1)
               end-if
               add 1 to PTR-1
               add 1 to PTR-2
           end-perform
           exit.

      *****************************************************************
       DUMP-POSITION-DIFFERENCES-1.
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUACTUAL-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           end-if
           move DELTA-LINE-1(1:WORK-LENGTH) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-POSITION-DIFFERENCES-2.
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUEXPECT-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           end-if
           move DELTA-LINE-1(1:WORK-LENGTH) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-CUACTUAL-TO-SYSUT4.
           add 4 to ZERO giving DX-3
           add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           perform 4 times
               perform varying DX-2 from 1 by 1
                   until DX-2 > WORK-LENGTH
                  add 1 to ZERO giving DX-1
                   move CUACTUAL-REC(DX-2:1) to DX-1R-02
                   add 1 to DX-1
                   move TAB-X1(DX-1) to FIVE-BYTES
                   move FIVE-BYTES(DX-3:1) to SYSUT4-REC(DX-2:1)
               end-perform
               perform SYSUT4-WRITE-AND-CLEAR
               if  DX-3 = 4
                   add 1 to ZERO giving DX-3
               else
                   add 1 to DX-3
               end-if
           end-perform
           exit.

      *****************************************************************
       DUMP-CUEXPECT-TO-SYSUT4.
           add 4 to ZERO giving DX-3
           add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           perform 4 times
               perform varying DX-2 from 1 by 1
                   until DX-2 > WORK-LENGTH
                  add 1 to ZERO giving DX-1
                   move CUEXPECT-REC(DX-2:1) to DX-1R-02
                   add 1 to DX-1
                   move TAB-X1(DX-1) to FIVE-BYTES
                   move FIVE-BYTES(DX-3:1) to SYSUT4-REC(DX-2:1)
               end-perform
               perform SYSUT4-WRITE-AND-CLEAR
               if  DX-3 = 4
                   add 1 to ZERO giving DX-3
               else
                   add 1 to DX-3
               end-if
           end-perform
           exit.

      *****************************************************************
       JOB-FINISHED.
           if  CUACTUAL-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform until CUACTUAL-STATUS not = '00'
                 perform CUACTUAL-READ
                 add 1 to COMPARE-NE
               end-perform
           end-if
           if  CUEXPECT-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform until CUEXPECT-STATUS not = '00'
                 perform CUEXPECT-READ
                 add 1 to COMPARE-NE
               end-perform
           end-if
           perform CUEXPECT-CLOSE
           perform CUACTUAL-CLOSE

           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           move 'Conclude' to INFO-ID
           move INFO-SHORT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move 'Finished' to INFO-ID

           move CUACTUAL-TOTAL to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  CUACTUAL-OMT > ZERO
               move CUACTUAL-OMIT to SYSUT4-REC
              perform SYSUT4-WRITE-AND-CLEAR
           end-if

           move CUEXPECT-TOTAL to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  CUEXPECT-OMT > ZERO
               move CUEXPECT-OMIT to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  CUACTUAL-RDR not = CUEXPECT-RDR
               move '* WARNING!  - Record counts are not equal'
                 to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
               move 'ABENDING' to INFO-ID
           end-if

           if  FF-01 = '1'
               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 SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
               move COMPARE-EQ-TOTAL to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  FF-02 = '1'
               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 SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  CUACTUAL-EOF not = 'Y'
           or  CUEXPECT-EOF not = 'Y'
               move 'ABENDING' to INFO-ID
           end-if
           move INFO-STATEMENT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

      *    move INFO-SHORT to MESSAGE-TEXT
      *    perform Z-POST-MESSAGE-TO-SYSOUT

           perform Z-THANK-YOU.

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

      *****************************************************************
       JOB-STARTING.
           perform Z-POST-COPYRIGHT
           perform Z-DETERMINE-ENVIRONMENT
           perform CUACTUAL-OPEN
           perform CUEXPECT-OPEN
           perform SYSUT4-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-POST-MESSAGE-TO-SYSOUT

           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           move SIM-TITLE to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move SIM-COPYRIGHT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           move INFO-STATEMENT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

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

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

      *****************************************************************
      * I/O ROUTINES FOR SYSUT4...                                    *
      *****************************************************************
       SYSUT4-WRITE-AND-CLEAR.
           perform SYSUT4-WRITE
           move SPACES to SYSUT4-REC
           exit.
      *---------------------------------------------------------------*
       SYSUT4-WRITE.
           if  SYSUT4-OPEN-FLAG = 'C'
               perform SYSUT4-OPEN
           end-if
           write SYSUT4-REC
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT4-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
               move 'WRITE Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT4-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open output SYSUT4-FILE
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT4-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT4-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT4-FILE
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SYSUT4-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-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.                                             *
      *****************************************************************
       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-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-POST-MESSAGE-TO-USER
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-USER
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-CALCULATE-MESSAGE-LSB.
           if  MESSAGE-TEXT-2 = SPACES
               add  79 to ZERO giving MSG-LSB
           else
               add 267 to ZERO giving MSG-LSB
           end-if
           perform until MSG-LSB < 80
                      or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE
             if MESSAGE-BUFFER(MSG-LSB:1) = SPACE
                subtract 1 from MSG-LSB
             end-if
           end-perform
           exit.

      *****************************************************************
      * Display message to SYSOUT device...                           *
      *****************************************************************
       Z-POST-MESSAGE-TO-SYSOUT.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display message to CONSOLE device...                          *
      *****************************************************************
       Z-POST-MESSAGE-TO-CONSOLE.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB) upon console
           exit.

      *****************************************************************
       Z-POST-MESSAGE-TO-USER.
           perform Z-POST-MESSAGE-TO-CONSOLE
           perform Z-POST-MESSAGE-TO-SYSOUT
           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-POST-MESSAGE-TO-USER
           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-POST-MESSAGE-TO-USER
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           move SIM-TITLE to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           move SIM-COPYRIGHT to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           move SIM-THANKS-01 to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           move SIM-THANKS-02 to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           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: 2019-09-19  Generation Time: 13:38:48:20    *
      *****************************************************************

Table of Contents Previous Section Next Section Pre-Defined Segment Compare

The following (CUSCP1C2.cbl) is the generated COBOL source code that compares multiple segments within the records of two VSAM, KSDS's. The compare specifications will be internally obtained from within the compare program. The compare results will be posted to a line sequential (or ASCII/Text) file.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CUSCP1C2.
       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: 2019-09-19  Generation Time: 13:38:48:44    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   CUACTUAL INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  SECONDARY CUEXPECT INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  OUTPUT    SYSUT4   ASCII/CRLF    VARIABLE   00512            *
      *                                              00512            *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT CUACTUAL-FILE  ASSIGN TO       CUACTUAL
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUACTUAL-PKEY-00001-00012
                  FILE STATUS   IS CUACTUAL-STATUS.
           SELECT CUEXPECT-FILE  ASSIGN TO       CUEXPECT
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUEXPECT-PKEY-00001-00012
                  FILE STATUS   IS CUEXPECT-STATUS.
           SELECT SYSUT4-FILE  ASSIGN TO       SYSUT4
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT4-STATUS.

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

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

       FD  SYSUT4-FILE
           DATA RECORD    IS SYSUT4-REC
           .
       01  SYSUT4-REC.
           05  SYSUT4-DATA-01 PIC X(00512).

      *****************************************************************
      * This program was created using the SYSCPX41.txt file as the   *
      * template for the data file comparison. This program template  *
      * has the following characteristics.                            *
      * 1. The positions to be compared are determined during the     *
      *    program generation and compilation based on the &COMPARE   *
      *    statements in the Process Control File.                    *
      * 2. For a "NOT Equal" condition the Hex-Dump information will  *
      *    be written to a Line Sequential (LSEQ) File (SYSUT4).      *
      * 3. The DRECLMAX function is supported using this template.    *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 19.00.00          *
      *                                                               *
      *        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 '* CUSCP1C2 '.
           05  T2 pic X(34) value 'Compare Two Customer files (KSDS) '.
           05  T3 pic X(10) value ' v19.00.00'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CUSCP1C2 '.
           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 '* CUSCP1C2 '.
           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 '* CUSCP1C2 '.
           05  C2 pic X(32) value 'Please send all comments or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

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

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

       01  SYSUT4-STATUS.
           05  SYSUT4-STATUS-L       pic X.
           05  SYSUT4-STATUS-R       pic X.
       01  SYSUT4-EOF                pic X       value 'N'.
       01  SYSUT4-OPEN-FLAG          pic X       value 'C'.
       01  SYSUT4-LRECL              pic 9(5)    value 00512.

      *****************************************************************
      * 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 for posting user-defined messages.             *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(011)  value '* CUSCP1C2 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(068)  value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.
       01  MSG-LSB                 pic 9(3)    value 267.

      *****************************************************************
       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 00012.
       01  KEY-CONTROL-2.
           05  K-PS-2              pic 9(5)    value 00001.
           05  K-LN-2              pic 9(5)    value 00012.

       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-RPI        pic X       value 'Y'.
           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 'NE'.
           05  DUMP-SUM        pic X       value 'Y'.
           05  DUMP-STATUS     pic x       VALUE 'Y'.
       01  DUMP-PGM            pic X(8)    value 'SYSUT4  '.

       01  DPOS-UT1            pic 9(5)    value 1.
       01  DLEN-UT1            pic 9(5)    value 00512.
       01  DPOS-UT2            pic 9(5)    value 1.
       01  DLEN-UT2            pic 9(5)    value 00512.

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

       01  COMPACT-STATUS  pic XX      value 'EQ'.
       01  COMPACT-PENDED  pic XX      value 'EQ'.
       01  COMPARE-STATUS  pic XX      value 'EQ'.
       01  FLAG-EQ         pic XX      value 'EQ'.
       01  FLAG-NE         pic XX      value 'NE'.
       01  FLAG-QT         pic XX      value 'QT'.
       01  DELTA-LINE-1    pic X(00512)  value all '-'.
       01  DELTA-LINE-2    pic X(00512)  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  BYPASS-UT1-CTR  pic 9(3)    value 0.
       01  BYPASS-UT2-CTR  pic 9(3)    value 0.

       01  FIVE-BYTES              pic X(5).

       01  DX-1                    pic 9(3)    BINARY.
       01  DX-1R                   REDEFINES DX-1.
           05  DX-1R-01            pic X.
           05  DX-1R-02            pic X.
       01  DX-2                    pic 9(3)    BINARY.
       01  DX-3                    pic 9(3)    BINARY.


       01  WORK-02-COMP            pic 9(4)  COMP.
       01  WORK-02-X               redefines WORK-02-COMP.
           05  WORK-02-X-X1        pic X.
           05  WORK-02-X-X2        pic X.

       01  WORK-LENGTH             pic 9(5)  value 0.

       01  WORK-05         pic X(5)    value SPACES.
       01  WORK-05-A       pic X(5)    value SPACES.
       01  WORK-05-E       pic X(5)    value SPACES.
       01  PTR-A-ZD-3      pic 999     value 0.
       01  PTR-E-ZD-3      pic 999     value 0.
       01  A-FLAG          pic X       value 'N'.
       01  E-FLAG          pic X       value 'N'.

       01  DELTA-MAX-ABEND.
           05  FILLER          pic X(10)
                               value 'ABENDING, '.
           05  FILLER          pic X(24)
                               value 'Not Equal count exceeds '.
           05  FILLER          pic X(22)
                               value 'user-defined limit of '.
           05  DELTA-MAXIMUM-X pic X(9)
                               value '&&&&&&&&&'.
           05  DELTA-MAXIMUM   redefines DELTA-MAXIMUM-X
                               pic 9(9).
           05  FILLER          pic X(19)
                               value ', ABEND process is '.
           05  DELTA-PROCESS   pic X(4)
                               value 'EOF '.

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

       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  CUACTUAL-LRECL    pic 9(5)    value 00512.
       01  LEN-UT1         pic 9(5)    value 128.
       01  POS-UT1         pic 9(5)    value 1.
       01  CUEXPECT-LRECL    pic 9(5)    value 00512.
       01  LEN-UT2         pic 9(5)    value 128.
       01  POS-UT2         pic 9(5)    value 1.

       01  CUACTUAL-LRECL-M  pic 9(5)    value 00512.
       01  CUEXPECT-LRECL-M  pic 9(5)    value 00512.

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

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

       01  DUMP-RECL-MAX-S pic X       value 'N'.
       01  DUMP-RECL-MAX   pic 9(5)    value 00000.

       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(00512)  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  DUMP-HDR-POS    pic 9(5)      value 1.
       01  DUMP-HDR-LEN    pic 9(5)      value 00512.

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

       01  INFO-STATEMENT.
           05  INFO-SHORT.
               10  filler  pic X(2)    value '* '.
               10  INFO-ID pic X(8)    value 'Starting'.
               10  filler  pic X(4)    value '  - '.
               10  INFO-34 pic X(34)
                   value   'Compare Two Customer files (KSDS) '.
           05  filler      pic X(31)
               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 CUACTUAL'.
           05  filler      pic X(7)  value ' - the '.
           05  filler      pic X(29)
                           value 'record is PRESENT in CUEXPECT'.

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

       01  CUACTUAL-TOTAL.
           05  filler      pic X(2)  value '* '.
           05  CUACTUAL-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for CUACTUAL'.
       01  CUEXPECT-TOTAL.
           05  filler      pic X(2)  value '* '.
           05  CUEXPECT-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for CUEXPECT'.
       01  CUACTUAL-OMIT.
           05  filler      pic X(2)  value '* '.
           05  CUACTUAL-OMT  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Bypass count for CUACTUAL'.
       01  CUEXPECT-OMIT.
           05  filler      pic X(2)  value '* '.
           05  CUEXPECT-OMT  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Bypass count for CUEXPECT'.
       01  COMPARE-NE-TOTAL.
           05  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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'.

       COPY HEXTABLE.
       COPY PAENVARS.

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

           perform
               until COMPARE-STATUS = 'QT'
               or    CUACTUAL-STATUS not = '00'
               or    CUEXPECT-STATUS not = '00'
               if  READ-1 = 'Y'
                   perform CUACTUAL-READ
               end-if
               if  READ-2 = 'Y'
                   perform CUEXPECT-READ
               end-if
               if  CUACTUAL-STATUS = '00'
               and CUEXPECT-STATUS = '00'
                   move 'EQ' to COMPARE-STATUS
                   move 'N' to DUMP-STATUS
                   move all '-' to DELTA-LINE-1
                   move all '-' to DELTA-LINE-2
                   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  DUMP-STATUS = 'Y'
                       if  GROUP-DELIMITER = 'Y'
                           perform DUMP-ASTERISK-ONE
                       end-if
                       add CUACTUAL-LRECL-M to ZERO giving D-LEN
                       if  DUMP-RPI = 'Y'
                           perform DUMP-POSITION-INDICATOR
                       end-if
                       perform DUMP-PRIMARY-RECORD
                       perform DUMP-SECONDARY-RECORD
                       add CUEXPECT-LRECL-M to ZERO giving D-LEN
                       move 'N' to DUMP-STATUS
                   end-if
               else
                   if  CUACTUAL-STATUS = '00'
                   or  CUEXPECT-STATUS = '00'
                       if  KEY-ACTIVE = 'Y'
                           perform COMPARE-KEYS
                       end-if
                   end-if
                   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 DELTA-MAX-ABEND to MESSAGE-TEXT
                   move MESSAGE-BUFFER to SYSUT4-REC
                   perform SYSUT4-WRITE-AND-CLEAR
                   perform Z-ABEND-PROGRAM
               end-if
               if  DELTA-PROCESS = 'EOF '
               and COMPARE-NE > DELTA-MAXIMUM
                   move DELTA-MAX-ABEND to MESSAGE-TEXT
                   move MESSAGE-BUFFER to SYSUT4-REC
                   perform SYSUT4-WRITE-AND-CLEAR
                   perform Z-POST-MESSAGE-TO-USER
                   move 'QT' to COMPARE-STATUS
               end-if
           end-perform

           perform JOB-FINISHED

           GOBACK.

      *****************************************************************
       COMPARE-RECORDS.
      *    Physical Comparison with NE Output of SYSUT4
           move 'COMPARISON' to REC-CTYPE
           move 'PHYSICAL  ' to REC-CMODE
           if CUACTUAL-REC(00001:00348) not = CUEXPECT-REC(00001:00348)
              move FLAG-NE to COMPARE-STATUS
              add 1 to COMPARE-NE
              move 'Y' to DUMP-STATUS
           end-if
           if  DUMP-DET    = 'Y'
               add 00001 to ZERO  giving POS-UT1
               add 00001 to ZERO  giving POS-UT2
               add 00348 to ZERO  giving LEN-UT1
               add 00348 to ZERO  giving LEN-UT2
               add 00348 to ZERO  giving WORK-LENGTH
               perform CALC-DELTA-FOR-NE-EQ-NO
           end-if
      *    Physical Comparison with NE Output of SYSUT4
           move 'COMPARISON' to REC-CTYPE
           move 'PHYSICAL  ' to REC-CMODE
           if CUACTUAL-REC(00368:00145) not = CUEXPECT-REC(00368:00145)
              move FLAG-NE to COMPARE-STATUS
              add 1 to COMPARE-NE
              move 'Y' to DUMP-STATUS
           end-if
           if  DUMP-DET    = 'Y'
               add 00368 to ZERO  giving POS-UT1
               add 00368 to ZERO  giving POS-UT2
               add 00145 to ZERO  giving LEN-UT1
               add 00145 to ZERO  giving LEN-UT2
               add 00145 to ZERO  giving WORK-LENGTH
               perform CALC-DELTA-FOR-NE-EQ-NO
           end-if
           exit.


      *****************************************************************
       COMPARE-KEYS.
           move YES-YES to READ-FLAGS
           if  CUACTUAL-REC(K-PS-1:K-LN-1)
            >  CUEXPECT-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  CUACTUAL-REC(K-PS-1:K-LN-1)
            <  CUEXPECT-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.

      *****************************************************************
      *    Build the position header row...
      *****************************************************************
       DUMP-ASTERISK-ONE.
           move SPACES to SYSUT4-REC
           move '*'    to SYSUT4-REC(1:1)
           perform SYSUT4-WRITE-AND-CLEAR
           exit.
      *****************************************************************
       DUMP-ASTERISK-ROW.
           move SPACES  to SYSUT4-REC
           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       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 > DUMP-HDR-LEN - 10
               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:DUMP-HDR-LEN) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-PRIMARY-MISSING.
           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if
           add DPOS-UT1 to ZERO giving RECORD-POS
           add DLEN-UT1 to ZERO giving RECORD-LEN
           add DPOS-UT1 to ZERO giving D-POS
           add DLEN-UT1 to ZERO giving D-LEN
      *    Present in CUEXPECT, missing from CUACTUAL...
           move UT1-MISSING to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           add CUEXPECT-LRECL-M to ZERO giving D-LEN
           if  DUMP-RPI = 'Y'
               perform DUMP-POSITION-INDICATOR
           end-if
           perform DUMP-SECONDARY-RECORD
           move all '#' to DELTA-LINE-1(1:WORK-LENGTH)
           perform DUMP-POSITION-DIFFERENCES-1
           exit.

      *****************************************************************
       DUMP-PRIMARY-RECORD.
           add DPOS-UT1 to ZERO giving RECORD-POS
           add DLEN-UT1 to ZERO giving RECORD-LEN
           add DPOS-UT1 to ZERO giving D-POS
           add DLEN-UT1 to ZERO giving D-LEN
           move 'CUACTUAL..' to RECORD-ID
           add CUACTUAL-RDR to ZERO giving REC-NUMBER

           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUACTUAL-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           end-if

           move RECORD-HEADER  to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           perform DUMP-CUACTUAL-TO-SYSUT4
           perform DUMP-POSITION-DIFFERENCES-1
           exit.

      *****************************************************************
       DUMP-SECONDARY-MISSING.
           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if
           add DPOS-UT2 to ZERO giving RECORD-POS
           add DLEN-UT2 to ZERO giving RECORD-LEN
           add DPOS-UT2 to ZERO giving D-POS
           add DLEN-UT2 to ZERO giving D-LEN
      *    Present in CUACTUAL, missing from CUEXPECT...
           move UT2-MISSING to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           add CUACTUAL-LRECL-M to ZERO giving D-LEN
           if  DUMP-RPI = 'Y'
               perform DUMP-POSITION-INDICATOR
           end-if
           perform DUMP-PRIMARY-RECORD
           move all '#' to DELTA-LINE-2(1:WORK-LENGTH)
           perform DUMP-POSITION-DIFFERENCES-2
           exit.

      *****************************************************************
       DUMP-SECONDARY-RECORD.
           add DPOS-UT2 to ZERO giving RECORD-POS
           add DLEN-UT2 to ZERO giving RECORD-LEN
           add DPOS-UT2 to ZERO giving D-POS
           add DLEN-UT2 to ZERO giving D-LEN
           move 'CUEXPECT..' to RECORD-ID
           add CUEXPECT-RDR to ZERO giving REC-NUMBER
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUEXPECT-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           end-if

           move RECORD-HEADER  to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           perform DUMP-CUEXPECT-TO-SYSUT4
           perform DUMP-POSITION-DIFFERENCES-2
           exit.

      *****************************************************************
       CALC-DELTA-FOR-NE-EQ-NO.
           add POS-UT1 to ZERO giving PTR-1
           add POS-UT2 to ZERO giving PTR-2
           perform until PTR-1 > POS-UT1 + LEN-UT1 - 1
                      or PTR-2 > POS-UT2 + LEN-UT2 - 1
               if CUACTUAL-REC(PTR-1:1)
                = CUEXPECT-REC(PTR-2:1)
                  move '=' to DELTA-LINE-1(PTR-1:1)
                  move '=' to DELTA-LINE-2(PTR-2:1)
               else
                  move '#' to DELTA-LINE-1(PTR-1:1)
                  move '#' to DELTA-LINE-2(PTR-2:1)
               end-if
               add 1 to PTR-1
               add 1 to PTR-2
           end-perform
           exit.

      *****************************************************************
       DUMP-POSITION-DIFFERENCES-1.
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUACTUAL-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           end-if
           move DELTA-LINE-1(1:WORK-LENGTH) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-POSITION-DIFFERENCES-2.
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUEXPECT-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           end-if
           move DELTA-LINE-1(1:WORK-LENGTH) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-CUACTUAL-TO-SYSUT4.
           add 4 to ZERO giving DX-3
           add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           perform 4 times
               perform varying DX-2 from 1 by 1
                   until DX-2 > WORK-LENGTH
                  add 1 to ZERO giving DX-1
                   move CUACTUAL-REC(DX-2:1) to DX-1R-02
                   add 1 to DX-1
                   move TAB-X1(DX-1) to FIVE-BYTES
                   move FIVE-BYTES(DX-3:1) to SYSUT4-REC(DX-2:1)
               end-perform
               perform SYSUT4-WRITE-AND-CLEAR
               if  DX-3 = 4
                   add 1 to ZERO giving DX-3
               else
                   add 1 to DX-3
               end-if
           end-perform
           exit.

      *****************************************************************
       DUMP-CUEXPECT-TO-SYSUT4.
           add 4 to ZERO giving DX-3
           add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           perform 4 times
               perform varying DX-2 from 1 by 1
                   until DX-2 > WORK-LENGTH
                  add 1 to ZERO giving DX-1
                   move CUEXPECT-REC(DX-2:1) to DX-1R-02
                   add 1 to DX-1
                   move TAB-X1(DX-1) to FIVE-BYTES
                   move FIVE-BYTES(DX-3:1) to SYSUT4-REC(DX-2:1)
               end-perform
               perform SYSUT4-WRITE-AND-CLEAR
               if  DX-3 = 4
                   add 1 to ZERO giving DX-3
               else
                   add 1 to DX-3
               end-if
           end-perform
           exit.

      *****************************************************************
       JOB-FINISHED.
           if  CUACTUAL-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform until CUACTUAL-STATUS not = '00'
                 perform CUACTUAL-READ
                 add 1 to COMPARE-NE
               end-perform
           end-if
           if  CUEXPECT-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform until CUEXPECT-STATUS not = '00'
                 perform CUEXPECT-READ
                 add 1 to COMPARE-NE
               end-perform
           end-if
           perform CUEXPECT-CLOSE
           perform CUACTUAL-CLOSE

           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           move 'Conclude' to INFO-ID
           move INFO-SHORT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move 'Finished' to INFO-ID

           move CUACTUAL-TOTAL to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  CUACTUAL-OMT > ZERO
               move CUACTUAL-OMIT to SYSUT4-REC
              perform SYSUT4-WRITE-AND-CLEAR
           end-if

           move CUEXPECT-TOTAL to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  CUEXPECT-OMT > ZERO
               move CUEXPECT-OMIT to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  CUACTUAL-RDR not = CUEXPECT-RDR
               move '* WARNING!  - Record counts are not equal'
                 to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
               move 'ABENDING' to INFO-ID
           end-if

           if  FF-01 = '1'
               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 SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
               move COMPARE-EQ-TOTAL to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  FF-02 = '1'
               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 SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  CUACTUAL-EOF not = 'Y'
           or  CUEXPECT-EOF not = 'Y'
               move 'ABENDING' to INFO-ID
           end-if
           move INFO-STATEMENT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

      *    move INFO-SHORT to MESSAGE-TEXT
      *    perform Z-POST-MESSAGE-TO-SYSOUT

           perform Z-THANK-YOU.

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

      *****************************************************************
       JOB-STARTING.
           perform Z-POST-COPYRIGHT
           perform Z-DETERMINE-ENVIRONMENT
           perform CUACTUAL-OPEN
           perform CUEXPECT-OPEN
           perform SYSUT4-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-POST-MESSAGE-TO-SYSOUT

           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           move SIM-TITLE to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move SIM-COPYRIGHT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           move INFO-STATEMENT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

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

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

      *****************************************************************
      * I/O ROUTINES FOR SYSUT4...                                    *
      *****************************************************************
       SYSUT4-WRITE-AND-CLEAR.
           perform SYSUT4-WRITE
           move SPACES to SYSUT4-REC
           exit.
      *---------------------------------------------------------------*
       SYSUT4-WRITE.
           if  SYSUT4-OPEN-FLAG = 'C'
               perform SYSUT4-OPEN
           end-if
           write SYSUT4-REC
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT4-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
               move 'WRITE Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT4-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open output SYSUT4-FILE
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT4-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT4-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT4-FILE
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SYSUT4-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-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.                                             *
      *****************************************************************
       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-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-POST-MESSAGE-TO-USER
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-USER
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-CALCULATE-MESSAGE-LSB.
           if  MESSAGE-TEXT-2 = SPACES
               add  79 to ZERO giving MSG-LSB
           else
               add 267 to ZERO giving MSG-LSB
           end-if
           perform until MSG-LSB < 80
                      or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE
             if MESSAGE-BUFFER(MSG-LSB:1) = SPACE
                subtract 1 from MSG-LSB
             end-if
           end-perform
           exit.

      *****************************************************************
      * Display message to SYSOUT device...                           *
      *****************************************************************
       Z-POST-MESSAGE-TO-SYSOUT.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display message to CONSOLE device...                          *
      *****************************************************************
       Z-POST-MESSAGE-TO-CONSOLE.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB) upon console
           exit.

      *****************************************************************
       Z-POST-MESSAGE-TO-USER.
           perform Z-POST-MESSAGE-TO-CONSOLE
           perform Z-POST-MESSAGE-TO-SYSOUT
           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-POST-MESSAGE-TO-USER
           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-POST-MESSAGE-TO-USER
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           move SIM-TITLE to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           move SIM-COPYRIGHT to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           move SIM-THANKS-01 to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           move SIM-THANKS-02 to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           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: 2019-09-19  Generation Time: 13:38:48:50    *
      *****************************************************************

Table of Contents Previous Section Next Section Compare via SYSUT3

The following (CUSCP1C3.cbl) is the generated COBOL source code that compares the content of two VSAM, KSDS's. The compare specifications will be externally obtained via SYSUT3 when the program is executed. The compare results will be posted to a line sequential (or ASCII/Text) file.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CUSCP1C3.
       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: 2019-09-19  Generation Time: 13:38:48:70    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   CUACTUAL INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  SECONDARY CUEXPECT INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  INPUT     SYSUT3   ASCII/CRLF    VARIABLE   00080            *
      *  OUTPUT    SYSUT4   ASCII/CRLF    VARIABLE   00512            *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT CUACTUAL-FILE  ASSIGN TO       CUACTUAL
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUACTUAL-PKEY-00001-00012
                  FILE STATUS   IS CUACTUAL-STATUS.
           SELECT CUEXPECT-FILE  ASSIGN TO       CUEXPECT
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUEXPECT-PKEY-00001-00012
                  FILE STATUS   IS CUEXPECT-STATUS.
           SELECT SYSUT3-FILE  ASSIGN TO       SYSUT3
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT3-STATUS.
           SELECT SYSUT4-FILE  ASSIGN TO       SYSUT4
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT4-STATUS.

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

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

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

       FD  SYSUT4-FILE
           DATA RECORD    IS SYSUT4-REC
           .
       01  SYSUT4-REC.
           05  SYSUT4-DATA-01 PIC X(00512).

      *****************************************************************
      * This program was created using the SYSCP341.txt file as the   *
      * template for the data file comparison. This program template  *
      * has the following characteristics.                            *
      * 1. The positions to be compared are determined during the     *
      *    program generation and compilation based on the &COMPARE   *
      *    statements in the Process Control File.                    *
      * 2. For a "NOT Equal" condition the Hex-Dump information will  *
      *    be written to a Line Sequential (LSEQ) File (SYSUT4).      *
      * 3. The DRECLMAX function is supported using this template.    *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 19.00.00          *
      *                                                               *
      *        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 '* CUSCP1C3 '.
           05  T2 pic X(34) value 'Compare Input=SYSUT3 Output=SYSUT4'.
           05  T3 pic X(10) value ' v19.00.00'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CUSCP1C3 '.
           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 '* CUSCP1C3 '.
           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 '* CUSCP1C3 '.
           05  C2 pic X(32) value 'Please send all comments or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

       01  CUACTUAL-STATUS.
           05  CUACTUAL-STATUS-L     pic X.
           05  CUACTUAL-STATUS-R     pic X.
       01  CUACTUAL-EOF              pic X       value 'N'.
       01  CUACTUAL-OPEN-FLAG        pic X       value 'C'.
       01  CUACTUAL-LRECL            pic 9(5)    value 00512.

       01  CUEXPECT-STATUS.
           05  CUEXPECT-STATUS-L     pic X.
           05  CUEXPECT-STATUS-R     pic X.
       01  CUEXPECT-EOF              pic X       value 'N'.
       01  CUEXPECT-OPEN-FLAG        pic X       value 'C'.
       01  CUEXPECT-LRECL            pic 9(5)    value 00512.

       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'.
       01  SYSUT3-LRECL              pic 9(5)    value 00080.

       01  SYSUT4-STATUS.
           05  SYSUT4-STATUS-L       pic X.
           05  SYSUT4-STATUS-R       pic X.
       01  SYSUT4-EOF                pic X       value 'N'.
       01  SYSUT4-OPEN-FLAG          pic X       value 'C'.
       01  SYSUT4-LRECL              pic 9(5)    value 00512.


      *****************************************************************
      * 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 for posting user-defined messages.             *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(011)  value '* CUSCP1C3 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(068)  value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.
       01  MSG-LSB                 pic 9(3)    value 267.

      *****************************************************************
       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 00012.
       01  KEY-CONTROL-2.
           05  K-PS-2              pic 9(5)    value 00001.
           05  K-LN-2              pic 9(5)    value 00012.

       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-RPI        pic X       value 'Y'.
           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 'NE'.
           05  DUMP-SUM        pic X       value 'Y'.
           05  DUMP-STATUS     pic x       VALUE 'Y'.
       01  DUMP-PGM            pic X(8)    value 'SYSUT4  '.

       01  DPOS-UT1            pic 9(5)    value 1.
       01  DLEN-UT1            pic 9(5)    value 00512.
       01  DPOS-UT2            pic 9(5)    value 1.
       01  DLEN-UT2            pic 9(5)    value 00512.

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

       01  COMPACT-STATUS  pic XX      value 'EQ'.
       01  COMPACT-PENDED  pic XX      value 'EQ'.
       01  COMPARE-STATUS  pic XX      value 'EQ'.
       01  FLAG-EQ         pic XX      value 'EQ'.
       01  FLAG-NE         pic XX      value 'NE'.
       01  FLAG-QT         pic XX      value 'QT'.
       01  DELTA-LINE-1    pic X(00512)  value all '-'.
       01  DELTA-LINE-2    pic X(00512)  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  BYPASS-UT1-CTR  pic 9(3)    value 0.
       01  BYPASS-UT2-CTR  pic 9(3)    value 0.

       01  FIVE-BYTES              pic X(5).

       01  DX-1                    pic 9(3)    BINARY.
       01  DX-1R                   REDEFINES DX-1.
           05  DX-1R-01            pic X.
           05  DX-1R-02            pic X.
       01  DX-2                    pic 9(3)    BINARY.
       01  DX-3                    pic 9(3)    BINARY.


       01  WORK-02-COMP            pic 9(4)  COMP.
       01  WORK-02-X               redefines WORK-02-COMP.
           05  WORK-02-X-X1        pic X.
           05  WORK-02-X-X2        pic X.

       01  WORK-LENGTH             pic 9(5)  value 0.

       01  WORK-05         pic X(5)    value SPACES.
       01  WORK-05-A       pic X(5)    value SPACES.
       01  WORK-05-E       pic X(5)    value SPACES.
       01  PTR-A-ZD-3      pic 999     value 0.
       01  PTR-E-ZD-3      pic 999     value 0.
       01  A-FLAG          pic X       value 'N'.
       01  E-FLAG          pic X       value 'N'.

       01  DELTA-MAX-ABEND.
           05  FILLER          pic X(10)
                               value 'ABENDING, '.
           05  FILLER          pic X(24)
                               value 'Not Equal count exceeds '.
           05  FILLER          pic X(22)
                               value 'user-defined limit of '.
           05  DELTA-MAXIMUM-X pic X(9)
                               value '&&&&&&&&&'.
           05  DELTA-MAXIMUM   redefines DELTA-MAXIMUM-X
                               pic 9(9).
           05  FILLER          pic X(19)
                               value ', ABEND process is '.
           05  DELTA-PROCESS   pic X(4)
                               value 'EOF '.

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

       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  LEN-UT1         pic 9(5)    value 128.
       01  POS-UT1         pic 9(5)    value 1.
       01  LEN-UT2         pic 9(5)    value 128.
       01  POS-UT2         pic 9(5)    value 1.

       01  CUACTUAL-LRECL-M  pic 9(5)    value 00512.
       01  CUEXPECT-LRECL-M  pic 9(5)    value 00512.

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

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

       01  DUMP-RECL-MAX-S pic X       value 'N'.
       01  DUMP-RECL-MAX   pic 9(5)    value 00000.

       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(00512)  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  DUMP-HDR-POS    pic 9(5)      value 1.
       01  DUMP-HDR-LEN    pic 9(5)      value 00512.

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

       01  INFO-STATEMENT.
           05  INFO-SHORT.
               10  filler  pic X(2)    value '* '.
               10  INFO-ID pic X(8)    value 'Starting'.
               10  filler  pic X(4)    value '  - '.
               10  INFO-34 pic X(34)
                   value   'Compare Input=SYSUT3 Output=SYSUT4'.
           05  filler      pic X(31)
               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 CUACTUAL'.
           05  filler      pic X(7)  value ' - the '.
           05  filler      pic X(29)
                           value 'record is PRESENT in CUEXPECT'.

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

       01  CUACTUAL-TOTAL.
           05  filler      pic X(2)  value '* '.
           05  CUACTUAL-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for CUACTUAL'.
       01  CUEXPECT-TOTAL.
           05  filler      pic X(2)  value '* '.
           05  CUEXPECT-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for CUEXPECT'.
       01  SYSUT3-TOTAL.
           05  filler      pic X(2)  value '* '.
           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  CUACTUAL-OMIT.
           05  filler      pic X(2)  value '* '.
           05  CUACTUAL-OMT  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Bypass count for CUACTUAL'.
       01  CUEXPECT-OMIT.
           05  filler      pic X(2)  value '* '.
           05  CUEXPECT-OMT  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Bypass count for CUEXPECT'.
       01  COMPARE-NE-TOTAL.
           05  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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  filler      pic X(2)  value '* '.
           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'.

      *    For Execution Time Specifications
       01  SYSLOG-OUTPUT   pic X(4)    value 'OUT1'.
       01  SYSUT3-KEYWORD  pic X(10)   value SPACES.

       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  COMPARE-TABLE-STMT.
           05  filler          pic X(10)   value '* Compare '.
           05  filler          pic X(14)   value ' CUACTUAL POS='.
           05  CTS-POS-1       pic 9(5)    value 0.
           05  filler          pic X(5)    value ' LEN='.
           05  CTS-LEN-1       pic 9(5)    value 0.
           05  filler          pic X(14)   value ' CUEXPECT POS='.
           05  CTS-POS-2       pic 9(5)    value 0.
           05  filler          pic X(5)    value ' LEN='.
           05  CTS-LEN-2       pic 9(5)    value 0.

       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  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 HEXTABLE.
      *COPY PAENVARS.

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

           perform
               until COMPARE-STATUS = 'QT'
               or    CUACTUAL-STATUS not = '00'
               or    CUEXPECT-STATUS not = '00'
               if  READ-1 = 'Y'
                   perform CUACTUAL-READ
               end-if
               if  READ-2 = 'Y'
                   perform CUEXPECT-READ
               end-if
               if  CUACTUAL-STATUS = '00'
               and CUEXPECT-STATUS = '00'
                   move 'EQ' to COMPARE-STATUS
                   move 'N' to DUMP-STATUS
                   move all '-' to DELTA-LINE-1
                   move all '-' to DELTA-LINE-2
                   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  DUMP-STATUS = 'Y'
                       if  GROUP-DELIMITER = 'Y'
                           perform DUMP-ASTERISK-ONE
                       end-if
                       add CUACTUAL-LRECL-M to ZERO giving D-LEN
                       if  DUMP-RPI = 'Y'
                           perform DUMP-POSITION-INDICATOR
                       end-if
                       perform DUMP-PRIMARY-RECORD
                       perform DUMP-POSITION-DIFFERENCES-1
                       perform DUMP-SECONDARY-RECORD
                       perform DUMP-POSITION-DIFFERENCES-2
                       add CUEXPECT-LRECL-M to ZERO giving D-LEN
                       move 'N' to DUMP-STATUS
                   end-if

                   if  COMPARE-STATUS = FLAG-NE
                       add 1 to COMPARE-NE
                   end-if
               else
                   if  CUACTUAL-STATUS = '00'
                   or  CUEXPECT-STATUS = '00'
                       if  KEY-ACTIVE = 'Y'
                           perform COMPARE-KEYS
                       end-if
                   end-if
                   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 DELTA-MAX-ABEND to MESSAGE-TEXT
                   move MESSAGE-BUFFER to SYSUT4-REC
                   perform SYSUT4-WRITE-AND-CLEAR
                   perform Z-ABEND-PROGRAM
               end-if
               if  DELTA-PROCESS = 'EOF '
               and COMPARE-NE > DELTA-MAXIMUM
                   move DELTA-MAX-ABEND to MESSAGE-TEXT
                   move MESSAGE-BUFFER to SYSUT4-REC
                   perform SYSUT4-WRITE-AND-CLEAR
                   perform Z-POST-MESSAGE-TO-USER
                   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
             add POS-1(CX-1) to ZERO giving POS-UT1
             add LEN-1(CX-1) to ZERO giving LEN-UT1
             add POS-2(CX-1) to ZERO giving POS-UT2
             add LEN-2(CX-1) to ZERO giving LEN-UT2

             if  CUACTUAL-REC(POS-1(CX-1):LEN-1(CX-1))
                 not = CUEXPECT-REC(POS-2(CX-1):LEN-2(CX-1))
                 move FLAG-NE to COMPARE-STATUS
                 perform CALC-DELTA-FOR-NE-EQ-NO
             else
                 move all '=' to DELTA-LINE-1(POS-1(CX-1):LEN-1(CX-1))
                 move all '=' to DELTA-LINE-2(POS-2(CX-1):LEN-2(CX-1))
             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

           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 POS-UT1
               add LEN-1(CX-1) to ZERO giving D-LEN
               add LEN-1(CX-1) to ZERO giving LEN-UT1
               if  DUMP-DET-GRP = 'YNE'
                   if  GROUP-DELIMITER = 'Y'
                       move all '*' to SYSUT4-REC(1:79)
                       move COMPARE-STATUS
                         to SYSUT4-REC(78:2)
                       perform SYSUT4-WRITE-AND-CLEAR
                   end-if
                   add POS-2(CX-1) to ZERO giving D-POS
                   add POS-2(CX-1) to ZERO giving POS-UT2
                   add LEN-2(CX-1) to ZERO giving D-LEN
                   add LEN-2(CX-1) to ZERO giving LEN-UT2
                   if  DUMP-RPI = 'Y'
                       perform DUMP-POSITION-INDICATOR
                   end-if
                   perform DUMP-PRIMARY-RECORD
                   perform DUMP-POSITION-DIFFERENCES-1
                   perform DUMP-SECONDARY-RECORD
                   perform DUMP-POSITION-DIFFERENCES-2
               end-if
           end-if
           exit.


      *****************************************************************
       COMPARE-KEYS.
           move YES-YES to READ-FLAGS
           if  CUACTUAL-REC(K-PS-1:K-LN-1)
            >  CUEXPECT-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  CUACTUAL-REC(K-PS-1:K-LN-1)
            <  CUEXPECT-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.

      *****************************************************************
      *    Build the position header row...
      *****************************************************************
       DUMP-ASTERISK-ONE.
           move SPACES to SYSUT4-REC
           move '*'    to SYSUT4-REC(1:1)
           perform SYSUT4-WRITE-AND-CLEAR
           exit.
      *****************************************************************
       DUMP-ASTERISK-ROW.
           move SPACES  to SYSUT4-REC
           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       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 ZERO giving WK-2
           perform varying D-P1 from 1 by 10
                     until D-P1 > DUMP-HDR-LEN - 10
               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:DUMP-HDR-LEN) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-PRIMARY-MISSING.
           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if
           add DPOS-UT2 to ZERO giving RECORD-POS
           add DLEN-UT2 to ZERO giving RECORD-LEN
           add DPOS-UT2 to ZERO giving D-POS
           add DLEN-UT2 to ZERO giving D-LEN
      *    Present in CUEXPECT, missing from CUACTUAL...
           move UT1-MISSING to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  DUMP-RPI = 'Y'
               perform DUMP-POSITION-INDICATOR
           end-if
           perform DUMP-SECONDARY-RECORD
           move all '#' to DELTA-LINE-1(1:WORK-LENGTH)
           perform DUMP-POSITION-DIFFERENCES-1
           exit.

      *****************************************************************
       DUMP-PRIMARY-RECORD.
           add DPOS-UT1 to ZERO giving RECORD-POS
           add DLEN-UT1 to ZERO giving RECORD-LEN
           add DPOS-UT1 to ZERO giving D-POS
           add DLEN-UT1 to ZERO giving D-LEN
           move 'CUACTUAL..' to RECORD-ID
           add CUACTUAL-RDR to ZERO giving REC-NUMBER

           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUACTUAL-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           end-if
           add            1 to ZERO giving RECORD-POS
           add CUACTUAL-LRECL to ZERO giving RECORD-LEN

           move RECORD-HEADER  to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           perform DUMP-CUACTUAL-TO-SYSUT4
           exit.

      *****************************************************************
       DUMP-SECONDARY-MISSING.
           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if
           add DPOS-UT2 to ZERO giving RECORD-POS
           add DLEN-UT2 to ZERO giving RECORD-LEN
           add DPOS-UT2 to ZERO giving D-POS
           add DLEN-UT2 to ZERO giving D-LEN
      *    Present in CUACTUAL, missing from CUEXPECT...
           move UT2-MISSING to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  DUMP-RPI = 'Y'
               perform DUMP-POSITION-INDICATOR
           end-if
           perform DUMP-PRIMARY-RECORD
           move all '#' to DELTA-LINE-2(1:WORK-LENGTH)
           perform DUMP-POSITION-DIFFERENCES-2
           exit.

      *****************************************************************
       DUMP-SECONDARY-RECORD.
           add POS-UT2 to ZERO giving RECORD-POS
           add LEN-UT2 to ZERO giving RECORD-LEN
           add POS-UT2 to ZERO giving D-POS
           add LEN-UT2 to ZERO giving D-LEN
           move 'CUEXPECT..' to RECORD-ID
           add CUEXPECT-RDR to ZERO giving REC-NUMBER
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUEXPECT-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           end-if
           add            1 to ZERO giving RECORD-POS
           add CUACTUAL-LRECL to ZERO giving RECORD-LEN

           move RECORD-HEADER  to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           perform DUMP-CUEXPECT-TO-SYSUT4
           exit.

      *****************************************************************
       CALC-DELTA-FOR-NE-EQ-NO.
           add POS-UT1 to ZERO giving PTR-1
           add POS-UT2 to ZERO giving PTR-2
           perform until PTR-1 > POS-UT1 + LEN-UT1 - 1
                      or PTR-2 > POS-UT2 + LEN-UT2 - 1
               if CUACTUAL-REC(PTR-1:1)
                = CUEXPECT-REC(PTR-2:1)
                  move '=' to DELTA-LINE-1(PTR-1:1)
                  move '=' to DELTA-LINE-2(PTR-2:1)
               else
                  move '#' to DELTA-LINE-1(PTR-1:1)
                  move '#' to DELTA-LINE-2(PTR-2:1)
               end-if
               add 1 to PTR-1
               add 1 to PTR-2
           end-perform
           exit.

      *****************************************************************
       DUMP-POSITION-DIFFERENCES-1.
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUACTUAL-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           end-if
           move DELTA-LINE-1(1:WORK-LENGTH) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-POSITION-DIFFERENCES-2.
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < CUEXPECT-LRECL-M
               add DUMP-RECL-MAX to ZERO giving WORK-LENGTH
           else
               add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           end-if
           move DELTA-LINE-1(1:WORK-LENGTH) to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           exit.

      *****************************************************************
       DUMP-CUACTUAL-TO-SYSUT4.
           add 4 to ZERO giving DX-3
           add CUACTUAL-LRECL-M to ZERO giving WORK-LENGTH
           perform 4 times
               perform varying DX-2 from 1 by 1
                   until DX-2 > WORK-LENGTH
                  add 1 to ZERO giving DX-1
                   move CUACTUAL-REC(DX-2:1) to DX-1R-02
                   add 1 to DX-1
                   move TAB-X1(DX-1) to FIVE-BYTES
                   move FIVE-BYTES(DX-3:1) to SYSUT4-REC(DX-2:1)
               end-perform
               perform SYSUT4-WRITE-AND-CLEAR
               if  DX-3 = 4
                   add 1 to ZERO giving DX-3
               else
                   add 1 to DX-3
               end-if
           end-perform
           exit.

      *****************************************************************
       DUMP-CUEXPECT-TO-SYSUT4.
           add 4 to ZERO giving DX-3
           add CUEXPECT-LRECL-M to ZERO giving WORK-LENGTH
           perform 4 times
               perform varying DX-2 from 1 by 1
                   until DX-2 > WORK-LENGTH
                  add 1 to ZERO giving DX-1
                   move CUEXPECT-REC(DX-2:1) to DX-1R-02
                   add 1 to DX-1
                   move TAB-X1(DX-1) to FIVE-BYTES
                   move FIVE-BYTES(DX-3:1) to SYSUT4-REC(DX-2:1)
               end-perform
               perform SYSUT4-WRITE-AND-CLEAR
               if  DX-3 = 4
                   add 1 to ZERO giving DX-3
               else
                   add 1 to DX-3
               end-if
           end-perform
           exit.

      *****************************************************************
       JOB-FINISHED.
           if  CUACTUAL-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform until CUACTUAL-STATUS not = '00'
                 perform CUACTUAL-READ
                 add 1 to COMPARE-NE
               end-perform
           end-if
           if  CUEXPECT-STATUS = '00'
           and DELTA-PROCESS   = 'EOF '
               perform until CUEXPECT-STATUS not = '00'
                 perform CUEXPECT-READ
                 add 1 to COMPARE-NE
               end-perform
           end-if
           perform CUEXPECT-CLOSE
           perform CUACTUAL-CLOSE

           if  GROUP-DELIMITER = 'Y'
               move all '*' to SYSUT4-REC(1:79)
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           move 'Conclude' to INFO-ID
           move INFO-SHORT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move 'Finished' to INFO-ID

           move CUACTUAL-TOTAL to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  CUACTUAL-OMT > ZERO
               move CUACTUAL-OMIT to SYSUT4-REC
              perform SYSUT4-WRITE-AND-CLEAR
           end-if

           move CUEXPECT-TOTAL to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  CUEXPECT-OMT > ZERO
               move CUEXPECT-OMIT to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  CUACTUAL-RDR not = CUEXPECT-RDR
               move '* WARNING!  - Record counts are not equal'
                 to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
               move 'ABENDING' to INFO-ID
           end-if

           if  FF-01 = '1'
               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 SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
               move COMPARE-EQ-TOTAL to SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  FF-02 = '1'
               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 SYSUT4-REC
               perform SYSUT4-WRITE-AND-CLEAR
           end-if

           if  CUACTUAL-EOF not = 'Y'
           or  CUEXPECT-EOF not = 'Y'
               move 'ABENDING' to INFO-ID
           end-if
           move INFO-STATEMENT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

      *    move INFO-SHORT to MESSAGE-TEXT
      *    perform Z-POST-MESSAGE-TO-SYSOUT

           perform Z-THANK-YOU.

           if  COMPARE-NE > 0
           or  CUACTUAL-RDR not = CUEXPECT-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 CUACTUAL-OPEN
           perform CUEXPECT-OPEN
           perform SYSUT4-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-POST-MESSAGE-TO-SYSOUT

           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           move SIM-TITLE to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move SIM-COPYRIGHT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR
           move all '*' to SYSUT4-REC(1:79)
           perform SYSUT4-WRITE-AND-CLEAR
           move INFO-STATEMENT to SYSUT4-REC
           perform SYSUT4-WRITE-AND-CLEAR

           if  CX-ACTIVE > 0
               add 1 to ZERO giving CX-1
               perform until CX-1 > CX-ACTIVE
                 add POS-1(CX-1) to ZERO giving CTS-POS-1
                 add LEN-1(CX-1) to ZERO giving CTS-LEN-1
                 add POS-2(CX-1) to ZERO giving CTS-POS-2
                 add LEN-2(CX-1) to ZERO giving CTS-LEN-2
                 move  COMPARE-TABLE-STMT to SYSUT4-REC
                 perform SYSUT4-WRITE-AND-CLEAR
                 add 1 to CX-1
               end-perform
           end-if
           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-POST-MESSAGE-TO-SYSOUT
                 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-POST-MESSAGE-TO-SYSOUT
                     move 'SYSUT3 - Active Compare Statements = &&&'
                       to MESSAGE-TEXT
                     inspect MESSAGE-TEXT replacing first '&&&'
                                                       by CX-ACTIVE
                     perform Z-POST-MESSAGE-TO-SYSOUT
                     move 'SYSUT3 - Active Statement Count is = &&&'
                       to MESSAGE-TEXT
                     inspect MESSAGE-TEXT replacing first '&&&'
                                                       by SYSUT3-STMTS
                     perform Z-POST-MESSAGE-TO-SYSOUT
                 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 '/DSTRUT1  '
                      perform PROCESS-CONTROL-DSTRUT1
                 when '/DSTRUT2  '
                      perform PROCESS-CONTROL-DSTRUT2
                 when '/DSTRING  '
                      perform PROCESS-CONTROL-DSTRING
                 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-DSTRING.
           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 DPOS-UT1
                   add WORK-05-N to ZERO giving DPOS-UT2
               else
                   move 'Error, /DSTRING Position ' to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move 'Error, /DSTRING Position ' 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 DLEN-UT1
                   add WORK-05-N to ZERO giving DLEN-UT2
               else
                   move 'Error, /DSTRING Length ' to MESSAGE-TEXT
                   perform Z-ABEND-PROGRAM
               end-if
           else
               move 'Error, /DSTRING Length ' to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if

           add 1 to SYSUT3-STMTS
           exit.

      *****************************************************************
       PROCESS-CONTROL-DSTRUT1.

           exit.

      *****************************************************************
       PROCESS-CONTROL-DSTRUT2.

           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
                     when 'RPI  ' move 'Y' to DUMP-RPI
                     when 'NORPI' move 'N' to DUMP-RPI
                   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 Primary File...                          *
      *****************************************************************
       CUACTUAL-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close CUACTUAL-FILE
           if  CUACTUAL-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with CUACTUAL' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move CUACTUAL-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       CUACTUAL-READ.
           read CUACTUAL-FILE
           if  CUACTUAL-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               add 1 to CUACTUAL-RDR
           else
               if  CUACTUAL-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if
           if  APPL-AOK
               CONTINUE
           else
               if  APPL-EOF
                   move 'Y' to CUACTUAL-EOF
               else
                   move 'READ Failure with CUACTUAL' to MESSAGE-TEXT
                   perform Z-POST-MESSAGE-TO-USER
                   move CUACTUAL-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       CUACTUAL-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input CUACTUAL-FILE
           if  CUACTUAL-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to CUACTUAL-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with CUACTUAL' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move CUACTUAL-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

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

      *****************************************************************
      * I/O Routines for the Control File...                          *
      *****************************************************************
       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-POST-MESSAGE-TO-USER
                   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-POST-MESSAGE-TO-USER
               move SYSUT3-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       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-POST-MESSAGE-TO-USER
               move SYSUT3-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O ROUTINES FOR SYSUT4...                                    *
      *****************************************************************
       SYSUT4-WRITE-AND-CLEAR.
           perform SYSUT4-WRITE
           move SPACES to SYSUT4-REC
           exit.
      *---------------------------------------------------------------*
       SYSUT4-WRITE.
           if  SYSUT4-OPEN-FLAG = 'C'
               perform SYSUT4-OPEN
           end-if
           write SYSUT4-REC
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT4-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
               move 'WRITE Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT4-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open output SYSUT4-FILE
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT4-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT4-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT4-FILE
           if  SYSUT4-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SYSUT4-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with SYSUT4  ' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-USER
               move SYSUT4-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.                                             *
      *****************************************************************
       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-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-POST-MESSAGE-TO-USER
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-USER
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-CALCULATE-MESSAGE-LSB.
           if  MESSAGE-TEXT-2 = SPACES
               add  79 to ZERO giving MSG-LSB
           else
               add 267 to ZERO giving MSG-LSB
           end-if
           perform until MSG-LSB < 80
                      or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE
             if MESSAGE-BUFFER(MSG-LSB:1) = SPACE
                subtract 1 from MSG-LSB
             end-if
           end-perform
           exit.

      *****************************************************************
      * Display message to SYSOUT device...                           *
      *****************************************************************
       Z-POST-MESSAGE-TO-SYSOUT.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display message to CONSOLE device...                          *
      *****************************************************************
       Z-POST-MESSAGE-TO-CONSOLE.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB) upon console
           exit.

      *****************************************************************
       Z-POST-MESSAGE-TO-USER.
           perform Z-POST-MESSAGE-TO-CONSOLE
           perform Z-POST-MESSAGE-TO-SYSOUT
           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-POST-MESSAGE-TO-USER
           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-POST-MESSAGE-TO-USER
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           move SIM-TITLE to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           move SIM-COPYRIGHT to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           move SIM-THANKS-01 to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           move SIM-THANKS-02 to MESSAGE-BUFFER
           perform Z-POST-MESSAGE-TO-SYSOUT
           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: 2019-09-19  Generation Time: 13:38:48:77    *
      *****************************************************************

Table of Contents Previous Section Next Section Summary

The requirement for this Test Case is to create data file compare programs that will compare two VSAM, KSDS's or Indexed Files. The compare programs have the capability of comparing the full record content or a segment of data within a record. This document may serve 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 documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

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 JCL Connection for more examples of JCL functionality with programming techniques and sample code.

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 An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

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

Link to Internet   Link to Server   Explore The File Status Return Codes that are used 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 (including Micro Focus COBOL) 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 Contact or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

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 simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
Compare Selected Positions within Records for VSAM, Key Sequenced Data Sets
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com