Data Validation
Single Byte Compare
  Table of Contents  v-24.01.01 - cpbyte01.htm 
  Introduction
  Batch Job Objectives
  Batch Job Results
  Compare Results are Equal
  Compare Results are Not Equal
  Batch Job Requirements
  Batch Job Overview
  Batch Job Scripts
  Windows CMD Files
  CMD to Create Test Files
  Compare with Equal Result
  Compare with Not Equal Result
  COBOL Members
  Compare Program
  Technical Details
  Copy File for Hex Dump
  Copy File for BFLAGSB1
  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

This test case was used to evaluate the feasibility of using a single COBOL program to compare the content of two non-relational data structures of unknown origin. The idea was to access the data as sequential files containing one-byte records.

A Windows System with Micro Focus COBOL and the SimoTime Library are required to generate, compile and execute the programs used in this test case.

Explore the SIMOTIME Web Site for additional information about the technologies and services that are available.


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

Table of Contents Previous Section Next Section Batch Job Objectives

This example illustrates the following functions.

1. Describe and demonstrate how to generate a new COBOL program that will compare two data files. This will be done using SimoTime Technologies.
2. Describe and demonstrate how to use a job script to allocate resources and execute a data file compare that produces an "Equal" result.
3. Describe and demonstrate how to use a job script to allocate resources and execute a data file compare that produces a "Not Equal" result.
4. Describe and demonstrate how to use a job script to create the test files used by this test case.
5. Demonstrate how to write to a SYSOUT device.
 

 

The preceding is a list of the Batch Job Objectives.

Table of Contents Previous Section Next Section Batch Job Results

The following shows the information written to the SYSLUSER file. Two sample outputs are provided.

Table of Contents Previous Section Next Section Compare Results are Equal

The following is produced when the compare is Equal.

*******************************************************************************
* CPBYTEC1 Do a Physical 1-Byte Comparison    v18.06.01   helpdesk@simotime.com
* CPBYTEC1 This Data File Compare Member was generated by SimoTime Technologies
*******************************************************************************
Starting  - Do a Physical 1-Byte Comparison             http://www.SimoTime.com
*******************************************************************************
Conclude  - Do a Physical 1-Byte Comparison
000000078 - Record count for SYSUT1
000000078 - Record count for SYSUT2
000000000 - NOT Equal count for compare is ZERO
000000078 - Number of matching record pairs for Compare Task
Finished  - Do a Physical 1-Byte Comparison             http://www.SimoTime.com

Table of Contents Previous Section Next Section Compare Results are Not Equal

The following is produced when the compare is Not Equal.

*******************************************************************************
* CPBYTEC1 Do a Physical 1-Byte Comparison    v18.06.01   helpdesk@simotime.com
* CPBYTEC1 This Data File Compare Member was generated by SimoTime Technologies
*******************************************************************************
Starting  - Do a Physical 1-Byte Comparison             http://www.SimoTime.com
*
.
SYSUT1....000000045(00001:00001) COMPARISON  PHYSICAL
s
7
3
Ë
#
SYSUT2....000000045(00001:00001) COMPARISON  PHYSICAL
S
5
3
ë
#
*******************************************************************************
Conclude  - Do a Physical 1-Byte Comparison
000000078 - Record count for SYSUT1
000000078 - Record count for SYSUT2
000000001 - NOT Equal count for compare of existing records
000000077 - Number of matching record pairs for Compare Task
ABENDING  - Do a Physical 1-Byte Comparison             http://www.SimoTime.com

Table of Contents Previous Section Next Section Batch Job Requirements

This suite of samples programs will run on the following platforms.

1. Requires Microsoft Windows/7 (or later) or Windows/Server.
2. Requires Micro Focus COBOL or GnuCOBOL.
3. Requires the SimoTime Library to be installed. The call to SIMODUMP is a SimoTime utility program that is included in the Library.

 

The preceding is a list of the Batch Job Requirements for the Operating System, Sub-systems and Utility Programs.

Table of Contents Previous Section Next Section Batch Job Overview

The following diagram shows the logic flow for a batch job that describes and demonstrates how to us a template to create a new COBOL program with HEX-dump capability.

             
CPBYTEW1
cmd
Job Script to compare two Sequential Fails
   
SYSUT1
lseq
   
   
CPBYTEC1
cbl
   
   
SYSOUT
lseq
Main Program that does the compare
   
   
   
SYSUT2
lseq
   
   
   
   
   
SIMOL32K
cbl
Refer to Note-1
   
   
   
SYSLUSER
lseq
EOJ
End-Of-Job
 
Note-1: A callable program that does the dump formatting on a NOT Equal condition.
Compare two Files as if they were sequential files with one-byte records.

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using an IBM Mainframe System or Micro Focus Enterprise Developer. The  light-red  boxes are unique to the SIMOTIME Technologies using a Linux, UNIX or Windows System and COBOL Technologies such as Micro Focus. The  light-yellow  boxes are SIMOTIME Technologies, Third-party Technologies, decision points or program transitions in the processing logic or program generations. The  light-blue  boxes identify the input/output data structures such as Documents, Spreadsheets, Data Files, VSAM Data Sets, Partitioned Data Set Members (PDSM's) or Relational Tables. The  light-gray  boxes identify a system function or an informational item.

Table of Contents Previous Section Next Section Batch Job Scripts

This section describes the batch job scripts that are used to create test data files. A Job Script will identify and allocate resources (data files, memory, work areas, control information, etc.) for the Job or Job Step and execute programs that will process, access or utilize the allocated resources.

Table of Contents Previous Section Next Section Windows CMD Files

This section describes the Windows Command Files (or Job Scripts) that are used to create test files and execute the test cases.

Table of Contents Previous Section Next Section CMD to Create Test Files

The following Job Script (CPBYTEW8.cmd) is a listing of the Windows CMD file that is needed to prepare the system and job environments and execute the programs that will create the test data.

@echo OFF
     set CmdName=CPBYTEW8
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  * Step 1, Set Base Environment, Delete any previously created files.
rem  *
     call ..\ENV1BASE %CmdName%
     set JOBSTATUS=0
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
     call SimoNOTE "* This process will create three ASCII/Text files by using the"
     call SimoNOTE "* echo function to pipe data records from this command file to "
     call SimoNOTE "* the output files."
     call SimoNOTE "*"
     set CPBYTET1=%BASECAT%\TXT1\SIMOTIME.DATA.CPBYTET1.txt
     set CPBYTET2=%BASECAT%\TXT1\SIMOTIME.DATA.CPBYTET2.txt
     set CPBYTET3=%BASECAT%\TXT1\SIMOTIME.DATA.CPBYTET3.txt
     call SimoNOTE "DataMAKE %CPBYTET1%"
     call SimoNOTE "DataMAKE %CPBYTET2%"
     call SimoNOTE "DataMAKE %CPBYTET3%"
     call SimoNOTE "*"
rem  *
rem  ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....:...10....:...11....:...12....:...13....:...
echo Record 001 - Text string>%CPBYTET1%
echo Record 002 - Text string>>%CPBYTET1%
echo Record 003 - Text string>>%CPBYTET1%
rem  *
rem  ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....:...10....:...11....:...12....:...13....:...
echo Record 001 - Text string>%CPBYTET2%
echo Record 002 - Text string>>%CPBYTET2%
echo Record 003 - Text string>>%CPBYTET2%
rem  *
rem  ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....:...10....:...11....:...12....:...13....:...
echo Record 001 - Text string>%CPBYTET3%
echo Record 002 - Text String>>%CPBYTET3%
echo Record 003 - Text string>>%CPBYTET3%
     goto :EOJ
rem  *
rem  * *******************************************************************
:EOJ
     if not exist %CPBYTET1% set JOBSTATUS=10
     if "%JOBSTATUS%" == "10" goto :EojNok
     if not exist %CPBYTET2% set JOBSTATUS=20
     if "%JOBSTATUS%" == "20" goto :EojNok
     if not exist %CPBYTET3% set JOBSTATUS=30
     if "%JOBSTATUS%" == "30" goto :EojNok
:EojAok
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Compare with Equal Result

The following Job Script (CPBYTEW1.cmd) is a listing of the Windows CMD file that is used to do a data file compare that produces an "Equal" compare result.

WIP

@echo OFF
     set CmdName=CPBYTEW1
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  * Step 1, Set Base Environment, Delete any previously created files.
rem  *
     call ..\ENV1BASE %CmdName%
     set JOBSTATUS=0
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
     call SimoNOTE "* This process will compare two files"
     set SYSLUSER=%BASELIB1%\LOGS\SYSLUSER_CPBYTEW1.txt
     set SYSUT1=%BASECAT%\TXT1\SIMOTIME.DATA.CPBYTET1.txt
     set SYSUT2=%BASECAT%\TXT1\SIMOTIME.DATA.CPBYTET2.txt
     call SimoNOTE "DataTAKE %SYSUT1%"
     call SimoNOTE "DataTAKE %SYSUT2%"
     run CPBYTEC1
     goto :EOJ
rem  *
rem  * *******************************************************************
:EOJ
     if "%ERRORLEVEL%" == "0" goto :EojAok
     goto :EojNok
:EojAok
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Compare with Not Equal Result

The following Job Script (CPBYTEW2.cmd) is a listing of the Windows CMD file that is needed to prepare the system and job environments and execute the programs that is used to do a data file compare that produces a "Not Equal" compare result.

WIP

@echo OFF
     set CmdName=CPBYTEW2
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  * Step 1, Set Base Environment, Delete any previously created files.
rem  *
     call ..\ENV1BASE %CmdName%
     set JOBSTATUS=0
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "* Starting Batch Job Script - %CmdName%"
rem  * *******************************************************************
     call SimoNOTE "* Step 1 of 3, Prepare the System and Job Environment"
     call SimoNOTE "* This process will compare two files"
     set SYSLUSER=%BASELIB1%\LOGS\SYSLUSER_CPBYTEW2.txt
     set SYSUT1=%BASECAT%\TXT1\SIMOTIME.DATA.CPBYTET1.txt
     set SYSUT2=%BASECAT%\TXT1\SIMOTIME.DATA.CPBYTET3.txt
     call SimoNOTE "* DataTAKE %SYSUT1%"
     call SimoNOTE "* DataTAKE %SYSUT2%"
rem  *
rem  * *******************************************************************
     call SimoNOTE "* Step 2 of 3, Compare the two data files"
     run CPBYTEC1
     goto :EOJ
rem  *
rem  * *******************************************************************
:EOJ
     call SimoNOTE "* Step 3 of 3, End of Job Processing"
     if not "%ERRORLEVEL%" == "0" set JobStatus=10
     if "%JobStatus%" == "10" goto :EojNok
     goto :EojAok
:EojAok
     call SimoNOTE "* Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "* ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
:End
     call SimoNOTE "* Conclude SYSOUT is %SYSOUT%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section COBOL Members

This section describes the COBOL Members that are are used to compare two data files and post the results to the SYSOUT device.

Table of Contents Previous Section Next Section Compare Program

This program (CPBYTEC1.cbl) is the source member that is used to do the data file compare.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CPBYTEC1.
       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-05-20  Generation Time: 22:23:09:24    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   SYSUT1   SEQUENTIAL    FIXED      00001            *
      *                                                               *
      *  SECONDARY SYSUT2   SEQUENTIAL    FIXED      00001            *
      *                                                               *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT SYSUT1-FILE  ASSIGN TO       SYSUT1
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT1-STATUS.
           SELECT SYSUT2-FILE  ASSIGN TO       SYSUT2
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT2-STATUS.

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

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

      *****************************************************************
      * This program was created using the SYSCOMP5.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 based on the &COMPARE statements in    *
      *     the Process Control File.                                 *
      * 2. The Hex-Dump information will be written to a Line         *
      *    Sequential (LSEQ) File using the SIMOL32K program.         *
      * 3. The DRECLMAX function is supported using this template.    *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 18.06.01          *
      *                                                               *
      *        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 '* CPBYTEC1 '.
           05  T2 pic X(34) value 'Do a Physical 1-Byte Comparison   '.
           05  T3 pic X(10) value ' v18.06.01'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CPBYTEC1 '.
           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 '* CPBYTEC1 '.
           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 '* CPBYTEC1 '.
           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  SYSUT1-STATUS.
           05  SYSUT1-STATUS-L     pic X.
           05  SYSUT1-STATUS-R     pic X.
       01  SYSUT1-EOF              pic X       value 'N'.
       01  SYSUT1-OPEN-FLAG        pic X       value 'C'.

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

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

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

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

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

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

       01  READ-FLAGS.
           05  READ-1          pic X       value 'Y'.
           05  READ-2          pic X       value 'Y'.
       01  DUMP-FLAGS.
           05  DUMP-ASC        pic X       value 'Y'.
           05  DUMP-EBC        pic X       value 'Y'.
           05  DUMP-HEX        pic X       value 'Y'.
           05  DUMP-DET-GRP.
               10  DUMP-DET    pic X       value 'Y'.
               10  DUMP-DET-2  pic XX      value 'NE'.
           05  DUMP-SUM        pic X       value 'Y'.
           05  DUMP-STATUS     pic x       VALUE 'Y'.
       01  DUMP-PGM            pic X(8)    value 'SIMOL32K'.

       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(00001)  value all '-'.
       01  DELTA-LINE-2    pic X(00001)  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  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-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 0012.

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

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

       01  SYSUT1-LRECL-M  pic 9(5)    value 00001.
       01  SYSUT2-LRECL-M  pic 9(5)    value 00001.

       01  D-LEN           pic 9(5)    value 00001.
       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(00001)  value all '.'.
       01  D-P1            pic 9(5)      value 0.
       01  WK-1            pic 9(5)      value 0.
       01  WK-2            pic 9(5)      value 0.

       01  RECORD-HEADER.
           05  RECORD-ID   pic X(8)    value 'SYSUT1'.
           05  filler      pic X(2)    value '..'.
           05  REC-NUMBER  pic 9(9)    value 0.
           05  filler      pic X       value '('.
           05  RECORD-POS  pic 9(5)    value 0.
           05  filler      pic X       value ':'.
           05  RECORD-LEN  pic 9(5)    value 0.
           05  filler      pic X(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  INFO-ID pic X(8)    value 'Starting'.
               10  filler  pic X(4)    value '  - '.
               10  INFO-34 pic X(34)
                   value   'Do a Physical 1-Byte Comparison   '.
           05  filler      pic X(33)
               value '          http://www.SimoTime.com'.

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

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

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

       01  FORMAT-TYPE     pic X     value 'B'.

       COPY PASSULOG.
       COPY PAENVARS.

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

           perform
               until COMPARE-STATUS = 'QT'
               or    SYSUT1-STATUS not = '00'
               or    SYSUT2-STATUS not = '00'
               if  READ-1 = 'Y'
                   perform SYSUT1-READ
               end-if
               if  READ-2 = 'Y'
                   perform SYSUT2-READ
               end-if
               if  SYSUT1-STATUS = '00'
               and SYSUT2-STATUS = '00'
                   move 'EQ' to COMPARE-STATUS
                   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-COMMENT
                       end-if
                       add SYSUT1-LRECL-M to ZERO giving D-LEN
                       perform DUMP-POSITION-INDICATOR
                       perform DUMP-PRIMARY-RECORD
                       perform DUMP-POSITION-DIFFERENCES-1
                       perform DUMP-SECONDARY-RECORD
                       perform DUMP-POSITION-DIFFERENCES-2
                       add SYSUT2-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
                   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 'POST' to ULOG-REQUEST
                   add 256 to ZERO giving ULOG-LENGTH
                   move MESSAGE-BUFFER to ULOG-MESSAGE
                   call DUMP-PGM using ULOG-PASS-AREA
                                       ULOG-MESSAGE
                   perform Z-ABEND-PROGRAM
               end-if
               if  DELTA-PROCESS = 'EOF '
               and COMPARE-NE > DELTA-MAXIMUM
                   move DELTA-MAX-ABEND to MESSAGE-TEXT
                   move 'POST' to ULOG-REQUEST
                   add 256 to ZERO giving ULOG-LENGTH
                   move MESSAGE-BUFFER to ULOG-MESSAGE
                   call DUMP-PGM using ULOG-PASS-AREA
                                       ULOG-MESSAGE
                   perform Z-DISPLAY-TO-CONSOLE
                   move 'QT' to COMPARE-STATUS
               end-if
           end-perform

           perform JOB-FINISHED

           GOBACK.

      *****************************************************************
       COMPARE-RECORDS.
      *    Physical Comparison...
           move 'COMPARISON' to REC-CTYPE
           move 'PHYSICAL  ' to REC-CMODE
           move all '=' to DELTA-LINE-1(00001:00001)
           move all '=' to DELTA-LINE-2(00001:00001)
           if SYSUT1-REC(00001:00001) not = SYSUT2-REC(00001:00001)
              move FLAG-NE to COMPARE-STATUS
              move 'Y' to DUMP-STATUS
           end-if
           if  DUMP-DET    = 'Y'
           and DUMP-STATUS = 'Y'
               add 00001 to ZERO  giving POS-1
               add 00001 to ZERO  giving POS-2
               add 00001 to ZERO  giving LEN-1
               add 00001 to ZERO  giving LEN-2
               add 00001 to ZERO  giving ULOG-LENGTH
               perform DUMP-POSITION-CALCULATIONS
           end-if
           exit.


      *****************************************************************
       COMPARE-KEYS.
           move YES-YES to READ-FLAGS
           if  SYSUT1-REC(K-PS-1:K-LN-1)
            <  SYSUT2-REC(K-PS-2:K-LN-2)
               move N-BYTE to READ-2
               move FLAG-NE to COMPARE-STATUS
               if  COMPARE-NE < DELTA-MAXIMUM
               and DUMP-DET-GRP = 'YNE'
                   perform DUMP-SECONDARY-MISSING
               end-if
           end-if
           if  SYSUT1-REC(K-PS-1:K-LN-1)
            >  SYSUT2-REC(K-PS-2:K-LN-2)
               move N-BYTE to READ-1
               move FLAG-NE to COMPARE-STATUS
               if  COMPARE-NE < DELTA-MAXIMUM
               and DUMP-DET-GRP = 'YNE'
                   perform DUMP-PRIMARY-MISSING
               end-if
           end-if
           exit.

      *****************************************************************
      *    Build the position header row...
      *****************************************************************
       DUMP-ASTERISK-COMMENT.
           move SPACES       to ULOG-MESSAGE
           move 'TEXT'       to ULOG-REQUEST
           add 4 to ZERO giving ULOG-LENGTH
           move '*   '       to ULOG-MESSAGE(1:4)
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           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 > D-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 'TEXT'               to ULOG-REQUEST
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < D-LEN
               add DUMP-RECL-MAX to ZERO giving ULOG-LENGTH
           else
               add D-LEN to ZERO giving ULOG-LENGTH
           end-if
           move DUMP-HEADER(1:ULOG-LENGTH) to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           exit.

      *****************************************************************
       DUMP-PRIMARY-MISSING.
           move 'TEXT' to ULOG-REQUEST
           add 79 to ZERO giving ULOG-LENGTH
           if  GROUP-DELIMITER = 'Y'
               move SPACES  to ULOG-MESSAGE
               move all '*' to ULOG-MESSAGE(1:79)
               call DUMP-PGM using ULOG-PASS-AREA
                                   ULOG-MESSAGE
           end-if
      *    Present in SYSUT2, missing from SYSUT1...
           move 'TEXT' to ULOG-REQUEST
           move UT1-MISSING to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE

           add SYSUT2-LRECL-M to ZERO giving D-LEN
           perform DUMP-POSITION-INDICATOR
           perform DUMP-SECONDARY-RECORD
           exit.

      *****************************************************************
       DUMP-PRIMARY-RECORD.
           add POS-1 to ZERO giving RECORD-POS
           add LEN-1 to ZERO giving RECORD-LEN
           add POS-1 to ZERO giving D-POS
           add LEN-1 to ZERO giving D-LEN
           move 'SYSUT1..' to RECORD-ID
           add SYSUT1-RDR to ZERO giving REC-NUMBER

           move 'TEXT'         to ULOG-REQUEST
           add 128 to ZERO giving ULOG-LENGTH
           move RECORD-HEADER  to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           move 'DUMP'                    to ULOG-REQUEST
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < SYSUT1-LRECL-M
               add DUMP-RECL-MAX to ZERO giving ULOG-LENGTH
           else
               add SYSUT1-LRECL-M to ZERO giving ULOG-LENGTH
           end-if
           move SYSUT1-REC(1:ULOG-LENGTH) to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           exit.

      *****************************************************************
       DUMP-SECONDARY-MISSING.
           move 'TEXT' to ULOG-REQUEST
           add 79 to ZERO giving ULOG-LENGTH
           if  GROUP-DELIMITER = 'Y'
               move SPACES  to ULOG-MESSAGE
               move all '*' to ULOG-MESSAGE(1:79)
               call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           end-if
      *    Present in SYSUT1, missing from SYSUT2...
           move 'TEXT' to ULOG-REQUEST
           move UT2-MISSING to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           add SYSUT1-LRECL-M to ZERO giving D-LEN
           perform DUMP-POSITION-INDICATOR
           perform DUMP-PRIMARY-RECORD
           exit.

      *****************************************************************
       DUMP-SECONDARY-RECORD.
           add POS-2 to ZERO giving RECORD-POS
           add LEN-2 to ZERO giving RECORD-LEN
           add POS-2 to ZERO giving D-POS
           add LEN-2 to ZERO giving D-LEN
           move 'SYSUT2..' to RECORD-ID
           add SYSUT2-RDR to ZERO giving REC-NUMBER

           move 'TEXT'         to ULOG-REQUEST
           add 128 to ZERO giving ULOG-LENGTH
           move RECORD-HEADER  to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           move 'DUMP'                    to ULOG-REQUEST
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < SYSUT2-LRECL-M
               add DUMP-RECL-MAX to ZERO giving ULOG-LENGTH
           else
               add SYSUT2-LRECL-M to ZERO giving ULOG-LENGTH
           end-if
           move SYSUT2-REC(1:ULOG-LENGTH) to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           exit.

      *****************************************************************
       DUMP-POSITION-CALCULATIONS.
           add POS-1 to ZERO giving PTR-1
           add POS-2 to ZERO giving PTR-2
           perform until PTR-1 > POS-1 + LEN-1 - 1
                      or PTR-2 > POS-2 + LEN-2 - 1
               if SYSUT1-REC(PTR-1:1)
                = SYSUT2-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.
           move 'TEXT' to ULOG-REQUEST
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < SYSUT1-LRECL-M
               add DUMP-RECL-MAX to ZERO giving ULOG-LENGTH
           else
               add SYSUT1-LRECL-M to ZERO giving ULOG-LENGTH
           end-if
           move DELTA-LINE-1(1:ULOG-LENGTH) to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           exit.

      *****************************************************************
       DUMP-POSITION-DIFFERENCES-2.
           move 'TEXT' to ULOG-REQUEST
           if  DUMP-RECL-MAX-S = 'Y'
           and DUMP-RECL-MAX < SYSUT2-LRECL-M
               add DUMP-RECL-MAX to ZERO giving ULOG-LENGTH
           else
               add SYSUT2-LRECL-M to ZERO giving ULOG-LENGTH
           end-if
           move DELTA-LINE-1(1:ULOG-LENGTH) to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           exit.

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

           move 'POST' to ULOG-REQUEST
           add 80 to ZERO giving ULOG-LENGTH

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

           move 'Conclude' to INFO-ID
           move INFO-SHORT to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           move 'Finished' to INFO-ID

           move SYSUT1-TOTAL to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           if  SYSUT1-OMT > ZERO
               move SYSUT1-OMIT to ULOG-MESSAGE
               call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           end-if

           move SYSUT2-TOTAL to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           if  SYSUT2-OMT > ZERO
               move SYSUT2-OMIT to ULOG-MESSAGE
               call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           end-if

           if  SYSUT1-RDR not = SYSUT2-RDR
               move 'WARNING!  - Record counts are not equal'
                 to ULOG-MESSAGE
               call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
               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 ULOG-MESSAGE
               call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
               move COMPARE-EQ-TOTAL to ULOG-MESSAGE
               call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           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 ULOG-MESSAGE
               call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           end-if

           if  SYSUT1-EOF not = 'Y'
           or  SYSUT2-EOF not = 'Y'
               move 'ABENDING' to INFO-ID
           end-if
           move INFO-STATEMENT to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

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

           perform Z-THANK-YOU.

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

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

           move 'PREP' to ULOG-REQUEST
           move SPACES        to ULOG-MESSAGE
           move 'SIMOL32K'    to ULOG-SYSLOG-MODE
           move 'TEXT'        to ULOG-SYSLOG-FORMAT
           move 'DISABLED'    to ULOG-SYSOUT-MODE
           move 'TEXT'        to ULOG-SYSOUT-FORMAT
           move 'DISABLED'    to ULOG-SYSCON-MODE
           move 'TEXT'        to ULOG-SYSCON-FORMAT
           move 'Y'           to ULOG-DUMP-ASC
           move 'Y'           to ULOG-DUMP-HEX
           move 'Y'           to ULOG-DUMP-EBC
           move 'N'           to ULOG-DUMP-RPI
           move 'Y'           to ULOG-DUMP-DTL

           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           move 'MAKE' to ULOG-REQUEST
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           move 'POST' to ULOG-REQUEST
           add 79 to ZERO giving ULOG-LENGTH
           move all '*' to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           move SIM-TITLE to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           move SIM-COPYRIGHT to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           move all '*' to ULOG-MESSAGE(1:79)
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           move INFO-STATEMENT to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE
           exit.

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

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

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

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

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

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

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

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

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

Table of Contents Previous Section Next Section Technical Details

This section provides additional technical details about the modules that are included in the batch job example.

Table of Contents Previous Section Next Section Copy File for Hex Dump

This source member (PASSL32K.cpy) is the COBOL copy file that defines the data structure (or Pass Area) that is used when calling the SIMOL32K program.

      *****************************************************************
      *                PASSL32K is a COBOL Copy File                  *
      *     Data Structure or Pass Area used for calling SIMOV32K.    *
      *         Copyright (C) 1987-2019 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *****************************************************************
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * SIMOL32K-REQUEST  Type of request, must be one of the         *
      *                   following values.                           *
      *                   POST - Write message to the SYSLUSER file.  *
      *                   DUMP - Write multiple records in Hex-Dump   *
      *                          format to the SYSLUSER file.         *
      * SIMOL32K-STATUS   This is an indicator as to the success      *
      *                   or failure of the request. A value of       *
      *                   zero (0000) indicates the routine was       *
      *                   successful. A non-zero value indicates      *
      *                   a failure.                                  *
      * SIMOL32K-LENGTH   Logical Record Length.                      *
      * SIMOL32K-MESSAGE  Contains the message text.                  *
      *****************************************************************
       01  SIMOL32K-PASS-AREA.
           05  SIMOL32K-REQUEST            pic X(4).
           05  SIMOL32K-STATUS             pic 9999.
           05  SIMOL32K-LENGTH             pic 9(5).
           05  SIMOL32K-PROPERTIES.
               10  SIMOL32K-SYSLOG-MODE    pic X(8).
               10  SIMOL32K-SYSLOG-FORMAT  pic X(4).
               10  SIMOL32K-SYSOUT-MODE    pic X(8).
               10  SIMOL32K-SYSOUT-FORMAT  pic X(4).
               10  SIMOL32K-SYSCON-MODE    pic X(8).
               10  SIMOL32K-SYSCON-FORMAT  pic X(4).
           05  SIMOL32K-DUMP-FLAGS.
               10  SIMOL32K-DUMP-ASC       pic X.
               10  SIMOL32K-DUMP-EBC       pic X.
               10  SIMOL32K-DUMP-HEX       pic X.
               10  SIMOL32K-DUMP-RPI       pic X.
               10  SIMOL32K-DUMP-DTL       pic X.
       01  SIMOL32K-MESSAGE                pic X(32756).
      ***  PASSL32K - End-of-Copy File - - - - - - - - - - - PASSL32K *
      *****************************************************************
      *

Table of Contents Previous Section Next Section Copy File for BFLAGSB1

This source member (BFLAGSB1.cpy) is the COBOL copy file that defines the data structure for the Behavior and Trace flags.

      *****************************************************************
      *              BFLAGSB1.cpy - a COBOL Copy Member               *
      *       Program Behavior Flags used by the Demo programs.       *
      *         Copyright (C) 1987-2019 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      *
       01  BF-GROUP.
           05  BF-FLAGS.
               10  BF-01               PIC X.
               10  BF-02               PIC X.
               10  BF-03               PIC X.
               10  BF-04               PIC X.
               10  BF-05               PIC X.
               10  BF-06               PIC X.
               10  BF-07               PIC X.
               10  BF-08               PIC X.
           05  BF-SLASH                PIC X.
           05  BF-TRACE.
               10  BF-T1               PIC X.
               10  BF-T2               PIC X.
               10  BF-T3               PIC X.
               10  BF-T4               PIC X.
               10  BF-T5               PIC X.
               10  BF-T6               PIC X.
               10  BF-T7               PIC X.
               10  BF-T8               PIC X.
      *
      ***  BFLAGSB1 - End-of-Copy File - - - - - - - - - - - BFLAGSB1 *
      *****************************************************************
      *

Table of Contents Previous Section Next Section Summary

This test case was used to evaluate the feasibility of using a single COBOL program to compare the content of two non-relational data structures of unknown origin. This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers. As always, it is the programmer's responsibility to thoroughly test all programs.

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

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

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

Link to Internet   Link to Server   Explore The File Status Return Codes 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.

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
Single Byte Compare of Data Validation
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com