|
|||||
|
This document describes how to generate the COBOL source code for a program that will compare the contents of two data files at the record level. Since the COBOL source code is COBOL/2 compliant it may be compiled and executed on an IBM Mainframe (z/OS or VSE), a Wintel platform (Windows and Micro Focus) or a UNIX platform (with Micro Focus).
Performing this task will also generate an HTML document that describes the record layout based upon a COBOL copy file definition of the record structure. The HTML document will provide field position within the record and field lengths (both logical which is based on the PIC and physical which is based on the COMP or COMP-3). This task is optional but recommended. The HTML document will be used to relate the position within the record where the failure occurred to the actual COBOL field name.
This example illustrates the following functions.
| 1. | Demonstrate how to generate the COBOL source code for a program that will compare two data files and show differences by the position within a record. |
| 2. | Demonstrate how to create the file of specifications to generate the data file compare program. |
| 3. | Demonstrate how to create a new (or use an existing) command file to automate and document the process. |
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.
Generating the COBOL source code to do the data file compare and the associated documentation for the record layout is a two step process. The first step is to create the data file compare program using the specifications file as input. The second step is to create the HTML documentation using a COBOL copy file as input.
The following is the specifications file used in this session as input to create the COBOL source code for a file compare program. The statements in this file will be used to generate the source code that will read two data files and compare positions within each record based upon the "/COMPARE" statements submitted at execution time via SYSUT3.
*********************************************************************** * This is an example of the compare specifications to generate a * * Data File Comparison Program. This is used by SimoZAPS * * SimoTime Enterprises, LLC * * (C) Copyright 1987-2006 All Rights Reserved * * Web Site URL: http://www.simotime.com * * e-mail: helpdesk@simotime.com * *********************************************************************** /Dialect C2 /PROGID ITUTL3C1 /SYSUT1 name=SYSUT1 org=Indexed recfm=variable rlen=512 klen=12 kpos=1 /SYSUT2 name=SYSUT2 org=Indexed recfm=variable rlen=512 klen=12 kpos=1 /SYSUT3 name=SYSUT3 org=ASCII/Text recfm=variable rlen=080 * /DELTAMAX 250 EOF /KEYFIELD SYSUT1 pos 1 len 12 SYSUT2 pos 1 len 12 *COMPARE SYSUT1 pos 1 len 512 SYSUT2 pos 1 len 512 *COMPARE uses SYSUT3 ... * /DFORMAT ASC HEX EBC * /END
The following is a brief description of the statements used in the preceding example.
| Statement ID | Description | ||||||
| /DIALECT | Generate COBOL source code that is COBOL/2 compliant. | ||||||
| /PROGID | This is the name of the program that will be used in the PROGRAM ID statement of the generated COBOL source code. | ||||||
| /SYSUT1 | Defines the properties for the primary or first input file | ||||||
| /SYSUT2 | Defines the properties for the secondary or second input file. | ||||||
| /SYSUT3 | Defines the properties for the input file that contains the
/COMPARE statements. The /COMPARE statements in this file are read at execution
time to determine the positions to be compared when reading the primary and
secondary input files. Note: In this exercise SYSUT3 is defined as an ASCII/Text file. To run on a mainframe this will need to be changed to a sequential file. |
||||||
| * | An asterisk in position one denotes a comment statement. | ||||||
| /DELTAMAX | Determine the maximum number of non-equal conditions before the
compare process is terminated.
|
||||||
| /KEYFIELD | specify the position and length of the key field. This is used to track inserts and deletes in the primary and secondary files. This may be used for indexed or sequential files. The indexed files will be in sequence by the key field. This function may be used for sequential files but the file must be in sequence by the specified key field. | ||||||
| /DFORMAT | Determine the format of the output to the screen and log file
when a difference is encountered.
|
Start Windows Explorer and from the Desktop item select the following.
| Desktop | ||||||||||||||
|
The following right-window-pane should be displayed. The "ItemCompSysUt3G1.CMD" is the Windows command (.CMD) provided to run this job.
From Windows Explorer perform the following steps.
| 1. | From the left pane select the c:\DataMig1\COMPARES directory. |
| 2. | From the right pane double-click on ItemCompSysUt3G1.CMD to execute the process to generate the COBOL source code. |
Executing the preceding process should have generated a COBOL source member. This member should have been stored in the "c:\DataMig1\COBOL" directory. Return to the main session to continue.
Note: The COBOL source member may now be compiled and executed as part of a Mainframe Express or Net Express project on a Windows platform. The COBOL source member may be transferred to a UNIX platform to be compiled and executed using Micro Focus COBOL. The COBOL source member may be transferred to a mainframe (z/OS or VSE) to be compiled and executed.
The purpose of this session was to describe how to generate the COBOL source code that will compare the contents of 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 SimoTime Home Page is the starting point to review all the information 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.
The SimoREC1 Utility Program has the capability of generating a callable COBOL program that will do the conversion of a data string between EBCDIC and ASCII. The generated COBOL source code or the conversion tables may be viewed or modified to meet unique requirements. The generated program may be called by an I/O program genrated by SimoZAPS.
This item will provide a link to an ASCII or EBCDIC translation table. A column for decimal, hexadecimal and binary is also included.
This document provides a quick summary of the File Status Key for VSAM data sets and QSAM files.
Check out The VSAM - QSAM Connection for more examples of mainframe VSAM and QSAM accessing techniques and sample code.
The hexadecimal dump of the parameter-buffer uses the same technique as describe in another SimoTime example that describes the dumping of a data string using COBOL. The name of the member that does the actual hexadecimal dump is called SimoDUMP. A copy file (PASSDUMP.CPY) is provided for defining the pass area.
You may view the complete list of examples at http://www.simotime.com/sim4dzip.htm and many are available as a SimoTime Z-Pack (a zip file package with sample source code, data and documentation).
Note: You must be attached to the Internet to download a Z-Pack or view the list.
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, Limited Liability Corporation located in Novato, California. 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-2007 SimoTime Enterprises, LLC All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |