Data File Conversion
Generate COBOL Source Code
  Table of Contents  v-14.03.28 - datagnit.htm 
  Introduction
  Input to Generator Program
  The COBOL Copy File
  Specifications for File Format & Record Content Conversion
  Generate the COBOL Source Code
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview

Table of Contents Previous Section Next Section Introduction

This document describes how to generate the COBOL source code for two programs that will do a file format conversion (i.e. Record Sequential to Indexed) and a record content conversion (EBCDIC to ASCII). The first program will read an EBCDIC-encoded, Record Sequential file and write an ASCII -encoded Indexed file. The data conversion will be performed by a second COBOL program that is called by the first COBOL program. Since the COBOL source code is COBOL/2 compliant it may be compiled and executed on an IBM Mainframe (z/OS or VSE) or a Linux, UNIX or Windows System with Micro Focus Enterprise Developer.

The program generation is done on a Windows System and Micro Focus Enterprise Developer. However; the generated COBOL source code is COBOL/2 compliant. It may be compiled and executed on an IBM Mainframe System (z/OS or VSE) or a Linux, UNIX or Windows System with Micro Focus Enterprise Developer.

Performing this task will also generate an HTML document that describes the record layout based upon the 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 example illustrates the following functions.

Item Description
1 Generate the COBOL source code for a callable program that will convert a record (at the field level) from EBCDIC encoding to ASCII encoding.
2 Generate the COBOL source code for an I/O program that will read an EBCDIC encoded file, call a program to convert the record and write to the ASCII encoded file.
3 Create the file of specifications to generate the I/O program.
4 Create and execute a command file to automate and document the process.
  Functional Objectives of this Session

This module is part of The SimoPATH Series of training and reference materials. For more information refer to the following links.

Link to Internet   Link to Server   Explore The SIMOPATH Series starting at the home page to view information about training sessions and learning materials available from SimoTime Enterprises.

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.


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

Table of Contents Previous Section Next Section Input to Generator Program

Generating the COBOL source code to do the data file conversion is a two step process. The first step is to create the callable conversion program using the copy file as input. The second step is to create the I/O program using the specifications file as input.

Table of Contents Previous Section Next Section The COBOL Copy File

The file conversion is accomplished by reading a record, converting the content of the record and writing a record to a new file. The record-level conversion is done at the field-level. The COBOL copy file that defines the structure of a record layout is used to generate the callable conversion program.

Table of Contents Previous Section Next Section Specifications for File Format & Record Content Conversion

The following is the specifications file used in this session as input to create the I/O program. The statements in this files will be used to generate the source code that will read the EBCDIC encoded file and write the ASCII encoded file.

The following (ITREKA01.pcf) is the Process Control File (PCF) that will be used to generate the file compare program.

***********************************************************************
*                ITREKA01.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*             (C) Copyright 1987-2019 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 is a Record Sequential,  512-byte, fixed, EBCDIC file for
*        the Item Master file. This file was downloaded from the
*        mainframe using BINARY mode.
* SYSUT2 is a KSDS, 512-byte, variable, ASCII file for the Item
*        Master file used in a non-mainframe environment.
*
* This procdedure will generate the IO Program, the callable convert
* routine and the HTML Documentation for the Item Master file.
* The primary purpose for this program is to do the initial load of
* the Item Master file. The records in the input file (SYSUT1)
* must be in ascending sequence by the field that is used as the key
* in the Item Master File.
***********************************************************************
*
&SIMOPREP  call ..\..\ENV1BASE
&USERPREP  call USERCONV
&CONFORM   IBM
&COPYFILE  ITEMCB01.cpy
&HTMLFILE  itemcb01.htm
&DIALECT   C2
&VSAMload  SEQUENTIAL
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Load ASCII/KSDS from EBCDIC/RSEQ
&IOMODNAME ITREKAC1
&SYSUT1    name=ITMRE512 org=Sequential recfm=FIXED    rlen=512
&SYSUT2    name=ITMKA512 org=Indexed    recfm=VARIABLE rmin=512 rmax=512 kpos=1 klen=12
&PACKEDFLD SPACECONVERT
&TransCALL ITREKAR1
&TransMODE E2A
*
&END

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 Generate the COBOL Source Code

Windows Explorer may be used to view the SYSLOG file and examine the detailed information about the differences. From the left window pane navigate to the "CONVERTS" folder.

My Computer
Local Disk (C:)
 DATAMIG1
 DEVL
 CONVERTS

The following right-window-pane should be displayed. The "ItemE2Aexample.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\DEVL\CONVERTS directory.
2. From the right pane double-click on ItemE2Aexample.CMD to execute the process to generate the COBOL source code.

Executing the preceding should have generated the following three items.

1. A COBOL source member that performs the file I/O to read the EBCDIC-encoded file and write the ASCII-encoded file. This program contains a call to the second program that is generated to do the conversion of each record in the file.
2. A callable COBOL source member that performs the EBCDIC to ASCII conversion of a record at the field level.
3. An HTML member that documents the record layout based upon the COBOL copy file that defines the record structure.

The COBOL source members may now be compiled and executed as part of a Mainframe Express or Net Express project on a Windows platform. The Cobol source members may be transferred to a UNIX platform to be compiled and executed using Micro Focus COBOL. The source members may be transferred to a mainframe (z/OS or VSE) to be compiled and executed.

Table of Contents Previous Section Next Section Summary

The purpose of this document is to show how to execute (or run) a program that compares two data files.

Also, 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 choice of alternatives.

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 The SIMOPATH Series starting at the home page to view information about training sessions and learning materials available from SimoTime Enterprises.

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 capabilities of the SimoZAPS Utility Program. This includes generating a COBOL program that will do the conversion of sequential and VSAM (KSDS) files between EBCDIC and ASCII while maintaining mainframe (or COBOL) numeric formats and integrity. 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.

Link to Internet   Link to Server   Explore How to Document Record Layouts or other Data Structures using a COBOL copy file. For reference or documentation purposes SimoREC1 creates an ASCII/Text file and an HTML document from a COBOL copy file. The utility provides the length of a field and the position of the start of the field within a record. Also, the actual physical length for group items, packed fields, binary fields and tables will be calculated.

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 maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

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

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

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

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


Return-to-Top
Generate the Conversion Programs for the Item Master File
Copyright © 1987-2019
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com