Data Validate & Compare
Data Management Series
  Table of Contents  v-16.01.01 - dfcomp01.htm 
  Introduction
  Requirements & Scope of Effort
  Identify and Process Differences
  File Inventory and Types
  Quick Start
  Concept of Comparing Data Files
  Define Positions to Compare
  Positions Pre-Defined in Program
  Positions Defined at Execution Time
  Compare Programs and JCL Execution
  Advanced Functions
  Define Position and Length to Compare
  Define Position & Length at Compile Time
  Define Position & Length at Execution Time
  Define Type of Compare
  Physical Compare, a Singular Bit-Level Match
  Logical Compare, One-of-Two Possibilities
  Compare using Compaction
  Omit or Bypass Records
  Generate a File Compare Program
  Execute a File Compare Program
  Review the Differences
  Possibilities & Considerations
  Directory Structure, Manage Assets
  Record Counts
  Track Record Inserts and Deletes
  Omit Function, Bypass Records
  Compare Types
  Physical Compare
  Logical Compare
  Compare with Compaction
  Record Positions & Copy File Fields
  Files with Print-Oriented Content
  ASCII & EBCDIC Collating Sequence
  Numeric Check & Compute Totals
  Data Scrubbing
  An EBCDIC System Environment
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

Reviewing the results obtained during a regression test that follows a system, application or programming change is one of the factors that drive a requirement for comparing data files. The scope of this effort is dependent on the type (or format) of file being compared and the complexity of the record structure within the file. Comparing the files is only half of the effort. What to do once an error (or non-equal) condition occurs can be a significant part of the effort.

This document is an introduction or overview of the data file comparison challenges created as a result of doing an application or data migration between a Mainframe System and a Linux, UNIX or Windows (LUW) System running a Micro Focus sub-system such as Enterprise Server, Application Server or Net Express. This white paper describes the technique for generating a COBOL program (or a set of programs) that will compare two data files in a Micro Focus or Mainframe environment. The format of the files being compared may be sequential (fixed or variable length records) or VSAM. When a difference occurs the content of each record is displayed in hexadecimal, ASCII and/or EBCDIC.

During the testing phase of an application migration between a Mainframe System and a Linux, UNIX or Windows (LUW) System it is a requirement to compare the results of parallel test runs. Using a programmatic approach for data file comparison can be a quick and accurate way to compare large volumes of data.

Defining the scope of what is really needed for a "data file compare" during a parallel application cycle is the first step. For discussion purposes and to better understand the requirements we will make the following assumptions.

Item Assumption
1 Identical jobs may be executed on a z/OS Mainframe and an LUW platform with Micro Focus Enterprise Server using JCL.
2 We have the ability to download the mainframe files in their original EBCDIC-encoded formats. We are using File Transfer Protocol (FTP) in binary mode to transfer the data files
Note: Micro Focus Mainframe Access or MFA could simplify the transfer process.
3 We will be running Micro Focus Studio (or Net Express) and Enterprise Server on a Windows platform using an ASCII-encoded environment.
4 For the purpose of this effort we are talking about VSAM Data Sets and traditional Sequential files in Mainframe and Micro Focus formats.
  Assumptions for a Parallel Processing and File Compare

The objective is to define a process and use technology that will let us have the flexibility of doing data file compares on an IBM Mainframe or an LUW System with Micro Focus. The following is a list of considerations that will add to the complexity and scope of effort.

Item Consideration
1 Data Scrubbing.
2 Converting between EBCDIC and ASCII while maintaining mainframe numeric integrity
3 Fields within records that contain date and time stamp information
4 Reformatting the fields within a record (i.e. changing the size of a field or adding/deleing a field)
5 Data Files that contain "Report-Oriented" record structures with Header, Footer, Detail and Summary information
  Considerations that add Time and Complexity to the Test and Compare Processing

A special "Thank you" to Larry Simmons of Micro Focus for providing much of the information that is presented in this series of white papers and sample programs.


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-2017
SimoTime Technologies
All Rights Reserved

Table of Contents Previous Section Next Section Requirements & Scope of Effort

This section provides a list of questions that will aid in determining the scope of effort for creating the process to compare files and identify differences.

Table of Contents Previous Section Next Section Identify and Process Differences

The following is used to determine the basic requirements for the data file comparison effort with a focus on the level of detail required when a difference occurs.

1. Is it sufficient to just know the name of the files that are different? Y or N
2. Do you need to identify the specific records and positions within a record where a difference occurs? Y or N
3. Will you need the technology and/or process to provide enough information to refer back to the field name where a difference occurs? Y or N
4. Do you want to track and identify differences with record inserts and deletes? Y or N
5. Is the capability to display or print hexadecimal data required? Y or N
6. Is the capability to display or print ASCII or EBCDIC characters required? Y or N
7. Where will the file compare be executed (Mainframe, Windows or UNIX)? ______

Table of Contents Previous Section Next Section File Inventory and Types

The following is used to determine the number of files and the file types and characteristics.

1. How many Key-Sequenced-Data-Sets (KSDS or Indexed Files) do you have to be compared? ______
 
1.a How many of these files have an Alpha-Numeric key? ______
1.b How many of these files have a numeric key? ______
1.c How many of these files have one or more alternate indexes? ______
1.d How many of these files have multiple record types? ______
1.e How many of the files have record lengths that exceed 1,024 bytes? ______
______
2. How many Sequential files do you have to be compared? ______
 
2.a How many of these files are fixed record length? ______
2.b How many of these files are variable record length? ______
2.c How many have a variable number of concatenated segments of differing sizes and formats? ______
2.d How many of these files have multiple record types? ______
2.e How many of the files have record lengths that exceed 1,024 bytes? ______
 
3. Do you have COBOL copy files that define the record layouts? Y or N
4. Do you have Table Definitions as part of the record layouts? Y or N
 
4.a If yes, do you use "Occurs Depending On" or ODO? Y or N
4.b Do you have multi-dimensional tables defined in the record layouts? Y or N
 
5. Do you use duplicate field names across group items (for example, FIELD-A of GROUP-01 and FIELD-A of GROUP-02)? Y or N
6. Do you have packed (i.e. COMP-3) and binary fields (i.e. COMP) fields? Y or N
7. Do you have signed, zone decimal fields? Y or N
8. Do your files have Floating Point fields (i.e. COMP-1 or COMP-2)? Y or N
 
8.a If yes, have they been previously converted from 370 to IEEE? Y or N
 
9. Will you be using Line Sequential (i.e. ASCII/Text) files in the Windows environment? Y or N
10. Will you be comparing report files? Y or N
11. Will you be comparing source members? Y or N
12. What is the encoding format of the data files ASCII, EBCDIC or Both? A, E or B

Table of Contents Previous Section Next Section Quick Start

This section provides the basic information needed to get started with the data file comparison process.

Item Considerations
1 Do a Physical Comparison between two data files. The bytes within specified positions within a record must be equal at the bit level.
2 Do a Logical Comparison between two data files. The bytes within specified positions within a record must be equal at the character set level.
3 Do a Comparison with Compaction between two data files. The comparison is only done for significant bytes (usually non-space characters) within the specified positions within a record.
4 Accumulate totals for currency fields and/or other numeric fields within a record.
5 Accumulate record counts for both files being compared.
  Tips and Techniques for a Quick Start

Table of Contents Previous Section Next Section Concept of Comparing Data Files

The file comparison technology that is available from SimoTime executes on the Windows platform. However, this technology does not actually do the file compares but generates a COBOL program that performs the file compares. This COBOL program may be compiled and executed on an IBM Mainframe (z/OS or VSE) System or a Linux, UNIX or Windows (LUW) System with Micro Focus.

It is important to set up a directory structure to generate and compile the file comparison programs. The file comparison programs are generally treated as tools for use by the development and testing groups within an organization.

Therefore, the generated programs for file compares are kept separate from the mainstream source code. This is discussed in the "Possibilities and Considerations" section of this document.

Using the SimoTime technology for file compares is a two-step process. The generation and compilation of the COBOL source code is the first step and this is a one-time process. The second step is the repeatable task of defining the positions within the records within the files to be compared and then executing the compare program.

Table of Contents Previous Section Next Section Define Positions to Compare

The SimoTime technology offers two alternates for defining the positions within the records that are going to be compared. The primary difference between the two alternatives is the point in the process where the positions to be compared are determined.

Table of Contents Previous Section Next Section Positions Pre-Defined in Program

This type of file comparison program will simply read two files and do the comparison of positions within the records base on hard-coded values in the generated program. This type of program has the /COMPARE statements in the same control file (SYSCNTL) that is used to generate the COBOL source code. The positions to be compared will be determined at compile time and become part of the generated source code. The advantage of using this approach is that fewer parameters are required at execution time. The disadvantage of using this approach is that it requires the program to be regenerated and compiled if a user wants to change the positions within the records to be compared. A Windows Command Script is provided and is executed as follows.

c:\> SIMOCOMP name-of-process-control-file

The following is an example of a process control file (ITP09401.pcf) the contains the specifications that will be used to generate the COBOL source code that will compare the contents of two files based on the /COMPARE statements in a control file (SYSCNTL). The compare positions will be included in the generated COBOL source code.

***********************************************************************
*                  ITP09401 - Input Specifications                    *
*    This is an example of the compare specifications to generate a   *
*        Data File Comparison Program. This is used by SimoZAPS       *
*                        SimoTime Technologies                        *
*            (C) Copyright 1987-2017 All Rights Reserved              *
*              Web Site URL:   http://www.simotime.com                *
*                    e-mail:   helpdesk@simotime.com                  *
***********************************************************************
&SIMOPREP  call ../Env1BASE
&USERPREP  call USERCOMP
&COPYFILE  ITEMCB01.CPY
&HTMLFILE  itemcb01.htm
&FUNCTION  COMPARE
&CONFORM   IBM
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Compare, Indexed, Key & Pos 1-94
&progid    ITP094C1
&sysut1    name=ITCOMPD1 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
&sysut2    name=ITCOMPD2 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
*
&DELTAMAX  250 EOF
&KEYFIELD  SYSUT1 pos  1 len 12 SYSUT2 pos  1 len 12
*
&COMPARE   SYSUT1 pos  1 len 94 SYSUT2 pos  1 len 94
*
&DELTAMAX  5 EOF
&DFORMAT   ASC HEX EBC
&DISPLAY   SYSOUT
&SYSLOG    DISABLE
*
&END

Once the COBOL source code has been generated it needs to be compiled. For this example we will use Micro Focus COBOL on a Windows platform to compile the program. We will compile to a .GNT for improved performance over .INT and use the ASSIGN(EXTERNAL) directive for mapping file names when we execute the program.

The following is an example of a Windows command file (ITP094W1.cmd) that will set the environment and execute (or run) the program.

@echo OFF
rem  * *******************************************************************
rem  *               ITP094W1.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2017 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two VSAM, KSDS's on a Record-by-Record Basis.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * The job will read two VSAM, KSDS's using matching record logic
rem  * to compare positions 1-94 of each record.
rem  *
rem  * *******************************************************************
rem  *
     set CmdName=ITP094W1
     call ..\Env1BASE
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%, User is %USERNAME%
     call SimoNOTE "Solution Compare Item Master Files, Actual and Expected Results"
     set ITCOMPD1=%BASECAT%\APPL\SIMOTIME.DATA.ITEMMAST.DAT
     set ITCOMPD2=%BASECAT%\APPL\SIMOTIME.DATA.ITEXPECT.DAT
rem  *
     run ITP094C1
     set ERRORLEVELTWO=%ERRORLEVEL%
     if not "%ERRORLEVELTWO%" == "0" set JobStatus=0010
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     if not %JobStatus% == 0000 goto :EojNok
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "DataMake SYSOUT=%SYSOUT%"
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :End
:EojNok
     call SimoNOTE "DataMake SYSOUT=%SYSOUT%"
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
:End
     if not "SIMOGENS" == "BATCH" pause

Table of Contents Previous Section Next Section Positions Defined at Execution Time

This type of file comparison program will read a control file (SYSUT3) containing /COMPARE statements at execution time and do positional comparisons within the records based on the /COMPARE statements submitted at execution time. The advantage of this approach is the compare positions are defined when the generated COBOL program is executed. The user may change the positions within the record to be compared without having to re-generate and compile the program. The disadvantage is that it is necessary to have a control file with compare statements at execution time.

c:\> SIMOCOMP name-of-process-control-file

The following is an example of a process control file (ITCOMP03.pcf) that contains the specifications to be used to generate the COBOL source code that will compare the contents of two files based on the /COMPARE statements in a control file (SYSUT3) that is processed when the generated compare program is executed.

***********************************************************************
*                ITCOMP03.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*             (C) Copyright 1987-2017 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* This is an example of the compare specifications to generate a
* Data File Comparison Program.
***********************************************************************
*
* The following group of statements will define the high level
* or external functions and processes to be performed.
*
&SIMOPREP  call ../Env1BASE
&USERPREP  call USERCOMP
&COPYFILE  ITEMCB01.CPY
&HTMLFILE  itemcb01.htm
&FUNCTION  COMPARE
&CONFORM   IBM
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the file I/O Program
* that will be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Compare ITEMMAST with SYSUT3 Input
&progid    ITCOMPC3
&sysut1    name=ITCOMPD1 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
&sysut2    name=ITCOMPD2 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
&sysut3    name=SYSUT3D3 org=Sequential recfm=variable rlen=80
*
* The following statements will determine execution behavior.
* The KEYFIELD will cause record INSERT/DELETE to be enabled.
* The COMPARE statement is commented because the positions to be
* compared are defined at execution time based on parameters
* specified in SYSUT3.
*
&KEYFIELD  SYSUT1 pos  1 len  12 SYSUT2 pos  1 len  12
*COMPARE   SYSUT1 pos  1 len 512 SYSUT2 pos  1 len 512
*
* The following statements determine when to stop the compare process
* and what to do when a not-equal condition occurs.
*
&IFNECODE  0016
&DELTAMAX  5 EOF
&DFORMAT   ASC HEX EBC
&DISPLAY   SYSOUT
&SYSLOG    DISABLE
*
&END

Once the COBOL source code has been generated it needs to be compiled. For this example we will use Micro Focus COBOL on a Windows platform to compile the program. We will compile to a .GNT for improved performance over .INT and use the ASSIGN(EXTERNAL) directive for mapping file names when we execute the program.

The following is an example of a Windows command file (ITCOMPW3.cmd) that will set the environment and execute (or run) the program.

@echo OFF
rem  * *******************************************************************
rem  *               ITCOMPW3.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2017 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two VSAM, KSDS's on a Record-by-Record Basis.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * The job will read two VSAM, KSDS's using matching record logic
rem  * to compare records or record segments. The position and size of
rem  * the record segments is defined in the SYSUT3 control file.
rem  *
rem  * *******************************************************************
rem  *
     set CmdName=ITCOMPW3
     call ..\Env1BASE
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%, User is %USERNAME%"
     set ITCOMPD1=%BASECAT%\APPL\SIMOTIME.DATA.ITEMMAST.DAT
     set ITCOMPD2=%BASECAT%\APPL\SIMOTIME.DATA.ITEXPECT.DAT
     set SYSUT3D3=%BASEAPP%\PARMLIB2\ITP094D1.CTL
rem  *
     run ITCOMPC3
     set ERRORLEVELTWO=%ERRORLEVEL%
     if not "%ERRORLEVELTWO%" == "0" set JobStatus=0010
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     if not %JobStatus% == 0000 goto :EojNok
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "DataMake SYSOUT=%SYSOUT%"
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :End
:EojNok
     call SimoNOTE "DataMake SYSOUT=%SYSOUT%"
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
:End
     if not "SIMOGENS" == "BATCH" pause

The following is the content of the PDS Member or the SYSUT3 file (ITP094D1.ctl) that contains the COMPARE statements to be processed at execution time.

*...:....1....:....2....:....3....:....4....:....5....:....6
/COMPARE   SYSUT1 pos  1 len 94 SYSUT2 pos  1 len 94

Table of Contents Previous Section Next Section Compare Programs and JCL Execution

This type of file comparison program will read a control file (SYSUT3) containing /COMPARE statements at execution time and do positional comparisons within the records based on the /COMPARE statements submitted at execution time. The advantage of this approach is the compare positions are defined when the generated COBOL program is executed. The user may change the positions within the record to be compared without having to re-generate and compile the program. The disadvantage is that it is necessary to have a control file with compare statements at execution time.

Note:  This suite of programs will do the same compare function in a Mainframe System environment described in the previous section of this document. A JCL member will be submitted and executed.

c:\> SIMOCOMP name-of-process-control-file

The following is an example of a process control file (ITCOMP03.pcf) that contains the specifications that will generate the COBOL source code that will compare the contents of two files. The positions within the records to be compared will be based on the /COMPARE statements in a control file (SYSUT3 PDS Member) that is processed when the generated compare program is executed.

***********************************************************************
*                ITCOMP03.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*             (C) Copyright 1987-2017 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* This is an example of the compare specifications to generate a
* Data File Comparison Program.
***********************************************************************
*
* The following group of statements will define the high level
* or external functions and processes to be performed.
*
&SIMOPREP  call ../Env1BASE
&USERPREP  call USERCOMP
&COPYFILE  ITEMCB01.CPY
&HTMLFILE  itemcb01.htm
&FUNCTION  COMPARE
&CONFORM   IBM
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the file I/O Program
* that will be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Compare ITEMMAST with SYSUT3 Input
&progid    ITCOMPC3
&sysut1    name=ITCOMPD1 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
&sysut2    name=ITCOMPD2 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
&sysut3    name=SYSUT3D3 org=Sequential recfm=variable rlen=80
*
* The following statements will determine execution behavior.
* The KEYFIELD will cause record INSERT/DELETE to be enabled.
* The COMPARE statement is commented because the positions to be
* compared are defined at execution time based on parameters
* specified in SYSUT3.
*
&KEYFIELD  SYSUT1 pos  1 len  12 SYSUT2 pos  1 len  12
*COMPARE   SYSUT1 pos  1 len 512 SYSUT2 pos  1 len 512
*
* The following statements determine when to stop the compare process
* and what to do when a not-equal condition occurs.
*
&IFNECODE  0016
&DELTAMAX  5 EOF
&DFORMAT   ASC HEX EBC
&DISPLAY   SYSOUT
&SYSLOG    DISABLE
*
&END

Once the COBOL source code has been generated it needs to be uploaded to the Mainframe System and compiled. The following is an example of a JCL Member (ITCOMPJ3.jcl) that will execute the compare program.

//ITCOMPJ3 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       ITCOMPJ3.jcl - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2017 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Compare the contents of two different item files.
//* Author - Simotime Technologies
//* Date   - January 24, 1996
//*
//* The job will read two input files and compare the records. If the
//* records are not equal an entry will be made to a log file.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* personal computer with Windows and Micro Focus Mainframe Express.
//* This JCL will also execute with Micro Focus Enterprise Server.
//*
//*                     ************
//*                     * ITCOMPJ3 *
//*                     ********jcl*
//*                          *
//*   ************      ************                      ************
//*   * ITCOMPD1 *---*--* ITCOMPC3 *----------------------*  SYSOUT  *
//*   *****note-1*   *  ********CBL*                      ************
//*                  *       *   *
//*   ************   *       *   *       ************
//*   * ITCOMPD2 *---*       *   *-call--* SIMOHEX4 *
//*   *****note-2*   *       *   *       ********cbl*
//*                  *       *   *
//*   ************   *       *   *       ************     ************
//*   * SYSUT3D3 *---*       *   *-call--* SIMOLOGS *--*--*  SYSLOG  *
//*   *******pdsm*           *           ********cbl*  *  ********dat*
//*                          *                         *
//*                     ************                   *  ************
//*                     *   EOJ    *                   *--*  SYSOUT  *
//*                     ************                      ************
//*
//*    Note-1, ITCOMPD1 is the Item Master File. It is a VSAM, KSDS
//*            with 512 byte records, The key starts in Position 1 and
//*            is 12 bytes.
//*    Note-2, ITCOMPD2 is a copy of the Item Master File. It is a
//*            VSAM, KSDS with 512 byte records, The key starts in
//*            Position 1 and is 12 bytes. This file was created by
//*            submitting and executing the ITCOPYJ1.jcl member.
//*
//* *******************************************************************
//* STEP   1   Compare the two files, write exceptions to log file...
//*
//EXECDAT1 EXEC PGM=ITCOMPC3
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//ITCOMPD1 DD  DSN=SIMOTIME.DATA.ITEMMAST,DISP=SHR
//ITCOMPD2 DD  DSN=SIMOTIME.DATA.ITEXPECT,DISP=SHR
//SYSUT3D3 DD  DSN=SIMOTIME.PDS.PARMLIB(ITP094D1),DISP=SHR
//SYSOUT   DD  SYSOUT=*
//

The following is the content of the SYSUT3 PDS Member (ITP094D1.ctl) that contains the COMPARE statements to be processed at execution time.

*...:....1....:....2....:....3....:....4....:....5....:....6
/COMPARE   SYSUT1 pos  1 len 94 SYSUT2 pos  1 len 94

Table of Contents Previous Section Next Section Advanced Functions

This section provides detailed information about the features provided by the SimoTime Technology. When doing file comparisons the default option should be to do a physical file compare with record counts reinforced by the accumulation and comparison of totals for currency fields.

For currency fields (and possibly other signed numeric fields) SimoTime recommends complementing the comparison process by using the accumulate function to accumulate totals for comparison. This has the added value of catching things like embedded spaces in signed packed fields.

Table of Contents Previous Section Next Section Define Position and Length to Compare

The SimoTime technology offers two alternates for defining the starting position and length of strings within the records that are going to be compared. The primary difference between the two alternatives is the point in the process where the positions and length to be compared are determined.

Table of Contents Previous Section Next Section Define Position & Length at Compile Time

This file comparison program will simply read two files and do the comparison of positions within the records base on hard-coded values in the generated program. This type of program has the /COMPARE statements in the same control file (SYSCNTL) that is used to generate the COBOL source code. The positions to be compared will be determined at compile time and become part of the generated source code. The advantage of using this approach is that fewer parameters are required at execution time. The disadvantage of using this approach is that it requires the program to be regenerated and compiled if a user wants to change the positions within the records to be compared.

Table of Contents Previous Section Next Section Define Position & Length at Execution Time

This file comparison program will read a control file (SYSUT3) containing /COMPARE statements at execution time and do positional comparisons within the records based on the /COMPARE statements submitted at execution time. The advantage of this approach is the compare positions are defined when the generated COBOL program is executed. The user may change the positions within the record to be compared without having to re-generate and compile the program. The disadvantage is that it is necessary to have a control file with compare statements at execution time.

Table of Contents Previous Section Next Section Define Type of Compare

The SimoTime technology offers various types of comparison methodologies. The compare methodology used to do a data file compare will depend on the record content and structure.

Table of Contents Previous Section Next Section Physical Compare, a Singular Bit-Level Match

A physical compare is the primary technique for comparing files. This compare is performed by specified positions within each record. The bit-pattern of the specified positions within each record within the range of positions must match to produce an equal result. To do a physical compare the following shows an example of a "/COMPARE" statement that would be included in the specifications file.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/COMPARE   PHYSICAL SYSUT1 pos  1 len 303 SYSUT2 pos  1 len 303
or
/COMPARE   SYSUT1 pos  1 len 303 SYSUT2 pos  1 len 303

The "/COMPARE " keyword followed by space characters must be in columns 1 through 11. The remaining specifications must start in column 12. If the "COMPARE Type" (i.e. PHYSICAL) keyword is missing then "PHYSICAL" is assumed or used as the default value. Multiple COMPARE statements may be used. Each COMPARE statement has a maximum length of 1,024 bytes.

This is a singular test that does a one-to-one comparison of the bytes within the specified positions. The bytes must match at the bit level for an equal condition to occur.

For currency fields (and possibly other signed numeric fields) SimoTime recommends complementing the comparison process by using the accumulate function to accumulate totals for comparison. This has the added value of catching things like embedded spaces in signed packed fields.

Table of Contents Previous Section Next Section Logical Compare, One-of-Two Possibilities

A logical compare is an alternate technique for comparing files. This compare is performed by specified positions within each record. The bit-pattern or character-set of the specified positions within each record must match or the logical value must match (i.e. an EBCDIC "A" must match an ASCII "A") to produce an equal result. To do a logical compare the following shows an example of a "/COMPARE" statement that would be included in the specifications file.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/COMPARE   LOGICAL SYSUT1 pos  1 len 303 SYSUT2 pos  1 len 303

The "/COMPARE " keyword followed by space characters must be in columns 1 through 11. The remaining specifications must start in column 12. To do a LOGICAL compare the "COMPARE Type" (i.e. LOGICAL) keyword must be specified. Multiple COMPARE statements may be used. Each COMPARE statement has a maximum length of 1,024 bytes.

This is a multiple test that does a one-to-two-possibility, byte-by-byte comparison. The logical compare will first test a byte for an exact match and if equal proceed to the next byte. If not equal the logical compare will then test the byte for a match by character set and if equal proceed to the next byte or if not equal set the mismatch (or non-equal) flag.

This compare methodology may be used to compare an ASCII-encoded file with and EBCDIC-encoded file without having to do a file conversion of one of the files. The first compare (or exact match) will catch the packed and binary fields. The second compare (or character set) will compare a logical ASCII character to a logical EBCDIC character.

This compare methodology will provide a high level of reasonability checking. However, there is a possibility that a signed decimal number that was converted improperly could be missed.

For currency fields (and possibly other signed numeric fields) SimoTime recommends complementing the comparison process by using the accumulate function to accumulate totals for comparison. This has the added value of catching things like embedded spaces in signed packed fields.

Table of Contents Previous Section Next Section Compare using Compaction

This compare methodology is intended to address a specific requirement that may exist when a user switches the report generator being used within an application. A new report generator or a custom program that replaces a utilitarian program may produce the same logical report but the actual data items may be shifted a few bytes to the left or right.

A compare using compaction is an alternate technique for comparing records within two files. This compare using compaction is performed by specified positions within each record. The bit-pattern of the non-space characters of the specified positions within each record must match to produce an equal result. To do a compare using compaction the following shows an example of a "/COMPACT" statement that would be included in the specifications file.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/COMPACT    SYSUT1 pos  1 len 303 SYSUT2 pos  1 len 303

Multiple COMPACT statements may be used. Each COMPACT statement has a maximum length of 1,024 bytes.

Table of Contents Previous Section Next Section Omit or Bypass Records

The "OMIT" function provides a method to omit or bypass records from the compare process. The "/UT1OMIT" and "/UT2OMIT" statements are used to conditionally determine if a record should be omitted or bypassed by the comparison process. The most common use of the omit function is to bypass blank records from report-oriented files. To omit blank records from both files requires the following two statements in the specifications file.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/UT1OMIT   if pos 2 len 132 EQ SPACES
/UT2OMIT   if pos 2 len 132 EQ SPACES

For the preceding two statements the action is not explicitly define and will default to "bypass record".

To conditionally omit more than a single record from the comparison process would require the following two statements.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/UT1OMIT   if pos 1 len 1 EQ '1' bypass record +1
/UT2OMIT   if pos 1 len 1 EQ '1' bypass record +1

For the preceding two statements the action must be explicitly defined as "bypass record". The "+nnn" defines the number of additional records to bypass.

The omit function is only supported by the compile time function.

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

This step is usually a one-time process (this example uses the option to define positions to be compared at execution time). To generate a file comparison program requires a Process Control File (PCF) file to be provided to the SimoTime technology that will generate the file comparison source code. The following (ITCOMP03.pcf) is an example of the records within an ASCII/Text file (or process control file) that will be required.

***********************************************************************
*                ITCOMP03.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*             (C) Copyright 1987-2017 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* This is an example of the compare specifications to generate a
* Data File Comparison Program.
***********************************************************************
*
* The following group of statements will define the high level
* or external functions and processes to be performed.
*
&SIMOPREP  call ../Env1BASE
&USERPREP  call USERCOMP
&COPYFILE  ITEMCB01.CPY
&HTMLFILE  itemcb01.htm
&FUNCTION  COMPARE
&CONFORM   IBM
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the file I/O Program
* that will be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Compare ITEMMAST with SYSUT3 Input
&progid    ITCOMPC3
&sysut1    name=ITCOMPD1 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
&sysut2    name=ITCOMPD2 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
&sysut3    name=SYSUT3D3 org=Sequential recfm=variable rlen=80
*
* The following statements will determine execution behavior.
* The KEYFIELD will cause record INSERT/DELETE to be enabled.
* The COMPARE statement is commented because the positions to be
* compared are defined at execution time based on parameters
* specified in SYSUT3.
*
&KEYFIELD  SYSUT1 pos  1 len  12 SYSUT2 pos  1 len  12
*COMPARE   SYSUT1 pos  1 len 512 SYSUT2 pos  1 len 512
*
* The following statements determine when to stop the compare process
* and what to do when a not-equal condition occurs.
*
&IFNECODE  0016
&DELTAMAX  5 EOF
&DFORMAT   ASC HEX EBC
&DISPLAY   SYSOUT
&SYSLOG    DISABLE
*
&END

The preceding Process Control File is first subjected to a pre-edit process. Once a statement passes the pre-edit the ampersand in position 1 is changed to a forward slash before it is submitted to the generation process. After all the statements have passed the pre-edit stage the compare program is generated. To the user this will appear as a single task that does the program generation. However, it is sometimes helpful to know this detail if the comparison results are not as expected.

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

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

The following is an example of a Windows command file (ITCOMPW4.cmd) that will set the environment and execute (or run) the program.

@echo OFF
rem  * *******************************************************************
rem  *               ITCOMPW4.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2017 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Compare two VSAM, KSDS's on a Record-by-Record Basis.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * The job will read two VSAM, KSDS's using matching record logic
rem  * to compare records or record segments. The position and size of
rem  * the record segments is defined in the SYSUT3 control file.
rem  *
rem  * *******************************************************************
rem  *
     set CmdName=ITCOMPW3
     call ..\Env1BASE
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%, User is %USERNAME%"
     set ITCOMPD1=%BASECAT%\APPL\SIMOTIME.DATA.ITEMMAST.DAT
     set ITCOMPD2=%BASECAT%\APPL\SIMOTIME.DATA.ITEXPECT.DAT
     set SYSUT3D3=%BASEAPP%\PARMLIB2\ITP094D2.CTL
     set SYSLOG=%BASECAT%\APPL\SIMOTIME.DATA.SYSLOGV4.DAT
rem  *
     run SIMO1051
rem  *
     run ITCOMPC3
     set ERRORLEVELTWO=%ERRORLEVEL%
     if not "%ERRORLEVELTWO%" == "0" set JobStatus=0010
     if "%ERRORLEVELTWO%" == "4" set JobStatus=0004
     if not %JobStatus% == 0000 goto :EojNok
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "DataMake SYSOUT=%SYSOUT%"
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :End
:EojNok
     call SimoNOTE "DataMake SYSOUT=%SYSOUT%"
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
:End
     if not "SIMOGENS" == "BATCH" pause

For this example the information about the job execution and possible differences in the files being compared will be written to the SYSLOG file.

For this example the control file (SYSUT3) contains the following compare statement. The maximum record size for the file is 512 bytes. However, the COMPARE statement will direct the generated compare program to only compare positions 1-94. The SYSLOG statement will cause information to be written to a log file when a not equal condition occurs.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/COMPARE SYSUT1 pos 1 len 94 SYSUT2 pos 1 len 94
/SYSLOG  ENABLE
/SYSOUT  NONE

Table of Contents Previous Section Next Section Review the Differences

What to do when a not equal condition occurs can be challenging on a single platform but in today's environment with multiple platforms and a mix of encoding schemes (such as EBCDIC and ASCII) and numeric formats (such as PACKED, BINARY and SIGNED-ZONE-DECIMAL) the task can become time consuming and difficult.

When a difference is found the type of display or logging information is defined by the use of a /DFORMAT statement in the control file used during program generation. When a not equal condition is encountered the following is displayed to the screen and written to a logging file. The following /DFORMAT statement was used in this example and will cause the compare program to dump the possible ASCII Text, the hexadecimal values and the possible EBCDIC text.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/DFORMAT  ASC HEX EBC

The RED shows the possible ASCII translation. The BLUE shows the possible EBCDIC translation. The BLACK shows the hexadecimal dump information on two lines (high nibble on line 1, low nibble on line 2). The GREEN shows reference information about each file. For example, the relative record number is displayed along with the position and length of the text string within the record that was compared. The MAROON row shows the positions that are equal (=) or not equal (#). The YELLOW vertical column highlights the differences. The following page shows sample output of the compare program when a difference occurs. Sample Output when a Difference Occurs.

*** 2005/04/01 08:57:37:40 Starting  - Compare, Indexed, Key & Positions
*** 2005/04/01 08:57:37:41 SYSUT1.....Record Number(position:length) 000000001(00001:00094)
*** 2005/04/01 08:57:37:41 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....
*** 2005/04/01 08:57:37:42 000000000001Distributor Cap                                 ........Each            ...2....i.
*** 2005/04/01 08:57:37:42 3333333333334677766776724672222222222222222222222222222222220000000046662222222222220003900068
*** 2005/04/01 08:57:37:42 000000000001493429254F203100000000000000000000000000000000000000000051380000000000000002C0009C
*** 2005/04/01 08:57:37:42 .....................?.../.........................................../........................
*** 2005/04/01 08:57:37:43 SYSUT2.....Record Number(position:length) 000000001(00001:00094)
*** 2005/04/01 08:57:37:43 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....
*** 2005/04/01 08:57:37:43 000000000001Distributor Cap                                 ...$....Each            ...2....i.
*** 2005/04/01 08:57:37:43 3333333333334677766776724672222222222222222222222222222222220002000046662222222222220003900068
*** 2005/04/01 08:57:37:44 000000000001493429254F203100000000000000000000000000000000000004000C51380000000000000002C0009C
*** 2005/04/01 08:57:37:44 .....................?.../.........................................../........................
*** 2005/04/01 08:57:37:44 ===============================================================#===#==========================
*** 2005/04/01 08:57:37:45 *
*** 2005/04/01 08:57:37:45 SYSUT1.....Record Number(position:length) 000000002(00001:00094)
*** 2005/04/01 08:57:37:45 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....
*** 2005/04/01 08:57:37:45 000000000002Rotor                                           ........Each            ........)\
*** 2005/04/01 08:57:37:46 3333333333335676722222222222222222222222222222222222222222220000000046662222222222220000800025
*** 2005/04/01 08:57:37:47 0000000000022F4F200000000000000000000000000000000000000000000000000051380000000000000009C0009C
*** 2005/04/01 08:57:37:47 .............?.?...................................................../.......................*
*** 2005/04/01 08:57:37:48 SYSUT2.....Record Number(position:length) 000000002(00001:00094)
*** 2005/04/01 08:57:37:48 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....
*** 2005/04/01 08:57:37:49 000000000002Rotor                                           ...$....Each            ........)\
*** 2005/04/01 08:57:37:49 3333333333335676722222222222222222222222222222222222222222220002000046662222222222220000800025
*** 2005/04/01 08:57:37:49 0000000000022F4F200000000000000000000000000000000000000000000004000C51380000000000000009C0009C
*** 2005/04/01 08:57:37:50 .............?.?...................................................../.......................*
*** 2005/04/01 08:57:37:51 ===============================================================#===#==========================
*** 2005/04/01 08:57:37:52 *
*** 2005/04/01 08:57:37:53 Summary   - Data File Content Comparison
*** 2005/04/01 08:57:37:53 000000005 - Record count for ITCOMPD1
*** 2005/04/01 08:57:37:54 000000005 - Record count for ITCOMPD2
*** 2005/04/01 08:57:37:55 000000002 - Unequal count
*** 2005/04/01 08:57:37:55 Finished  - Compare, Indexed, Key & Positions

The summary information shows the record counts and the number of unequal compares by record count.

Table of Contents Previous Section Next Section Possibilities & Considerations

This section provides additional detail about the process for generating, compiling and executing a data file comparison program. This discussion is limited to the Windows environment. However, the process is very similar for the mainframe and UNIX environments once the COBOL source code has been generated on a Windows system.

Table of Contents Previous Section Next Section Directory Structure, Manage Assets

The following is a sample sub-directory structure for managing the assets used by the file compare process. The following directory structure is usually stored under a higher-level directory.

             
BASECAT sub-DIR's file.EXT Comments
DATA
Base Directory for non-Relational Data
   
   
   
   
APPL
 
 
.DAT
Application, non-Relational Data Files
   
   
   
ASC1
Holding directory for ASCII encoded files
   
   
   
EBC1
Holding directory for EBCDIC encoded files
   
   
   
FTP1
Holding directory, data received via FTP
   
   
   
SPOOL
 
 
MFE*.DAT
Contains SPOOL and SYSOUT info, see Note-1
   
   
   
STRS
   
   
.STR
Contains STR files, see Note-2
   
   
   
.HTM
HTML Documents for Record Structures
   
   
   
TXT1
 
 
.TXT
Holding directory for ASCII/Text files
   
   
   
WRK1
 
 
.***
Holding directory for Work or Temp files
   
   
   
XLSS
   
   
.XLSS
Holding directory for Excel, XLSS files
   
   
.CSV
Holding directory for Excel, CSV files
 
Note-1: This directory is identified by the ES_ALLOC_OVERRIDE Environment Variable.
Note-2: This directory contains the Micro Focus generated STR (or Structure) Files and the SimoTime generated HTML documents for Record Structures based on a COBOL copy file.
Directory Structure for non-Relational Data Files

Table of Contents Previous Section Next Section Record Counts

This is part of the basic requirements to ensure the files being compared will have an equal number of records. The SimoTime technology has an option to read to "End-of-File" or to "Quit" after a certain number of differences have been identified.

If the "End-of-File" option is used then differences will be written to the log file and when the difference count exceeds the maximum then differences will not be written to the log file but reading of the two files being compared will continue until end-of-file is reached and a records count for the total number of records read from each file will be provided along with a non-zero return code.

If the "Quit" option is used and the maximum number of differences is exceeded then a count of the number of records read before the program is terminated with a non-zero return code will be provided.

Table of Contents Previous Section Next Section Track Record Inserts and Deletes

The SimoTime technology has the capability of tracking record inserts and deletes for Indexed files (or VSAM, Key-Sequenced-Data-Sets). This can also be done for sequential files if they are in sequence by an identified field that can be used as a key field.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
&KEYFIELD  SYSUT1 pos  1 len  12 SYSUT2 pos  1 len  12

Table of Contents Previous Section Next Section Omit Function, Bypass Records

The "OMIT" function provides a method to omit or bypass records from the compare process. The "/UT1OMIT" and "/UT2OMIT" statements are used to conditionally determine if a record should be omitted or bypassed by the comparison process. The most common use of the omit function is to bypass blank records from report-oriented files. To omit blank records from both files requires the following two statements in the specifications file.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/UT1OMIT   if pos  2 len 132 EQ SPACES
/UT2OMIT   if pos  2 len 132 EQ SPACES

To conditionally omit more than a single record from the comparison process would require the following two statements.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/UT1OMIT   if pos  1 len   1 EQ '1' bypass record +1
/UT2OMIT   if pos  1 len   1 EQ '1' bypass record +1

The omit function is only supported by the compile time function.

Table of Contents Previous Section Next Section Compare Types

The SimoTime Technology provides a variety of techniques to compare the content of two files. A "PHYSICAL" compare requires a match at the bit-pattern level. A "LOGICAL" compare requires a match of the bit-patterns or character-sets. A compaction technique may be used to compact the space characters and only include non-space characters within each record as part of the compare process.

Table of Contents Previous Section Next Section Physical Compare

A physical compare is the primary technique for comparing files. This compare is performed by specified positions within each record. The bit-pattern of the specified positions within each record must match to produce an equal result. To do a physical compare the following shows an example of a "/COMPARE" statement that would be included in the specifications file.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/COMPARE   PHYSICAL SYSUT1 pos  1 len 303 SYSUT2 pos  1 len 303

Table of Contents Previous Section Next Section Logical Compare

A logical compare is an alternate technique for comparing files. This compare is performed by specified positions within each record. The bit-pattern or character-set of the specified positions within each record must match or the logical value must match (i.e. an EBCDIC "A" must match an ASCII "A") to produce an equal result. To do a logical compare the following shows an example of a "/COMPARE" statement that would be included in the specifications file.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/COMPARE   LOGICAL SYSUT1 pos  1 len 303 SYSUT2 pos  1 len 303

Table of Contents Previous Section Next Section Compare with Compaction

A compare using compaction is an alternate technique for comparing records within two files. This compare using compaction is performed by specified positions within each record. The bit-pattern of the non-space characters of the specified positions within each record must match to produce an equal result. To do a compare using compaction the following shows an example of a "/COMPACT" statement that would be included in the specifications file.

* ..:....1....:....2....:....3....:....4....:....5....:....6....
/COMPACT    SYSUT1 pos  1 len 303 SYSUT2 pos  1 len 303

Table of Contents Previous Section Next Section Record Positions & Copy File Fields

The SimoTime technology has the capability of reading a COBOL copy file that defines a record layout and providing HTML documentation. The HTML documentation includes the field name, the relative position of the field within the data structure, the logical length of the fields (number of digits) and the physical field length (actual bytes of memory used).

When the comparison program is executed information is provided when a difference occurs by indicating the relative position within the record where a difference occurred. By referencing the HTML document it is a simple process to identify the field name where the difference occurred.

Table of Contents Previous Section Next Section Files with Print-Oriented Content

Sequential files that contain print line images can present a challenge when attempting to compare. Reports (or print-oriented files) usually contain multiple record types without a field that identifies the record type or print line. It is quite common that header information contains a date and possible time stamp and based on testing cycles these fields are rarely equal (especially the time field). Knowing when a record (print line) is a header, a footer, a detailed print line, a sub-total line or a total line can be difficult to determine.

It is very important to determine up-front how many files that are to be compared are print-oriented and what the structure is for these files. Once the file format is understood it is usually a straight-forward process to add logic to the generated COBOL program to adjust to the multiple record types and to bypass the date and time fields. For example, if a header line contains three lines of information the COBOL compare program may be modified to look for the "skip to line 1" character in position 1 of the 133 byte print line and then bypass the compare for three records (or the number of lines of header information).

In some cases the positioning of the text strings within a print line image may be shifted to the left or right. The content of the test strings is equal but a record compare is not equal because of the positional shift. The SimoTime technology provides an alternatives that uses a "Compaction" approach to do a left to right comparison and ignore the embedded spaces as part of the compare. By simply replacing the /COMPARE statement in the specifications file with a /COMPACT keyword the compaction/comparison will be used.

Table of Contents Previous Section Next Section ASCII & EBCDIC Collating Sequence

When comparing a sequential file that is downloaded from a Mainframe System (EBCDIC-encoded) with a file that is created on a Windows System (ASCII-encoded) it may be necessary to make adjustments for the difference in the ASCII and EBCDIC collating sequences. This is especially true if the field that determines the sequence of the file is alpha-numeric.

If the compare is being done on the Windows System then the file downloaded from the mainframe (via FTP in binary mode) will need to be converted to ASCII and then sorted prior to doing a compare.

Table of Contents Previous Section Next Section Numeric Check & Compute Totals

It may be a requirement to accumulate batch totals for numeric fields and this is especially true for currency fields. The SimoTime technology allows a user to leverage various approaches for this requirement.

Approach Description
1 SimoTime provides the technology to do numeric checking and accumulation of totals for numeric fields based on a record layout and the field definitions provided in a COBOL copy file.
2 SimoTime technology generates COBOL source code that is compiled and then used to do the data file comparison. This COBOL source code may be easily modified to accumulate the batch totals or address very specialized requirements.
3 Also, the batch totals for currency fields may already be available in reports that are produced by the application.
  Alternatives for Checking and Totals of Numeric Fields

