Random-Add-Update
ASCII-Text to EBCDIC-Indexed
  Table of Contents  v-19.00.00 - zap00501.htm 
  Introduction
  ASCII-Text to EBCDIC-Indexed
  The CMD File
  The Process Control File
  The COBOL Program
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This is an example of how a COBOL program can read an ASCII/Text file and write an EBCDIC-Indexed file. The COBOL source code was generated using SimoZAPS, a product of SimoTime Technologies. The SimoZAPS utility program also has the capability of reading, writing or converting between other file formats.

In the world of programming there are many ways to solve a problem. This program is provided as a COBOL example of one of the possible solutions to the problem of changing the contents and structure of data files.


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 ASCII-Text to EBCDIC-Indexed

This program will read an ASCII-Text file and write to an EBCDIC-Indexed (VSAM, KSDS - Keyed Sequential Data Set) file. This program does a random-add or update of the records to the EBCDIC-Indexed file. This approach is slower than an ordered load but does allow for records to be added or updated within the indexed file independent of the key-field sequence.

Table of Contents Previous Section Next Section The CMD File

The following Windows command file (IVP4GFC5.cmd) is used to do the generation of the data conversion program.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4GFC5.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  * This process will read the SYSCNTL5.TXT file and create the
rem  * ZAP005C1.CBL file using the SYSMASK2.TXT as a mask.
rem  * The SYSCNTL5.TXT file is expected to contains the specifications
rem  * for reading a sequential, 80-byte, fixed, EBCDIC file and creating
rem  * an INDEXED, 256-byte maximum record length, variable, ASCII file
rem  * with the key position at 1 for a key length of 6. This program
rem  * will do an unordered or random add to the Indexed file. The keys
rem  * do not need to be in sequence.
rem  *
     set UtlName=IVP4GFC5
     echo * %UtlName% Starting the GENERATE function of SimoZAPS
     call EZMFPATH
     set SYSOUT=SYSOUT_%UtlName%.txt
     set SYSCNTL=SYSCNTL5.pcf
     set SYSMODEL=SYSMASK2.txt
     set SYSCOBOL=DATAWRK1\ZAP005C1.cbl
     echo * %UtlName% SYSCOBOL is %syscobol%
     type %SYSCNTL%
     run SIMOZAPS generate
     echo * %UtlName% SYSCOBOL is %syscobol%
     echo * %UtlName% SYSCNTL is %syscntl%
     echo * %UtlName% Finished the GENERATE function of SimoZAPS
     if "%1" == "NOSHOW" goto :End
     echo * %UtlName% SYSCOBOL source is displayed in a separate window using NotePAD.
     start notepad %syscobol%
:End
     echo * %UtlName% Thank you for using the GENERATE function by SimoTime Technologies
     pause

Table of Contents Previous Section Next Section The Process Control File

The process control file (SYSCNTL5.pcf) provides the input specifications to generate a COBOL program that will do the actual data file conversion. The following is a listing of the content of the process control file.

***********************************************************************
*      SYSCNTL5.pcf - Process Control File, Input Specifications      *
*    This is an example of the convert specifications to generate a   *
*        Data File Conversion Program. This is used by SimoZAPS       *
*                        SimoTime Technologies                        *
*            (C) Copyright 1987-2019 All Rights Reserved              *
*              Web Site URL:   http://www.simotime.com                *
*                    e-mail:   helpdesk@simotime.com                  *
***********************************************************************
* SYSUT1 should be an ASCII-Text, 80-byte, variable, ascii file.      *
* SYSUT2 should be a INDEXED,    256-byte, variable, ebcdic file      *
*        with key position at 1 for a key length of 6.                *
*                                                                     *
* The VSAMLOAD statement specifies a random load (add or update) of   *
* records to the indexed (i.e VSAM KSDS) file. The input records from *
* SYSUT1 do not need to be in sequence by the key.                    *
***********************************************************************
/dialect   C2
/progid    ZAP005C1
/vsamload  random
/sysut1    name=ZAP005D1 org=ASCII/CRLF recfm=VARIABLE rlen=80
/sysut2    name=ZAP005D2 org=indexed    recfm=variable rlen=256 klen=6 kpos=1
*
/transMODE  A2E
*
/transinit X'40'
/translate from pos  1 len 80 to pos  1 len 80
*
/END

Table of Contents Previous Section Next Section The COBOL Program

The COBOL program that does the actual conversion is generated by the SimoZaps Utility program. This link provides a View of the COBOL Source Code and Copy File that does a file format and record content conversion from an ASCII/Text file to an EBCDIC encoded Indexed file.

Table of Contents Previous Section Next Section Summary

This is an example of how a COBOL program can read an ASCII/Text file and write an EBCDIC-Indexed file. This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.

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

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

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Comments or Feedback  section of this document.

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 is beyond the scope and purpose of this document. The first sub-section requires an internet connection, the second sub-section references locally available documents.

Note:  A SimoTime License is required for the items to be made available on a local 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.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

Link to Internet   Link to Server   Explore the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.

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.

The following is a list of some of the conversion programs created by the GENERATE function of SimoZAPS. These are provided as programming examples for COBOL.

Program Name  Description
zap00101 Convert from an EBCDIC-Sequential file to an ASCII-Text file.
zap00201 Convert from an EBCDIC-Sequential file to an ASCII-Indexed file (Sequential-Add).
zap00301 Convert from an EBCDIC-Sequential file to an ASCII-Sequential file.
zap00401 Convert from an ASCII-Text file to an EBCDIC-Indexed file (Sequential-Add).
zap00501 Convert from an ASCII-Text file to an EBCDIC-Indexed file (Random-Add).
  A List of Sample Conversion Programs Generated by SIMOZAPS

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.

Explore the GnuCOBOL Technologies available from SourceForge. SourceForge is an Open Source community resource dedicated to helping open source projects be as successful as possible. GnuCOBOL (formerly OpenCOBOL) is a COBOL compiler with run time support. The compiler (cobc) translates COBOL source to executable using intermediate C, designated C compiler and linker. This link will require an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Check out  The SimoTime Glossary  for a list of terms and definitions used in the documents provided by SimoTime.

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
COBOL Source Code for ASCII-Text to EBCDIC-Indexed (Random-Add) Conversion
Copyright © 1987-2019
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com