Simple 80/80 Compare Compare two Sequential Files |
![]() |
The SimoTime Home Page |
The 1st section (Primary Functions) of this document will focus on doing an actual compare of two sequential files. The 2nd section (Secondary Functions) will focus on the preparation tasks required prior to doing file compare. The 3rd section (Ancillary Functions) will describe some of the supporting tasks (such as creating test files) that are required.
This example will use IEBGENER to create three sequential files. The files will be used to demonstrate the capabilities of the data file compare processes. The first two files contain the same record content and produce an equal compare result. The third file has a record with different content and the compare process will identify the difference.
This example includes JCL Members, Windows CMD Files and a COBOL program. In the world of programming there are many ways to solve a problem. This suite of programs is provided as one of the many possible solutions for comparing data files. The files used in this suite of sample programs use fixed length records of eighty-bytes. When the files are compared and if a difference is found the COBOL compare program will call SIMOHEX4.CBL and SIMOLOGS.CBL. These programs and their associated copy files are part of the SIMOLIBR package. Refer to the Downloads and Links to Similar Pages section of this document for additional information.
Many companies are looking for ways to compare data files using a mainframe system and a distributed system (i.e. Linux, UNIX and/or Windows or "LUW") running Micro Focus sub-systems. This utility program (UTCOMPRT) is intended to assist in these efforts. The UTCOMPRT program runs in the Windows environment and generates comparison programs (COBOL Source Code) that may be compiled and executed on a distributed LUW platform with Micro Focus.
We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.
Copyright © 1987-2016
SimoTime Technologies
All Rights Reserved
This section will focus on the items (process and procedures) that do the actual data file comparison. A second group of items will be used to generate the comparison program and prepare the environment for the compare tasks. These secondary command files and programs will be described in the Secondary Functions section of this document.
This section will focus on two JCL Members that execute a simple file compare process. The first JCL Member will compare two files that are identical.. The second JCL Member will compare two files that have a difference embedded within the files. The Data File Compare programs will find the difference and produce a NOT-Equal result.
This JCL Member (CPRS80J1.jcl) will compare two sequential files that are identical. The job execution will result in a zero return code and display the record counts to the SYSOUT device.
//CPRS80J1 JOB (SIMOTIME),'DATA FILE COMPARE',CLASS=1,MSGCLASS=0, // NOTIFY=CSIP1 //* ******************************************************************* //* CPRS80J1.JCL - a JCL Member for Batch Job Processing * //* This JCL Member is provided by SimoTime Technologies * //* (C) Copyright 1987-2016 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Text - Compare two data files. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* This set of programs will run on a mainframe under MVS or on a //* Personal Computer with Windows and Micro Focus Technologies. //* //* ************ //* * CPRS80J1 * //* ********jcl* //* * //* ************ //* * IEFBR14 * //* ********utl* //* * //* ************ ************ ************ //* * RS0080D1 *-----* CPRS80C1 *-----* SYSOUT * //* ********dat* * ********cbl* * ************ //* * * * //* ************ * * * ************ //* * RS0080D2 *--* * *--* SYSLOG * //* ********dat* * *******vseq* //* * //* ************ //* * EOJ * //* ************ //* //* ******************************************************************* //* Step 1 of 1, Compare two data files, expect an EQUAL result... //* //COMPARE1 EXEC PGM=CPRS80C1 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //RS0080D1 DD DSN=SIMOTIME.DATA.RS80TT01,DISP=SHR //RS0080D2 DD DSN=SIMOTIME.DATA.RS80TT02,DISP=SHR //SYSLOG DD DSN=SIMOTIME.SYSLOG.CPRS80D1,DISP=SHR //SYSOUT DD SYSOUT=* //
This JCL Member (CPRS80J2.jcl) will compare two files that have a difference embedded within the files. The Data File Compare programs will find the difference and produce a NOT-Equal result. The record counts and the difference will be displayed to the SYSOUT device.
//CPRS80J2 JOB (SIMOTIME),'DATA FILE COMPARE',CLASS=1,MSGCLASS=0, // NOTIFY=CSIP1 //* ******************************************************************* //* CPRS80J2.JCL - a JCL Member for Batch Job Processing * //* This JCL Member is provided by SimoTime Technologies * //* (C) Copyright 1987-2016 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Text - Compare two data files. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* This set of programs will run on a mainframe under MVS or on a //* Personal Computer with Windows and Micro Focus Technologies. //* //* ************ //* * CPRS80J1 * //* ********jcl* //* * //* ************ //* * IEFBR14 * //* ********utl* //* * //* ************ ************ ************ //* * RS0080D1 *-----* CPRS80C1 *-----* SYSOUT * //* *******ksds* * ********cbl* ************ //* * * //* ************ * * //* * RS0080D3 *--* * //* ********dat* * //* * //* ************ //* * EOJ * //* ************ //* //* ******************************************************************* //* Step 1 of 1, Compare two data files, expect a NOT EQUAL result... //* //COMPARE2 EXEC PGM=CPRS80C1 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //RS0080D1 DD DSN=SIMOTIME.DATA.RS80TT01,DISP=SHR //RS0080D2 DD DSN=SIMOTIME.DATA.RS80TT03,DISP=SHR //SYSOUT DD SYSOUT=* //
This section will focus on two CMD Files that execute a simple file compare process. The first CMD File will compare to files that are identical.. The second CMD File will compare two files that have a difference embedded within the files. The Data File Compare programs will find the difference and produce a NOT-Equal result.
This CMD File (CPRS80W1.cmd) will compare two sequential files that are identical. The job execution will result in a zero return code and display the record counts to the SYSOUT device.
@echo OFF rem * ******************************************************************* rem * CPRS80W1.CMD - a Windows Command File * rem * This program is provided by SimoTime Technologies * rem * (C) Copyright 1987-2016 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * rem * Text - Compare two sequential files rem * Author - SimoTime Technologies rem * Date - January 24, 1996 rem * rem * This set of programs will run on a mainframe under MVS or on a rem * Personal Computer with Windows and Micro Focus Net Express. rem * rem * ************ rem * * CPRS80W1 * rem * ********cmd* rem * * rem * * rem * ************ ************ ************ rem * * RS0080D1 *-----* CPRS80C1 *-----* SYSLOG * rem * *******rseq* * ********cbl* ************ rem * * * rem * ************ * * rem * * RS0080D2 *--* * rem * *******rseq* * rem * * rem * ************ rem * * EOJ * rem * ************ rem * rem * ******************************************************************* rem * Step 1 Delete any previously created file... rem * rem * rem *-Use-the-following-statement-to-identify-the-command.--------------*Modify* set CmdName=CPRS80W1 call ..\Env1BASE %CmdName% set JobStatus=0000 set SYSLOG=%BASELIB1%\LOGS\SYSLOG.RSEQ.%CmdName%.dat call SYSLOGW9 rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%" call SimoNOTE "StepInfo Prepare the File Name Mapping" rem * rem * Set the environment variables for End-of-Job. set SIMOMODE=SHOW set SIMOGENS=NOPAUSE rem * rem *-Use-the-following-two-statements-to-map-the-file-names.-----------*Modify* set RS0080D1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT01.DAT set RS0080D2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT02.DAT rem * rem * ******************************************************************* rem * Step 2 Compare the two files... rem * call SimoNOTE "StepInfo Execute the Compare Program" rem * rem *-Use-the-following-statement-to-run-the-program.-------------------*Modify* run CPRS80C1 set JobStatus=%ERRORLEVEL% if not "%ERRORLEVEL%" == "0000" goto EojNok rem * :EojAok call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%" goto :End :EojNok call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%" set CompareStatus=%JobStatus% call SYSLOGW1 call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %CompareStatus%" :End pause
This CMD File (CPRS80W2.cmd) will compare two sequential files that have a difference embedded within the files. The Data File Compare programs will find the difference and produce a NOT-Equal or non-Zero result. The record counts and the difference will be displayed to the SYSOUT device.
@echo OFF rem * ******************************************************************* rem * CPRS80W2.CMD - a Windows Command File * rem * This program is provided by SimoTime Technologies * rem * (C) Copyright 1987-2016 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * rem * Text - Compare two sequential files rem * Author - SimoTime Technologies rem * Date - January 24, 1996 rem * rem * This set of programs will run on a mainframe under MVS or on a rem * Personal Computer with Windows and Micro Focus Net Express. rem * rem * ************ rem * * CPRS80W2 * rem * ********cmd* rem * * rem * * rem * ************ ************ ************ rem * * RS0080D1 *-----* CPRS80C1 *-----* SYSLOG * rem * *******rseq* * ********cbl* ************ rem * * * rem * ************ * * rem * * RS0080D2 *--* * rem * *******rseq* * rem * * rem * ************ rem * * EOJ * rem * ************ rem * rem * ******************************************************************* rem * Step 1 Delete any previously created file... rem * set CmdName=CPRS80W2 call ..\Env1BASE %CmdName% set JobStatus=0000 if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%" :PrepareQSAM call SimoNOTE "StepInfo Prepare the File Name Mapping" set RS0080D1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT01.DAT set RS0080D2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT03.DAT rem * rem * ******************************************************************* rem * Step 2 Compare the two files... rem * :ExecuteCompareRoutine call SimoNOTE "StepInfo Execute the Compare Program" run CPRS80C1 set ERRORLEVELTWO=%ERRORLEVEL% if not "%ERRORLEVELTWO%" == "0" set JobStatus=0010 if "%ERRORLEVELTWO%" == "4" set JobStatus=0004 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "Compare-One is %RS0080D1%" call SimoNOTE "Compare-Two is %RS0080D2%" rem * rem * rem * ******************************************************************* :EojAok call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%" goto :End :EojNok call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%" :End rem * Convert VREC to LSEQ and display using NotePad... if "SIMOGENS" == "BATCH" goto End2 if %JobStatus% == 0004 call VRECCVW1 if "%ERRORLEVELTWO%" == "4" set JobStatus=0004 pause :End2 exit /b
This File Compare program (CPRS80C1.cbl) was generated by the SimoTime Utility for Data File Compare. For addition information refer to the Generating a Data File Comparison Program section of this document for additional information.
IDENTIFICATION DIVISION. PROGRAM-ID. CPRS80C1. 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: 2010-07-12 Generation Time: 14:39:56:96 * * * * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * INPUT RS0080D1 SEQUENTIAL FIXED 00080 * * * * OUTPUT RS0080D2 SEQUENTIAL FIXED 00080 * * * * * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT RS0080D1-FILE ASSIGN TO RS0080D1 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS RS0080D1-STATUS. SELECT RS0080D2-FILE ASSIGN TO RS0080D2 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS RS0080D2-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD RS0080D1-FILE DATA RECORD IS RS0080D1-REC . 01 RS0080D1-REC. 05 RS0080D1-DATA-01 PIC X(00080). FD RS0080D2-FILE DATA RECORD IS RS0080D2-REC . 01 RS0080D2-REC. 05 RS0080D2-DATA-01 PIC X(00080). ***************************************************************** * This program was created using the SYSCOMP1.TXT file as the * * template for the data file comparison. The positions to be * * compared are determined at compile time. * * * * For more information or questions please contact SimoTime * * Technologies. * * * * 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 '* CPRS80C1 '. 05 T2 pic X(34) value 'Do a Physical 80-Byte Comparison '. 05 T3 pic X(10) value ' v10.07.12'. 05 T4 pic X(24) value ' helpdesk@simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* CPRS80C1 '. 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 '* CPRS80C1 '. 05 C2 pic X(32) value 'A SimoTime Technology generated '. 05 C3 pic X(32) value 'the preceding Data File Compare '. 05 C4 pic X(04) value 'code'. 01 SIM-THANKS-02. 05 C1 pic X(11) value '* CPRS80C1 '. 05 C2 pic X(32) value 'Please send all inquires or sugg'. 05 C3 pic X(32) value 'estions to the helpdesk@simotime'. 05 C4 pic X(04) value '.com'. 01 RS0080D1-STATUS. 05 RS0080D1-STATUS-L pic X. 05 RS0080D1-STATUS-R pic X. 01 RS0080D1-EOF pic X value 'N'. 01 RS0080D1-OPEN-FLAG pic X value 'C'. 01 RS0080D2-STATUS. 05 RS0080D2-STATUS-L pic X. 05 RS0080D2-STATUS-R pic X. 01 RS0080D2-EOF pic X value 'N'. 01 RS0080D2-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 '* CPRS80C1 '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(68) value SPACES. 10 MESSAGE-TEXT-2 pic X(188) value SPACES. ***************************************************************** 01 APPL-RESULT pic S9(9) comp. 88 APPL-AOK value 0. 88 APPL-EOF value 16. 01 READ-FLAGS. 05 READ-1 pic X value 'Y'. 05 READ-2 pic X value 'Y'. 01 DUMP-FLAGS. 05 DUMP-ASC pic X value 'Y'. 05 DUMP-EBC pic X value 'Y'. 05 DUMP-HEX pic X value 'Y'. 01 FUNCTION-FLAGS. 05 FF-01 pic X value '1'. 05 FF-02 pic X value '0'. 05 FF-03 pic X value '0'. 01 COMPACT-STATUS pic XX value 'EQ'. 01 COMPACT-PENDED pic XX value 'EQ'. 01 COMPARE-STATUS pic XX value 'EQ'. 01 FLAG-EQ pic XX value 'EQ'. 01 FLAG-NE pic XX value 'NE'. 01 FLAG-QT pic XX value 'QT'. 01 DELTA-LINE-1 pic X(1024) value all '-'. 01 DELTA-LINE-2 pic X(1024) value all '-'. 01 PTR-1 pic 9(5) value 0. 01 PTR-2 pic 9(5) value 0. 01 IDX-1 pic 9(5) value 0. 01 IDX-2 pic 9(5) value 0. 01 DELTA-MAXIMUM-X pic X(5) value '00005'. 01 DELTA-MAXIMUM redefines DELTA-MAXIMUM-X pic 9(5). 01 DELTA-PROCESS pic X(4) value 'EOF '. 01 BYPASS-UT1-CTR pic 9(3) value 0. 01 BYPASS-UT2-CTR pic 9(3) value 0. 01 WORK-05 pic X(5) value SPACES. 01 YES-YES pic XX value 'YY'. 01 N-BYTE pic X value 'N'. 01 Y-BYTE pic X value 'Y'. 01 KEY-ACTIVE pic X value 'Y'. 01 KEY-CONTROL-1. 05 PS-1 pic 9(5) value 00000. 05 LN-1 pic 9(5) value 00000. 01 KEY-CONTROL-2. 05 PS-2 pic 9(5) value 00000. 05 LN-2 pic 9(5) value 00000. 01 RS0080D1-LRECL pic 9(5) value 00080. 01 LEN-1 pic 9(5) value 128. 01 POS-1 pic 9(5) value 1. 01 RS0080D2-LRECL pic 9(5) value 00080. 01 LEN-2 pic 9(5) value 128. 01 POS-2 pic 9(5) value 1. 01 D-LEN pic 9(5) value 128. 01 D-POS pic 9(5) value 1. 01 W-LEN pic 9(5) value 0. 01 W-POS pic 9(5) value 10. 01 CONTINUE-FLAG pic X value 'Y'. 01 ASC-OR-EBC pic 9(3) comp value 0. 01 ASC-OR-EBC-R redefines ASC-OR-EBC. 05 ASC-A pic X. 05 EBC-A pic X. * Header row for positional indicator... 01 DUMP-H10. 05 FILLER pic X(5) value '....:'. 05 POS-NO pic 9(5) value 10. 01 DUMP-HEADER pic X(1024) value all '.'. 01 D-P1 pic 9(5) value 0. 01 RECORD-HEADER. 05 RECORD-ID pic X(8) value 'RS0080D1'. 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 80-Byte Comparison '. 05 filler pic X(33) value ' http://www.SimoTime.com'. 01 RS0080D1-TOTAL. 05 RS0080D1-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(25) value 'Record count for RS0080D1'. 01 RS0080D2-TOTAL. 05 RS0080D2-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(25) value 'Record count for RS0080D2'. 01 COMPARE-NE-TOTAL. 05 COMPARE-NE pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 COMPARE-TAG pic X(25) value 'All Equal result for comp'. 05 filler pic X(25) value 'are of existing records '. 01 COMPACT-NE-TOTAL. 05 COMPACT-NE pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 COMPACT-TAG pic X(25) value 'All Equal result for comp'. 05 filler pic X(25) value 'act of existing records '. 01 FORMAT-TYPE pic X value 'B'. COPY PASSHEX4. COPY PASSLOGS. COPY PAENVARS. ***************************************************************** PROCEDURE DIVISION. perform JOB-STARTING perform until COMPARE-STATUS = 'QT' or RS0080D1-STATUS not = '00' or RS0080D2-STATUS not = '00' if READ-1 = 'Y' perform RS0080D1-READ end-if if READ-2 = 'Y' perform RS0080D2-READ end-if if RS0080D1-STATUS = '00' and RS0080D2-STATUS = '00' move 'EQ' to COMPARE-STATUS if KEY-ACTIVE = 'Y' and COMPARE-STATUS = FLAG-EQ perform COMPARE-KEYS end-if if COMPARE-STATUS = FLAG-EQ perform COMPARE-RECORDS end-if if COMPARE-STATUS = FLAG-NE add 1 to COMPARE-NE end-if end-if if DELTA-PROCESS = 'QUIT' and COMPARE-NE > DELTA-MAXIMUM or DELTA-PROCESS = 'QUIT' and COMPACT-NE > DELTA-MAXIMUM move 'The Not Equal count exceeds Maximum limit...' to MESSAGE-TEXT perform Z-ABEND-PROGRAM end-if end-perform perform JOB-FINISHED GOBACK. ***************************************************************** COMPARE-RECORDS. * Physical Comparison... move 'COMPARISON' to REC-CTYPE move 'PHYSICAL ' to REC-CMODE if RS0080D1-REC(00001:00080) not = RS0080D2-REC(00001:00080) move FLAG-NE to COMPARE-STATUS if COMPARE-NE < DELTA-MAXIMUM add 00001 to ZERO giving POS-1 add 00001 to ZERO giving POS-2 add 00080 to ZERO giving LEN-1 add 00080 to ZERO giving LEN-2 add 00080 to ZERO giving PASSHEX4-LENGTH perform DUMP-PRIMARY-RECORD perform DUMP-SECONDARY-RECORD perform DUMP-POSITION-DIFFERENCE end-if end-if exit. ***************************************************************** COMPARE-KEYS. move YES-YES to READ-FLAGS if RS0080D1-REC(PS-1:LN-1) < RS0080D2-REC(PS-2:LN-2) move N-BYTE to READ-2 move FLAG-NE to COMPARE-STATUS perform DUMP-PRIMARY-MISSING end-if if RS0080D1-REC(PS-1:LN-1) > RS0080D2-REC(PS-2:LN-2) move N-BYTE to READ-1 move FLAG-NE to COMPARE-STATUS perform DUMP-SECONDARY-MISSING end-if exit. ***************************************************************** DUMP-TO-LOG. * HexDump... * Dump DD Name, Record-Number, (position,length) move RECORD-HEADER to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA * DUMP position indicator perform DUMP-POSITION-INDICATOR if DUMP-ASC = 'Y' move PASSHEX4-ASCII(1:D-LEN) to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA end-if if DUMP-HEX = 'Y' move PASSHEX4-UPPER(1:D-LEN) to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move PASSHEX4-LOWER(1:D-LEN) to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA end-if if DUMP-EBC = 'Y' move PASSHEX4-EBCDIC(1:D-LEN) to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA end-if exit. ***************************************************************** * Build the position header row... ***************************************************************** DUMP-POSITION-INDICATOR. add 9 to D-POS giving POS-NO perform varying D-P1 from 1 by 10 until D-P1 > 1020 move DUMP-H10 to DUMP-HEADER(D-P1:10) inspect DUMP-HEADER(D-P1 + 5:5) replacing leading ZEROES by '.' add 10 to POS-NO end-perform move DUMP-HEADER(1:D-LEN) to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA exit. ***************************************************************** DUMP-PRIMARY-MISSING. move 'RS0080D1 Record is missing from RS0080D2 file' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move SPACES to PASSHEX4-SOURCE add RS0080D1-RDR to ZERO giving REC-NUMBER add PS-1 to ZERO giving RECORD-POS add LN-1 to ZERO giving RECORD-LEN add PS-1 to ZERO giving D-POS add LN-1 to ZERO giving D-LEN move 'RS0080D1..' to RECORD-ID move RS0080D1-REC(PS-1:LN-1) to PASSHEX4-SOURCE call 'SIMOHEX4' using PASSHEX4-PASS-AREA perform DUMP-TO-LOG perform DUMP-POSITION-DIFFERENCE exit. ***************************************************************** DUMP-PRIMARY-RECORD. add POS-1 to ZERO giving RECORD-POS add LEN-1 to ZERO giving RECORD-LEN add POS-1 to ZERO giving D-POS add LEN-1 to ZERO giving D-LEN move 'RS0080D1..' to RECORD-ID add RS0080D1-RDR to ZERO giving REC-NUMBER move RS0080D1-REC(D-POS:D-LEN) to PASSHEX4-SOURCE call 'SIMOHEX4' using PASSHEX4-PASS-AREA perform DUMP-TO-LOG exit. ***************************************************************** DUMP-SECONDARY-MISSING. move 'RS0080D2 Record is missing from RS0080D1 file' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move SPACES to PASSHEX4-SOURCE add RS0080D2-RDR to ZERO giving REC-NUMBER add PS-2 to ZERO giving RECORD-POS add LN-2 to ZERO giving RECORD-LEN add PS-2 to ZERO giving D-POS add LN-2 to ZERO giving D-LEN move 'RS0080D2..' to RECORD-ID move RS0080D2-REC(PS-2:LN-2) to PASSHEX4-SOURCE call 'SIMOHEX4' using PASSHEX4-PASS-AREA perform DUMP-TO-LOG perform DUMP-POSITION-DIFFERENCE exit. ***************************************************************** DUMP-SECONDARY-RECORD. move SPACES to PASSHEX4-SOURCE add POS-2 to ZERO giving RECORD-POS add LEN-2 to ZERO giving RECORD-LEN add POS-2 to ZERO giving D-POS add LEN-2 to ZERO giving D-LEN move 'RS0080D2..' to RECORD-ID add RS0080D2-RDR to ZERO giving REC-NUMBER move RS0080D2-REC(D-POS:D-LEN) to PASSHEX4-SOURCE call 'SIMOHEX4' using PASSHEX4-PASS-AREA perform DUMP-TO-LOG exit. ***************************************************************** DUMP-POSITION-DIFFERENCE. if READ-FLAGS = 'YY' move all '-' to DELTA-LINE-2 add POS-1 to ZERO giving PTR-1 add POS-2 to ZERO giving PTR-2 add 1 to ZERO giving IDX-2 perform until IDX-2 > 1024 or IDX-2 > D-LEN if RS0080D1-REC(PTR-1:1) = RS0080D2-REC(PTR-2:1) move '=' to DELTA-LINE-2(IDX-2:1) else move '#' to DELTA-LINE-2(IDX-2:1) end-if add 1 to PTR-1 add 1 to PTR-2 add 1 to IDX-2 end-perform else move all '#' to DELTA-LINE-2 end-if move DELTA-LINE-2(1:D-LEN) to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move '*' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA exit. ***************************************************************** JOB-FINISHED. if RS0080D1-STATUS = '00' and DELTA-PROCESS = 'EOF ' perform until RS0080D1-STATUS not = '00' if READ-1 = 'Y' perform RS0080D1-READ end-if end-perform end-if if RS0080D2-STATUS = '00' and DELTA-PROCESS = 'EOF ' perform until RS0080D2-STATUS not = '00' if READ-2 = 'Y' perform RS0080D2-READ end-if end-perform end-if perform RS0080D2-CLOSE perform RS0080D1-CLOSE move 'Conclude' to INFO-ID move INFO-SHORT to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move 'Finished' to INFO-ID move RS0080D1-TOTAL to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move RS0080D2-TOTAL to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA if RS0080D1-RDR not = RS0080D2-RDR move 'WARNING! - Record counts are not equal' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move 'ABENDING' to INFO-ID end-if if FF-01 = '1' if COMPARE-NE > 0 move 'ABENDING' to INFO-ID move 'NOT' to COMPARE-TAG(1:3) end-if move COMPARE-NE-TOTAL to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA end-if if FF-02 = '1' if COMPACT-NE > 0 move 'ABENDING' to INFO-ID move 'NOT' to COMPACT-TAG(1:3) end-if move COMPACT-NE-TOTAL to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA end-if if RS0080D1-EOF not = 'Y' or RS0080D2-EOF not = 'Y' move 'ABENDING' to INFO-ID end-if move INFO-STATEMENT to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move INFO-SHORT to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT perform Z-THANK-YOU. if COMPARE-NE > 0 or RS0080D1-RDR not = RS0080D2-RDR add 4 to ZERO giving RETURN-CODE end-if exit. ***************************************************************** JOB-STARTING. perform Z-POST-COPYRIGHT perform Z-DETERMINE-ENVIRONMENT perform RS0080D1-OPEN perform RS0080D2-OPEN move 'Y' to READ-1 move 'Y' to READ-2 if DELTA-MAXIMUM not numeric add 100 to ZERO giving DELTA-MAXIMUM end-if if PS-1 > 0 and PS-2 > 0 and LN-1 > 0 and LN-2 > 0 move 'Y' to KEY-ACTIVE move 'Key control is ENABLED...' to MESSAGE-TEXT else move 'N' to KEY-ACTIVE move 'Key control is NOT enabled...' to MESSAGE-TEXT end-if perform Z-DISPLAY-MESSAGE-TEXT move 'DUMP' to PASSHEX4-REQUEST add 128 to ZERO giving PASSHEX4-LENGTH move 'OUT2' to SIMOLOGS-REQUEST move SPACES to SIMOLOGS-MESSAGE move all '*' to SIMOLOGS-MESSAGE(1:80) call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move INFO-STATEMENT to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move all '*' to SIMOLOGS-MESSAGE(1:80) call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move SIM-TITLE to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move SIM-COPYRIGHT to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA exit. ***************************************************************** * I/O Routines for the Primary File... * ***************************************************************** RS0080D1-CLOSE. add 8 to ZERO giving APPL-RESULT. close RS0080D1-FILE if RS0080D1-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 RS0080D1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move RS0080D1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* RS0080D1-READ. read RS0080D1-FILE if RS0080D1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT add 1 to RS0080D1-RDR else if RS0080D1-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 RS0080D1-EOF else move 'READ Failure with RS0080D1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move RS0080D1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* RS0080D1-OPEN. add 8 to ZERO giving APPL-RESULT. open input RS0080D1-FILE if RS0080D1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to RS0080D1-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with RS0080D1' to MESSAGE-TEXT perform Z-DISPLAY-TO-CONSOLE perform Z-DISPLAY-MESSAGE-TEXT move RS0080D1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * I/O Routines for the Secondary File... * ***************************************************************** RS0080D2-READ. read RS0080D2-FILE if RS0080D2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT add 1 to RS0080D2-RDR else if RS0080D2-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 RS0080D2-EOF else move 'READ Failure with RS0080D2' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move RS0080D2-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* RS0080D2-OPEN. add 8 to ZERO giving APPL-RESULT. open input RS0080D2-FILE if RS0080D2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to RS0080D2-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with RS0080D2' to MESSAGE-TEXT perform Z-DISPLAY-TO-CONSOLE perform Z-DISPLAY-MESSAGE-TEXT move RS0080D2-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* RS0080D2-CLOSE. add 8 to ZERO giving APPL-RESULT. close RS0080D2-FILE if RS0080D2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to RS0080D2-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with RS0080D2' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move RS0080D2-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: 2010-07-12 Generation Time: 14:39:57:04 * *****************************************************************
This section will focus on the items (process and programs) that do the generation and compilation of a data file compare programs.
The SimoTime Utility Program for Data File Comparison runs on a Windows System with Micro Focus and will generate the COBOL source code for a program that will do a compare of two data files. The generation of the COBOL source code requires a Windows System with Micro Focus Studio or Micro Focus Server, version 6.0 or later. The generated COBOL source code may be compiled and executed on the following systems and will do the actual comparison of the two data files.
| ||||||||
System Possibilities for Generated Data File Comparison Programs |
The SimoTime Utility for Data File Compare will provide additional detail about creating a Process Control File and generating the COBOL source code for a data file compare program.
The following is the Process Control File (CPRS8001.pcf) that will define the process and parameters required for generating a COBOL program that will compare two record sequential file (RSEQ) containing 80-byte, fixed length records.
*********************************************************************** * 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-2016 All Rights Reserved * * Web Site URL: http://www.simotime.com * * e-mail: helpdesk@simotime.com * *********************************************************************** * * The following group of statements will define the high level * functions and processes to be performed. * &SIMOPREP call ../Env1BASE &USERPREP call USERCOMP &FUNCTION COMPARE &CONFORM IBM * * The following statements will create an HTML Document of the * record structure based on the COPY File. * ©FILE CHAR80B1.CPY &HTMLFILE char80h1.htm * * The following group of statements will define the behavioral * characteristics and environment variable for the file I/O * functions within the Program to be generated. * *HEAD34 ....:....1....:....2....:....3.... &HEAD34 Do a Physical 80-Byte Comparison &PROGID CPRS80C1 &SYSUT1 name=RS0080D1 org=Sequential recfm=FIXED rlen=80 &SYSUT2 name=RS0080D2 org=Sequential recfm=FIXED rlen=80 * * The following group of statements will define the behavioral * characteristics and environment variable for the compare functions * within the Program to be generated. * &DELTAMAX 5 EOF &COMPARE PHYSICAL SYSUT1 pos 1 len 80 SYSUT2 pos 1 len 80 * &DFORMAT ASC HEX EBC DETAIL &SYSLOG ENABLE &DISPLAY SYSOUT * &END
This section provides additional detail about the CMD files and programs that are used to support this set of sample programs.
A Windows command file (Env1BASE.cmd) is called from other command files to set commonly used environment variables. This provides a single point of definition. The following is a listing of the contents of the command file.
@echo OFF rem * ******************************************************************* rem * ENV1BASE.cmd - a Windows Command File * rem * This program is provided by SimoTime Technologies * rem * (C) Copyright 1987-2015 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * rem * Text - Provide a single point to set common environment variables. rem * Author - SimoTime Technologies rem * Date - January 24, 1996 rem * rem * Set the commonly used environment variables. This is used to provide rem * a single point for managing the commonly used environment variables. rem * set SimoLIBR=c:\SimoLIBR set BaseLib1=c:\SIMOSAM1\DEVL set BaseLib8=c:\SimoSAM8 set BaseWIP1=c:\SimoSAM1\WIP1 set DATAZERO=c:\SIMODATA\DEVL\DATA\ZERO set BASEAPP=%BaseLib1% set BASESYS=%BaseLib1%\SYS1 set BASECAT=%BaseLib1%\DATA set SYSLOG=%BASESYS%\LOGS\SYSLOG_USER.DAT set SYSOUT=%BASEAPP%\LOGS\SYSOUT_SIMSAM01.TXT set SLZMSG=%BASEAPP%\LOGS\SLZMSG_USER.TXT set PostNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT set SimoNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT call SIMONOTE "* SIMONOTE Log File is %SIMONOTE% " rem * set CATALINA_HOME=C:\APACHETC\apache-tomcat-7.0.52 set JAVABASE=C:\Program Files (x86)\Java\jdk1.7.0_51 set JAVASDK="%JAVABASE%\bin" set JAVA_HOME=%JAVABASE% set JRE_HOME=%JAVABASE% rem * set MIFOEDEV=C:\Program Files (x86)\Micro Focus\Enterprise Developer\bin set MIFOBASE=C:\Program Files (x86)\Micro Focus\Studio Enterprise Edition 6.0\Base set MIFOBIN=%MIFOBASE%\bin set MIFOVCBL=C:\Program Files (x86)\Micro Focus\Visual COBOL\bin rem * Large file support, performance tuning and record locking of the File Handler set EXTFH=%BASESYS%\CONFIG\EXTFHBIG.CFG rem * For IMS Support set ES_IMSLIB=%BASEAPP%\IMSLIB set ES_ACBLIB=%BASEAPP%\IMSLIB rem * EZASOKETS Check EZASOKETS Enabled box or set ES_EZASOKET_SUPPORT=YES set EZACONFG=BASESYS1\CONFIG\EZACONFG.dat rem * rem * Resource Allocation and Performance for SORT and non-Relational Data rem set MFJSENGINE=SYNCSORT set SORTSCHEME=1 set SORTSPACE=750000000 set TMP=C:\SORTWORK rem * set ES_ALLOC_OVERRIDE=%BASESYS%\CONFIG\CATMAPA1.cfg rem * For CORE_ON_ERROR function, ABEND Dump rem * set COBCONFIG_=%BASESYS%\CONFIG\diagnose.cfg rem * rem * Consolidated Trace Facility (CTF) rem * set MFTRACE_CONFIG=%BASESYS%\CONFIG\ctf.cfg rem * set MFTRACE_LOGS=c:\ctflogs rem * rem * For Job Restart, ABEND Recovery set MF_UCC11=Y set ES_JES_RESTART=Y rem * rem * Set environment for MFBSI (Micro Focus Batch Scheduling Interface) set ES_EMP_EXIT_1=mfbsiemx set MFBSI_DIR=%BASESYS%\LOGS\%JESSERVERNAME% set MFBSIEOP_CMD=ENABLE set MFBSIEOP_CSV=ENABLE set MFBSIEOP_HTM=ENABLE set MFBSIEOP_XML=ENABLE rem * rem * Set Behavior and Trace Flags for GETJOBDD rem * Position=12345678/12345678 set JDDFLAGS=nnnWnnnn/YYnnnnnn rem * set MAINFRAME_FLOATING_POINT=true set COBIDY=%BASEAPP%\COBIDY set COBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;%SimoLIBR% set LIBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;%SimoLIBR% set TXDIR=%BASESYS%\LOADLIB;%MIFOBASE% set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE rem * if "%SIMOPATH%" == "Y" goto JUMPPATH if "%MIFOSYS1%" == "ESTU" set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%; if "%MIFOSYS1%" == "EDEV" set path=%BASESYS%\LOADLIB;%MIFOEDEV%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%; if "%MIFOSYS1%" == "VCBL" set path=%MIFOVCBL%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%; :JUMPPATH set SIMOPATH=Y rem * set USERCLASS=%BASELIB1%\LOADLIB set APACHEST=C:\Program Files (x86)\Apache Group\Apache2 set CLASSPATH=. set CLASSPATH=%CLASSPATH%;%JAVABASE% set CLASSPATH=%CLASSPATH%;%JAVABASE%\lib set CLASSPATH=%CLASSPATH%;\%USERCLASS% set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\ap01jv01\WEB-INF\classes set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\ap01jv01\WEB-INF\classes\simpacks if "%MIFOSYS1%" == "ESTU" set CLASSPATH=%CLASSPATH%;%MIFOBIN% if "%MIFOSYS1%" == "EDEV" set CLASSPATH=%CLASSPATH%;%MIFOEDEV% if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL% if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%\mfcobol.jar rem * set JobStatus=0000 call SimoNOTE "* Settings CmdName ENV1BASE.cmd, Version 14.03.28, %MIFOSYS1%" call SimoNOTE "* BaseAPP ..... %BASEAPP%" rem * call SimoNOTE "* MFBSIDIR .... %MFBSI_DIR% " call SimoNOTE "* MFTRACE_LOGS Folder is %MFTRACE_LOGS% "
The following SIMONOTE.cmd) is a listing of the contents of the SimoNOTE.CMD command file.
@echo OFF rem * ******************************************************************* rem * SIMONOTE.CMD - a Windows Command File * rem * This program is provided by SimoTime Technologies * rem * (C) Copyright 1987-2016 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * rem * Text - Display message on screen and write to a log file. rem * Author - SimoTime Technologies rem * rem * This script may be called from other scripts and expects a single rem * parameter enclosed in double quotes. The double quotes will be rem * removed. Before writing to the log file a date and time stamp rem * will be inserted in front of the message text. rem * rem * Note: The tilde (~) removes leading/trailing double-quotes. rem * if "%SimoNOTE%" == "" set SimoNOTE=c:\SimoLIBR\LOGS\SimoTime.LOG echo %date% %time% %~1>> %SimoNOTE% echo %~1
This example uses three data files to demonstrate the basic functions of the data file compare process. the first two files are sequential files containing three records of identical content. The third file is different from the first two files and is used to shows the results when a NOT-Equal condition occurs.
This JCL Member (CPRS80J8.jcl) will use IEBGENER to create three sequential files that will be used to test the Data File Compare program that was generated.
//CPRS80J8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CPRS80J8.JCL - a JCL Member for Batch Job Processing * //* This JCL Member is provided by SimoTime Technologies * //* (C) Copyright 1987-2016 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Text - Create Sequential Data Sets on disk using IEBGENER. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* The first job step (QSAMDELT) will delete any previously created //* file. The second job step (QCRTDIN1) will create a new file. //* //* The Steps 2-4 will create new sequential files. //* //* The last step will create a SYSLOG file. //* //* This set of programs will run on a mainframe under MVS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express. //* //* ******************************************************************* //* Step 1 of 5, Delete any previously created files... //* //QSAMDELT EXEC PGM=IEFBR14 //CRTRS801 DD DSN=SIMOTIME.DATA.RS80TT01,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //CRTRS802 DD DSN=SIMOTIME.DATA.RS80TT02,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //CRTRS803 DD DSN=SIMOTIME.DATA.RS80TT03,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //SYSLOG DD DSN=SIMOTIME.SYSLOG.CPRS80D1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 5, Create and populate a new QSAM file... //* This step will create a sequential file with three records. The //* length of the records is 80 bytes. //* //CRTRS801 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * Record 001, Text String 001... Record 002, Text String 002... Record 003, Text String 003... /* //SYSUT2 DD DSN=SIMOTIME.DATA.RS80TT01, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 3 of 5, Create and populate a new QSAM file... //* This step will create a sequential file with three records. The //* length of the records is 80 bytes. //* This file contains the same records as the file created in the //* preceding job step. //* //CRTRS802 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * Record 001, Text String 001... Record 002, Text String 002... Record 003, Text String 003... /* //SYSUT2 DD DSN=SIMOTIME.DATA.RS80TT02, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 4 of 5, Create and populate a new QSAM file... //* This step will create a sequential file with three records. The //* length of the records is 80 bytes. //* This file contains similar records as the file created in the //* preceding job step. However, the content of the second record //* contains additional text. //* //CRTRS803 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * Record 001, Text String 001... Record 002, Text String 002... Catch me... Record 003, Text String 003... /* //SYSUT2 DD DSN=SIMOTIME.DATA.RS80TT03, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 5 of 5, Create a new RSEQ file with variable length records //* //QCRTDIN1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * /* //SYSUT2 DD DSN=SIMOTIME.SYSLOG.CPRS80D1, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=V,LRECL=1055,DSORG=PS) //
This Windows CMD file (CPMK80W8.cmd) will use the Widows ECHO Command to create three ASCII/Text (or Line Sequential) files. The ASCII/Text files will then be converted to sequential files that will be used to test the Data File Compare program that was generated.
@echo OFF rem * ******************************************************************* rem * CPMK80W8.CMD - a Windows Command File * rem * This program is provided by SimoTime Technologies * rem * (C) Copyright 1987-2016 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * rem * Text - Create Sequential Data Sets on disk using IEBGENER. rem * Author - SimoTime Technologies rem * Date = January 24, 1996 rem * rem * The first job step (DeleteTEXT) will delete any previously created rem * files. rem * The second job step (CreateTEXT) will create a new ASCII/Text file. rem * The third step will convert the Line Sequential file to a Record rem * Sequential file. rem * rem * This set of programs will run on a Personal Computer with Windows rem * and Micro Focus Net Express. rem * set CmdName=CPMK80W8 call ..\Env1BASE %CmdName% if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%, User is %USERNAME%" call SimoNOTE "StepInfo Delete previously created files" set CPLS80D1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D1.TXT set CPLS80D2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D2.TXT set CPLS80D3=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D3.TXT rem * rem * ******************************************************************* rem * Step 1 of 6 Create and populate a new ASCII/TEXT file... rem * This step will create a sequential file with three records. The rem * length of the records is 80 bytes. rem * call SimoNOTE "StepInfo Create an ASCII/Text File" if exist %CPLS80D1% del %CPLS80D1% rem * ..1....:....2....:....3....:....4....:....5....:....6....:....7. echo Record 001, Text String 001...>%CPLS80D1% echo Record 002, Text String 002...>>%CPLS80D1% echo Record 003, Text String 003...>>%CPLS80D1% if exist %CPLS80D1% call SimoNOTE "DataMake %CPLS80D1%" if not exist %CPLS80D1% set JobStatus=9001 if not %JobStatus% == 0000 goto :EojNok rem * rem * ******************************************************************* rem * Step 2 of 6 Create and populate a new ASCII/TEXT file... rem * This step will create a sequential file with three records. The rem * length of the records is 80 bytes. rem * This file contains the same records as the file created in the rem * preceding job step. rem * call SimoNOTE "StepInfo Create an ASCII/Text File" if exist %CPLS80D2% del %CPLS80D2% rem * ..1....:....2....:....3....:....4....:....5....:....6....:....7. echo Record 001, Text String 001...>%CPLS80D2% echo Record 002, Text String 002...>>%CPLS80D2% echo Record 003, Text String 003...>>%CPLS80D2% if exist %CPLS80D2% call SimoNOTE "DataMake %CPLS80D2%" if not exist %CPLS80D2% set JobStatus=9001 if not %JobStatus% == 0000 goto :EojNok rem * rem * ******************************************************************* rem * Step 3 of 6 Create and populate a new ASCII/TEXT file... rem * This step will create a sequential file with three records. The rem * length of the records is 80 bytes. rem * This file contains similar records as the file created in the rem * preceding job step. However, the content of the second record rem * contains additional text. rem * call SimoNOTE "StepInfo Create an ASCII/Text File" if exist %CPLS80D3% del %CPLS80D3% rem * ..1....:....2....:....3....:....4....:....5....:....6....:....7. echo Record 001, Text String 001...>%CPLS80D3% echo Record 002, Text String 002... Catch me...>>%CPLS80D3% echo Record 003, Text String 003...>>%CPLS80D3% if exist %CPLS80D3% call SimoNOTE "DataMake %CPLS80D3%" if not exist %CPLS80D3% set JobStatus=9001 if not %JobStatus% == 0000 goto :EojNok rem * rem * ******************************************************************* rem * Step 4 of 6 Convert ASCII/TEXT file to ASCII RSEQ File... rem * call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential" set GETLS080=%CPLS80D1% set PUTRS080=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT01.DAT if exist %PUTRS080% del %PUTRS080% run CV80ALAR if not ERRORLEVEL = 0 set JobStatus=0030 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "DataTake %GETLS080%" call SimoNOTE "DataMake %PUTRS080%" rem * rem * ******************************************************************* rem * Step 5 of 6 Convert ASCII/TEXT file to ASCII RSEQ File... rem * call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential" set GETLS080=%CPLS80D2% set PUTRS080=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT02.DAT if exist %PUTRS080% del %PUTRS080% run CV80ALAR if not ERRORLEVEL = 0 set JobStatus=0030 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "DataTake %GETLS080%" call SimoNOTE "DataMake %PUTRS080%" rem * rem * ******************************************************************* rem * Step 4 of 6 Convert ASCII/TEXT file to ASCII RSEQ File... rem * call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential" set GETLS080=%CPLS80D3% set PUTRS080=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT03.DAT if exist %PUTRS080% del %PUTRS080% run CV80ALAR if not ERRORLEVEL = 0 set JobStatus=0030 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "DataTake %GETLS080%" call SimoNOTE "DataMake %PUTRS080%" rem * :EojAok call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% " goto :End :EojNok call SimoNOTE "NOTE ABENDING CmdName %CmdName%, Job Status is %JobStatus% " :End if not "%1" == "nopause" pause
The purpose of this document is to assist as a tutorial for new programmers or as a quick reference for experienced programmers. In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a choice of alternatives.
Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Enterprises. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Enterprises.
SimoTime Enterprises makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Enterprises shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.
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.
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 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
icon.
Explore the Principles of Data File Validation. This link includes guidelines for defining requirements and determining the scope of effort for a data validation effort. This effort includes a data file compare process, a technique for accumulating summary totals with a record count and a technique for reading a VSAM, KSDS and producing a hex-dump output based on a list of user-defined keys.
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.
Explore a Data File Compare Utility Program that is used to compare the content of two sequential files with 80 byte records. The positions within the record that are to be compared are determined at execution time. When a difference occurs the output may be written to SYSOUT or a log file. The COBOL source code for the program was generated using SimoTime technologies.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
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.
Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and/or QSAM files.
The following links will require an internet connect.
This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.
A good place to start is The SimoTime Home Page via Internet Connect for access to white papers, program examples and product information.
Explore The Micro Focus Web Site via Internet Connect for more information about products and services available from Micro Focus.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
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.
Founded in 1987, SimoTime Technologies is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems.
Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
Return-to-Top |
Data File Compare of Two Sequential Files with 80-Byte Records |
Copyright © 1987-2016 SimoTime Technologies All Rights Reserved |
When technology complements business |
http://www.simotime.com |