Table of Contents Previous Section Next Section Data Scrubbing

During an application migration it is always tempting to scrub the data (for example, replace leading spaces in numeric fields with zeroes). If the data is scrubbed this usually leads to a number of data file compare differences during the application testing or parallel testing phases of the migration effort. Extra time will be needed to manually process and validate this information.

Table of Contents Previous Section Next Section An EBCDIC System Environment

The programs generated to do data file comparison may be compiled and executed in an ASCII or EBCDIC-encoded environment. The generated compare programs will make calls to two additional programs. The additional programs are SIMOHEX4 and SIMOLOGS. SimoTime provides two DLL's that will work in the ASCII-encoded, Net Express environment. If the generated file compare programs are to be used on the mainframe or in an EBCDIC-encoded environment with Micro Focus technology the SIMOHEX4 and SIMOLOGS programs must be compiled to execute in these EBCDIC-encoded environments. For these environments the OS/390 or later dialect should be used. The next challenge will be to get the file compare program to write information to the SYSLOG file.

The following JCL member (ITCOMPJ4.jcl) will show what needs to be done to write to the SYSLOG file.

//ITCOMPJ4 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       ITCOMPJ4.jcl - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2017 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Compare the contents of two different item files.
//* Author - Simotime Technologies
//* Date   - January 24, 1996
//*
//* The job will read two input files and compare the records. If the
//* records are not equal an entry will be made to a log file.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* personal computer with Windows and Micro Focus Mainframe Express.
//* This JCL will also execute with Micro Focus Enterprise Server.
//*
//*                     ************
//*                     * ITCOMPJ4 *
//*                     ********jcl*
//*                          *
//*                     ************     ************
//*                     * SYSLOGP8 *-----*  SYSLOG  *
//*                     ********prc*     ************
//*                          *
//*   ************      ************
//*   * ITCOMPD1 *---*--* ITCOMPC3 *
//*   *****note-1*   *  ********cbl*
//*                  *       *   *
//*   ************   *       *   *       ************
//*   * ITCOMPD2 *---*       *   *-call--* SIMOHEX4 *
//*   *****note-2*   *       *   *       ********cbl*
//*                  *       *   *
//*   ************   *       *   *       ************   ************
//*   * SYSUT3D3 *---*       *   *-call--* SIMOLOGS *---*  SYSLOG  *
//*   *******pdsm*           *           ********cbl*   ********dat*
//*                          *
//*                     ************
//*                     *   EOJ    *
//*                     ************
//*
//*   Note-1, ITCOMPD1 is the Item Master File. It is a VSAM, KSDS
//*           with 512 byte records, The key starts in Position 1 and
//*           is 12 bytes.
//*   Note-2, ITCOMPD2 is a copy of the Item Master File. It is a
//*           VSAM, KSDS with 512 byte records, The key starts in
//*           Position 1 and is 12 bytes. The file has been updated
//*           to introduce a difference during the compare process.
//*           This file was created by submitting and executing
//*           the ITCOPYJ2.jcl member.
//*
//* *******************************************************************
//* STEP 1 of 2, Allocate a new SYSLOG file.
//*
//         SET  DDSYSLOG=SIMOTIME.SYSLOG.ITCOMPJ4
//SYSLOGCT EXEC SYSLOGP8
//*
//* *******************************************************************
//* STEP 2 of 2, Execute the compare program.
//* Note: when a difference occurs the information will be written to
//*       the SYSLOG file
//*
//EXECDAT1 EXEC PGM=ITCOMPC3
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//ITCOMPD1 DD  DSN=SIMOTIME.DATA.ITEMMAST,DISP=SHR
//ITCOMPD2 DD  DSN=SIMOTIME.DATA.ITCHANGE,DISP=SHR
//SYSUT3D3 DD  DSN=SIMOTIME.PDS.PARMLIB(ITP094D2),DISP=SHR
//SYSLOG   DD  DSN=SIMOTIME.SYSLOG.ITCOMPJ4,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//

This file compare program was generated to access a control file at execution time. The control file is a PDS Member. The following PDS Member (ITP094D2.ctl) shows the content of the control file with a /SYSLOG statement that enables the write to log function.

* ..:....1....:....2....:....3....:....4....:....5....:....6
/COMPARE   SYSUT1 pos  1 len 94 SYSUT2 pos  1 len 94
*
*SYSLOG    DISABLE
/SYSLOG    ENABLE
*
*DISPLAY   SYSOUT
*DISPLAY   CONSOLE
/DISPLAY   NONE

Table of Contents Previous Section Next Section Summary

This document is an introduction or overview of the data file comparison challenges created as a result of doing an application or data migration between a Mainframe System and a Linux, UNIX or Windows (LUW) System running a Micro Focus sub-system such as Enterprise Server, Application Server or Net Express. This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.

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

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

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

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime 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 How to Generate a Data File Compare, Validate or Hex-Dump Program using simple specification statements in a Process Control File (PCF). This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do a data file compare, accumulate summary totals with a record count or produce a Hex-Dump of records in a VSAM, KSDS based on a list of user-defined keys. The User Guide contains a list of the PCF statements that are used for the data file compare, validate or dump process.

Link to Internet   Link to Server   Explore a Series of White Papers for non-relational data files. This includes information about data file management in a diverse or mixed systems environment.

Link to Internet   Link to Server   Explore a quick overview of the data file management tasks for data file transfer, conversion and comparison. Ever since the second computer was introduced into the world the file management tasks of data file transfer, share, convert and compare (or data file validation) have been technically challenging.

Link to Internet   Link to Server   Explore the alternatives for transferring data files between systems. This link provides access to a repository of information that includes the transferring and/or sharing of data between Mainframe (ZOS or VSE), Linux, UNIX and Windows Systems.

Link to Internet   Link to Server   Explore the Principles of Data File Conversion. This link includes guidelines for defining requirements and determining the scope of effort for a data conversion effort.

Link to Internet   Link to Server   Explore the Principles of Data File Comparison. This link includes guidelines for defining requirements and determining the scope of effort for a data comparison effort.

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

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

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

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

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

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Comments or Feedback

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

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

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

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

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


Return-to-Top
Data Management Series, Data Validate and Compare
Copyright © 1987-2017
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com