![]() |
EBCDIC-Sequential to ASCII-Text Installation Verification Program (IVP) |
| When technology complements business | Copyright © 1987-2013 SimoTime Enterprises All Rights Reserved |
| The SimoTime Home Page |
This is an example of how a Windows Command file and a generated COBOL program can read a sequential file that has been downloaded from a mainframe in EBCDIC format and write an ASCII, Text file. The COBOL source code was generated using SimoZAPS, a product of SimoTime Enterprises. 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.
This program will read an EBCDIC, Sequential (QSAM) file and write an ASCII, Text file. This program will change both the content and format. The content will be translated from EBCDIC to ASCII. The format will be changed from fixed-record-length with no record delimiters to variable-record-length with the carriage-return, line-feed (CRLF or x'0D0A') characters being used as the record delimiter. This program was compiled and tested on the PC using Mainframe Express (with the non-mainframe dialect) and Net Express (refer to http://www.microfocus.com ). Since the organization of the output file (ZAP001D2) is specified as LINE SEQUENTIAL (the Micro Focus terminology for ASCII Text files) this program will not compile or execute on the mainframe.
The following Windows command file (IVP4GFC1.CMD) is used to do the generation of the data conversion program.
@echo OFF
rem * *******************************************************************
rem * IVP4GFC1.CMD - a Windows Command File *
rem * This program is provided by SimoTime Enterprises *
rem * (C) Copyright 1987-2012 All Rights Reserved *
rem * Web Site URL: http://www.simotime.com *
rem * e-mail: helpdesk@simotime.com *
rem * *******************************************************************
rem * This process will read the SYSCNTL1.TXT file and create the
rem * ZAP001C1.CBL file using the SYSMASK1.TXT as a mask.
rem * The SYSCNTL1.TXT file is expected to contains the specifications
rem * for reading a sequential, 80-byte, fixed, EBCDIC file and creating
rem * an ASCII/CRLF, 80-byte, variable, ASCII file that uses a
rem * carriage-return and line-feed as a record separator.
rem *
echo * IVP4GFC1 Starting the GENERATE function of SimoZAPS
setlocal
call EZMFPATH
set UtlName=Ivp4Gfc1
set JobStatus=0000
set SimoNote=c:\SimoLIBR\LOGS\SimoTIME.LOG
call :PostNote "************************************************************%UtlName%"
call :PostNote "Starting JobName %UtlName%, User is %USERNAME%"
set SYSCNTL=syscntl1.txt
set SYSMODEL=sysmask1.txt
set SYSCOBOL=zap001c1.cbl
call :PostNote "SYSCNTL is %SYSCNTL%"
call :PostNote "SYSMODEL is %SYSMODEL%"
call :PostNote "SYSCOBOL is %SYSCOBOL%"
type %syscntl%
run simozaps generate
if ERRORLEVEL = 1 set JobStatus=0020
if not "%JobStatus%" == "0000" goto EojNok
goto :EojAok
rem *
rem ****************************************************************
rem * Display the message and write to the log file using ECHO.
rem * The ~ causes the leading/trailing double-quotes to be removed.
rem *
:PostNote
if "%SimoNote%" == "" set SimoNote=c:\SimoTime.LOG
echo %date% %time% %~1 >> %SimoNote%
echo * Ivp4Gfc1 %~1
goto :EOF
rem * The preceding :EOF is a reserved word/label that returns to
rem * the statement after the call to :PostNote.
rem *
rem ******************************************************************************
:EojNok
call :PostNote "ABENDING JobName %UtlName%, Job Status is %JobStatus%..."
goto :End
:EojAok
call :PostNote "Finished JobName %UtlName%, Job Status is %JobStatus%..."
echo * %UtlName% SYSCOBOL source is displayed in a separate window using NotePAD.
echo * %UtlName% Thank you for using the GENERATE function by SimoTime Enterprises
if "%1" == "NOSHOW" goto :End
start notepad %syscobol%
goto :End
:End
pause
The process control file (SYSCNTL1.TXT) 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.
*********************************************************************** * SYSCNTL1.CTL - Input Specifications * * This is an example of the convert specifications to generate a * * Data File Conversion Program. This is used by SimoZAPS * * SimoTime Enterprises * * (C) Copyright 1987-2012 All Rights Reserved * * Web Site URL: http://www.simotime.com * * e-mail: helpdesk@simotime.com * *********************************************************************** * SYSUT1 should be a sequential, 80-byte, fixed, ebcdic file. * * SYSUT2 should be a ASCII/CRLF, 80-byte, variable, ascii file. * * * * The DIALECT statement specifies the use of COBOL/2 compliant code * * for the generated conversion program. * * * * The TransLATE statement will move the input record of SYSUT1 to the * * output record of SYSUT2 and then translate the output record of * * SYSUT2 from EBCDIC to ASCII based on the parameter specified in the * * TransMODE Statement (E2A). * *********************************************************************** /DIALECT C2 *HEAD34 ....:....1....:....2....:....3.... /HEAD34 EBC to ASC, Sequential to Text /PROGID ZAP001C1 /SYSUT1 name=ZAP001D1 org=SEQUENTIAL recfm=FIXED rlen=80 /SYSUT2 name=ZAP001D2 org=ASCII/CRLF recfm=VARIABLE rlen=80 * /TRANSMODE E2A /TRANSINIT X'20' /TRANSLATE from POS 1 LEN 80 to POS 1 LEN 80 * /END
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 EBCDIC encoded record sequential file to an ASCII/Text file.
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 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.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
Explore the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.
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 is a list of some of the conversion programs created by the GENERATE function of SimoZAPS. These are provided as programming examples for COBOL.
| ||||||||||||
| A List of Sample Conversion Programs Generated by SIMOZAPS |
The following links will require an internet connect.
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.
Check out The SimoTime Glossary for a list of terms and definitions used in the documents provided by SimoTime.
This document was created and is copyrighted and maintained by SimoTime Enterprises.
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 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 |
| EBCDIC-Sequential to ASCII-Text, Installation Verification Program |
| Copyright © 1987-2013 SimoTime Enterprises All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |