|
|
Data File
Comparison Execute a Program from a Windows Command File http://www.simotime.com |
| When technology complements business | Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
This session explains how to execute a data file compare program. The COBOL source code for the compare program was generated with SimoTime technologies and compiled with Micro Focus Net Express.
| 1. | Create or use a command line script to execute a data file compare program. |
| 2. | Map the physical file names used by Windows to the externally defined file names used by the data file compare program. |
| 3. | Write execution information to a log file. |
Note: This module is part of The SimoPATH Series of training and reference materials. For more information refer to The Home Page for The SimoPATH Series.
This section describes how to use a previously created script to set up the environment and execute the data file compare program. When a difference occurs the information will be written to a log file.
The script file (ItUtl3E1.CMD) used in this session is a Microsoft Windows Command File. This command file is located in the "c:\DataMig1\CMDS" directory and may be viewed or edited using Notepad.
@echo OFF
rem * *******************************************************************
rem * This program is provided by: *
rem * SimoTime Enterprises, LLC *
rem * (C) Copyright 1987-2010 All Rights Reserved *
rem * Web Site URL: http://www.simotime.com *
rem * e-mail: helpdesk@simotime.com *
rem * *******************************************************************
rem *
rem * Text - Create a Sequential Data Set on disk using ECHO function.
rem * Author - SimoTime Enterprises
rem * Date - January 24, 1996
rem *
rem * The SimoEXEC is a driver program. This program will read the Windows
rem * command line to get the command line parameters.
rem *
rem * If the first parameter is "NOTE" then SimoEXEC will write the
rem * remaining parameters on the command line to a log file and display
rem * the information on the screen. This provides an audit or validation
rem * trail to identify a success or failure of the compile.
rem *
rem * If the first parameter is "EXEC" then it will use the second parameter
rem * as a program name and call the program. For the EXEC function the
rem * driver will look for a PARM= keyword and pass the value of the PARM=
rem * to the called program in a format that is similar to the way the PARM=
rem * is passed from mainframe JCL to a called (or EXECuted) program.
rem *
rem * The first job step (SetEnvironmentVariables) will set the commonly
rem * used environment variables.
rem * The second job step (MapFileNames) will map the file names.
rem *
rem * The third job step (CompareFiles) will compare two data files.
rem * The positions within the records to be compared are specified in
rem * the SYSUT3.TXT file.
rem *
rem * This set of programs will run on a Personal Computer with
rem * Windows and Micro Focus Net Express.
rem * Since the generated COBOL program is COBOL/390 compliant it may
rem * be compiled and executed on an IBM Mainframe or a UNIX platform
rem * running a Micro Focus COBOL sub-system.
rem *
rem * ********************************************************************
rem * Step 1 of 3 Set the global environment variables.
rem *
:SetEnvironmentVariables
setlocal
rem *
rem * The following called procedure (i.e. Command File) will set the commonly
rem * used environment variables. For example, this provides a single focal point
rem * to set the "BaseLib1" and "SYSLOG" environment variables that are used by
rem * this job and other complementary or independent jobs.
rem *
call EnvPrd01
if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem *
SimoEXEC NOTE *******************************************************ItUtl3E1
SimoEXEC NOTE Starting JobName ItUtl3E1, User is %USERNAME%
SimoEXEC NOTE Abstract Compare two data files using positional compare specs in SYSUT3
SimoEXEC NOTE Identify JobStep MapFileNames
rem *
rem * ********************************************************************
rem * Step 2 of 3 Map the file names.
rem *
:MapFileNames
set SysUt1=%BaseLib1%\DataEbc1\ItemEbc1.dat
set SysUt2=%BaseLib1%\DataWrk1\ItemEbc2.dat
set SysUt3=%BaseLib1%\DataTxt1\ItSysUt3.TXT
rem *
rem * *******************************************************************
rem * Step 3 of 3 Compare the two data files.
rem * The contents of SYSUT1 and SYSUT2 will be compared record by record.
rem * The positions within each record to be compared is determined by the
rem * contents of SYSUT3.
rem *
:CompareFiles
SimoEXEC NOTE Identify JobStep CompareFiles
SimoEXEC EXEC ItUtl3C1
if ERRORLEVEL 1 echo Error level is equal-to or Greater-then 1 . . .
if ERRORLEVEL 1 set JobStatus=0001
if not "%JobStatus%" == "0000" goto :EojNOK
rem *
rem * *******************************************************************
rem * End-of-Job Processing.
rem *
:EojAok
SimoEXEC NOTE Produced %TXTNPUT1%
SimoEXEC NOTE Finished JobName ItUtl3E1, Job Status is %JobStatus%
goto :End
rem *
:EojNok
SimoEXEC NOTE ABENDING JobName ItUtl3E1, Job Status is %JobStatus%
rem *
:End
SimoEXEC NOTE Conclude SysLog is %SYSLOG%
EndLocal
if not "%1" == "nopause" pause
From Windows Explorer execute the command file as follows.
| 1. | Select the "c:\DataMig1\CMDS" directory. |
| 2. | Double click on the "ItUtl3E1.CMD" item. |
When a difference in the files occurs the information is written to the log (SYSLOG) file. To view the SYSLOG file to examine the detailed information about a difference do the following from Windows Explorer.
| 1. | Select the "c:\DataMig1\LOGS" directory. |
| 2. | Double click on the "SysLog01.TXT" item. |
Notepad should display the following information (scroll to the end of the file to view the latest entries).
When a not equal condition is encountered the following is displayed to the screen and written to a logging file. 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 YELLOW high-lighting 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 GREEN row shows the positions that are equal (=) or not equal (#). The vertical PINK high-lighting emphasizes a position or column that is not equal. In this example the position is sixty-four (64).
*** 2006/02/27 13:55:10:79 Starting - Data File Content Comparison by SimoTime Enterprises, LLC *** 2006/02/27 13:55:10:79 ******************************************************************************************************************************** *** 2006/02/27 13:55:10:84 SYSUT1....000000001(00001:00092) *** 2006/02/27 13:55:10:84 ....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:...90.. *** 2006/02/27 13:55:10:84 .......................@...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@............@@@@@@@@@@@@...2.... *** 2006/02/27 13:55:10:84 FFFFFFFFFFFFC8AA988AA994C8944444444444444444444444444444444400000000C88844444444444400039000 *** 2006/02/27 13:55:10:84 0000000000014923992436903170000000000000000000000000000000000000000051380000000000000002C000 *** 2006/02/27 13:55:10:84 000000000001Distributor Cap ........Each ........ *** 2006/02/27 13:55:10:84 SYSUT2....000000001(00001:00092) *** 2006/02/27 13:55:10:84 ....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:...90.. *** 2006/02/27 13:55:10:85 .......................@...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...#........@@@@@@@@@@@@...2.... *** 2006/02/27 13:55:10:85 FFFFFFFFFFFFC8AA988AA994C8944444444444444444444444444444444400020000C88844444444444400039000 *** 2006/02/27 13:55:10:85 0000000000014923992436903170000000000000000000000000000000000003000A51380000000000000002C000 *** 2006/02/27 13:55:10:85 000000000001Distributor Cap ........Each ........ *** 2006/02/27 13:55:10:85 ===============================================================#===#======================== *** 2006/02/27 13:55:10:89 * *** 2006/02/27 13:55:10:89 Summary - Data File Content Comparison *** 2006/02/27 13:55:10:89 000000005 - Record count for SYSUT1 *** 2006/02/27 13:55:10:89 000000005 - Record count for SYSUT2 *** 2006/02/27 13:55:10:89 000000002 - Unequal count *** 2006/02/27 13:55:10:89 Finished - Data File Content Comparison by SimoTime Enterprises, LLC *** 2006/02/27 13:55:10:89 ABENDING Program ItUtl3C1, RC=0004, non-Zero return... *** 2006/02/27 13:55:10:89 ABENDING Program SimoEXEC, RC=0004 *** 2006/02/27 13:55:10:92 ABENDING JobName ItUtl3E1, Job Status is 0001 *** 2006/02/27 13:55:10:95 Conclude SysLog is c:\DataMig1\LOGS\SysLog01.TXT
The summary information shows the record counts and the number of unequal compares by record count.
The purpose of this document is to show how to execute (or run) a program that compares two data files.
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 express 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.
The Home Page for The SimoPATH Series is the starting point to view information about training sessions and learning materials available from SimoTime Enterprises.
The SimoZAPS Utility Program has the capability of generating a COBOL program that will do the conversion of sequential and VSAM (KSDS) files between EBCDIC and ASCII. SimoZAPS can also read a sequential file in EBCDIC format and create an ASCII/CRLF file or VSAM KSDS file in ASCII format. The conversion tables may be viewed or modified to meet unique requirements. The Hexcess/2 function provides the capability of viewing, finding or patching the contents of a file in hexadecimal.
This item will provide a link to an ASCII or EBCDIC translation table. A column for decimal, hexadecimal and binary is also included.
Check out The VSAM - QSAM Connection for more examples of mainframe VSAM and QSAM accessing techniques and sample code.
This document provides a quick summary of the File Status Key for VSAM data sets and QSAM files.
Check out The SimoTime Library for a wide range of topics for Programmers, Project Managers and Software Developers.
To review all the information available on this site start at The SimoTime Home Page .
Check out The SimoTime Glossary for a list of terms and definitions used in the documents provided by SimoTime.
If you have any questions, suggestions or comments please call or send an e-mail to: helpdesk@simotime.com
We appreciate your comments and feedback.
Founded in 1987, SimoTime Enterprises 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 |
| Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |