SIMOZAPS, a Utility
File Convert, Compare or Hex-View
  Table of Contents  v-19.00.00 - simozaps.htm 
  Introduction
  Requirements and Installation
  Installation Verification Programs
  Hexadecimal File Access - HEXCESS
  IVP for HEXCESS, The VIEW Function
  IVP for HEXCESS, The FIND Function
  IVP for HEXCESS, The Patch Function
  IVP, Generate Convert Programs
  EBCDIC Sequential to ASCII Text
  EBCDIC Sequential to ASCII Indexed
  EBCDIC Sequential to ASCII Sequential
  ASCII Text to EBCDIC Indexed
  ASCII Text to EBCDIC Indexed (Random)
  IVP, Generate Compare Programs
  IVP, Text Replacement
  IVP, Member Names in Lower Case
  IVP, Format COBOL Source Code
  Using SIMOZAPS
  HEXCESS, Hexadecimal Function
  HEXCESS, Hex-View (or HEXDUMP)
  HEXCESS, the Find Function
  HEXCESS, the Patch Function
  HEXCESS, Micro Focus Environment
  Generate COBOL Source Code
  Generate a File Convert Program
  Process Control File
  ASCII - EBCDIC Convert Tables
  Model Source Code
  Model, Consecutive Access (Load/Extend)
  Model, Random Access (Update/Add)
  Convert, Consecutive Access (Load/Extend)
  EBCDIC Sequential to ASCII Text
  EBCDIC Sequential to ASCII Indexed
  EBCDIC Sequential to ASCII Sequential
  ASCII Text to EBCDIC Indexed
  Convert, Random Access (Update/Add)
  ASCII Text to EBCDIC Indexed
  Generate a File Compare Program
  Compare Positions Defined at Compile Time
  Prepare a Control File & Generate Program
  Compile the Program
  Execute the Program
  Compare Positions Defined at Execute Time
  Prepare a Control File & Generate Program
  Compile the Program
  Execute the Program
  Compare, Advanced Functions
  Compare, Sample Output for Not Equal
  Compare, Process Control File
  Compare, Create Test Data
  Translate Function, 80/80 Convert
  Modify Function
  Capabilities, Possibilities & Limitations
  Change a Text String
  Member Names in Lower Case
  Format COBOL Source Code
  COBOL Code, Case Consistency
  Summary
  Software Agreement and Disclaimer
  Purchases, 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

When working in a shared systems environment it is quite often necessary to view, modify, convert or compare the content and format of data files. This is especially true when moving source code, JCL or control files between the Mainframe System, an Application Server, a Windows System, a UNIX System or a Linux System. The ability to quickly convert the format and modify the content between ASCII and EBCDIC is a requirement. The ability to view or dump the content of a file in a hexadecimal display format can also be very helpful. When testing an application it is quite useful to be able to compare the contents of two data files and to select the information to be compared within a record.

In many circumstances these tasks are repetitive and run as transparent, automated processes. In this environment it is more important to be able to create a callable program or batch file than it is to have a graphical user interface that may require some human interaction during the execution process. The techniques used to do data file conversion or comparison must be able to execute on a Windows, UNIX, Linux or Mainframe System.

SimoZAPS is a collection of utility programs that are designed to fill this niche. SimoZAPS provides the following capabilities.

Item Description
1 View the contents of a file in hexadecimal format with translation to EBCDIC or ASCII whenever possible.
Scan a file and find information based on a user-submitted argument. The find argument may be specified in ASCII, EBCDIC or Hexadecimal format.
Patch bytes of information within a file based on a user submitted patch value. The patch information may be specified in ASCII, EBCDIC or HEX.
2 Generate COBOL programs that will convert data files on the mainframe, a Windows platform with Micro Focus or a UNIX platform with Micro Focus. Provide for the conversion of file format, record format and record content changes. Convert between ASCII and EBCDIC encoded formats at the field level while maintaining numeric encoded fields (packed or binary).
3 Generate a COBOL program that will compare the contents of two files.
4 Read an ASCII/Text file and create an EBCDIC, 80-byte, fixed record length file.
5 Read an EBCDIC, 80-byte, fixed record length file and create an ASCII/Text file.
6 Read an ASCII file of mixed case and create an ASCII file of all upper case.
7 Read an ASCII file of mixed case and create an ASCII file of all lower case.
8 Read a COBOL source program and create a new file with case formatting.
9 Read an ASCII/Text file and create a new ASCII/Text file allowing include, omit and global changes to the individual records.
  Overview of Functions provided by SIMOZAPS

In most cases SimoZAPS does not change the input file. It creates a copy of the file that contains the modifications. The PATCH function of HEXCESS makes changes directly to the specified file name.

SimoZAPS does not actually do the data conversion or comparison, it generates COBOL source code (or programs) that will be used to do the data conversion or comparison. This technique has two advantages.

Item Description
1 The COBOL source code may be compiled and executed on a Windows, UNIX or Windows System using Micro Focus COBOL or on a Mainframe System using IBM OS/390 COBOL or a later version.
2 The generated COBOL source code may be changed to meet unique or specialized processing requirements.
  Advantages of Generated COBOL Code for Data File Conversion or Comparison

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 Requirements and Installation

SimoZAPS requires approximately 1.1M of disk space. Windows/2000, Windows/NT or Windows/98 is the required operating system. The SimoZAPS program, this documentation, the Installation Verification Procedures (IVP's) and examples are provided in a zip'ed file.

To install SimoZAPS create a directory as follows.

C:\>md simolibr
C:\>cd SimoLIBR
C:\SIMOLIBR>md DataWrk1
C:\SIMOLIBR>md HTML
C:\SIMOLIBR>md LOGS
C:\SIMOLIBR>pkunzip simozaps.zip

Note:  If the target install directory for SimoLIBR is changed it will be necessary to modify the ZAPSREC1.CMD, ZAPSREC2.CMD and the IVP.CMD's to access the new directory structure. Also, the modified SimoLIBR directory should be added to the path statement.

Table of Contents Previous Section Next Section Installation Verification Programs

SimoZAPS contains a suite of Installation Verification Programs (IVP's). Their primary purpose is to verify that SimoZAPS has been properly installed. Their secondary purpose is to serve as sample programs.

The following is an overview of the IVP's.

Program Description
IVP4HEX1 Use the HEXCESS VIEW function to display the contents of a file in Hexadecimal with an EBCDIC and ASCII interpretation.
IVP4HEX2 Use the HEXCESS FIND function to find text strings within a file and display the contents of the matching segment in Hexadecimal with an EBCDIC and ASCII interpretation.
IVP4HEX3 Use the HEXCESS PATCH function to patch a 1 to 32 byte area within a file.
IVP4GFC1 Use the GENERATE function to read a SEQUENTIAL, 80-byte, fixed, EBCDIC file and create an ASCII/CRLF, 80-byte, variable, ASCII file.
Note: this function does not do the actual conversion. This function generates (or creates) the COBOL source code for a program that will do the conversion.
IVP4GFC2 Use the GENERATE function to read a SEQUENTIAL, 80-byte, fixed, EBCDIC file and create an INDEXED, 256-byte, variable, ASCII file with key position at 1 for a key length of 6.
Note: this function does not do the actual conversion. This function generates (or creates) the COBOL source code for a program that will do the conversion.
IVP4GFC3 Use the GENERATE function to read a SEQUENTIAL, 80-byte, fixed, EBCDIC file and create a SEQUENTIAL, 80-byte, fixed, ASCII file.
Note: this function does not do the actual conversion. This function generates (or creates) the COBOL source code for a program that will do the conversion.
IVP4GFC4 Use the GENERATE function to read an ASCII/CRLF, 80-byte, variable, ASCII file and create an INDEXED, 80-byte, variable, EBCDIC file.
Note: this function does not do the actual conversion. This function generates (or creates) the COBOL source code for a program that will do the conversion.
IVP4ZAP1 Use the MODIFY function to do a global replace of a text string in a single file or multiple files using a list of file names.
IVP4ZAP2 Use the MODIFY function to create a batch file that will rename all the members in a directory using lower case characters.
IVP4ZAP3 Use the FormatCOBOL function to format a COBOL source member.
  Hexadecimal File Access - HEXCESS

Table of Contents Previous Section Next Section Hexadecimal File Access - HEXCESS

The following three procedures will demonstrate the uses of the View, Find and Patch functions of SimoZAPS.

Table of Contents Previous Section Next Section IVP for HEXCESS, The VIEW Function

The following command will run the HEXCESS VIEW function to verify that SimoZAPS is installed and working.

C:\SIMOLIBR> ivp4hex1

The content of the IVP4HEX1.cmd file is as follows.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4HEX1.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 procedure will read the HELLO.CBL file and produce
rem  * a SYSLOG.TXT file that contains hexadecimal display
rem  * information with an EBCDIC and ASCII translation when
rem  * possible. The information is also displayed on the screen.
rem  *
     echo * IVP4HEX1 Starting the VIEW function of HEXCESS
     set syslog=syslog.txt
     if exist syslog.txt erase syslog.txt
     run SimoZAPS HEXCESS hello.cbl view=129 stop=256
echo *
echo * IVP4HEX1 The SYSLOG is displayed in a separate window,
echo * IVP4HEX1 to continue... close the SYSLOG window.
     start notepad syslog.txt
echo * IVP4HEX1 Thank you for using HEXCESS by SimoTime Technologies

Refer to the HEXCESS, Example of a Simple Hex-View section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section IVP for HEXCESS, The FIND Function

The following command will run the HEXCESS FIND function to verify that SimoZAPS is installed and working.

C:\SIMOLIBR> ivp4hex2

The content of the IVP4HEX2.cmd file is as follows.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4HEX2.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 procedure will read the HELLO.CBL file and produce
rem  * a SYSLOG.TXT file that contains hexadecimal display
rem  * information with an EBCDIC and ASCII translation when
rem  * possible. The information is also displayed on the screen.
rem  * The information displayed is selected based on the search
rem  * argument of the FIND function.
rem  *
     echo * IVP4HEX2 Starting the FIND function of HEXCESS
     set syslog=syslog.txt
     if exist syslog.txt erase syslog.txt
     run SimoZAPS HEXCESS hello.cbl find=1 len=8 ascii=division
echo *
echo * IVP4HEX2 The SYSLOG is displayed in a separate window,
echo * IVP4HEX2 to continue... close the SYSLOG window.
     start notepad syslog.txt
echo * IVP4HEX2 Thank you for using HEXCESS by SimoTime Technologies

Refer to the HEXCESS, Example of the FIND Function section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section IVP for HEXCESS, The Patch Function

The following command will run the HEXCESS PATCH function to verify that SimoZAPS is installed and working.

C:\SIMOLIBR> ivp4hex3

The content of the IVP4HEX3.cmd file is as follows.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4HEX3.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 procedure will read the HELLO.CBL file and modify or
rem  * patch the file directly. This is one of the functions that
rem  * does NOT create a new file. Therefore, make a backup copy
rem  * of the file prior to making any changes that use the
rem  * patch function.
rem  *
echo * IVP4HEX3 Starting the PATCH function of HEXCESS
     set syslog=syslog.txt
     if exist syslog.txt erase syslog.txt
     run SimoZAPS HEXCESS hello.cbl patch=1 len=6 hex=303132333435
echo *
echo * IVP4HEX3 The SYSLOG is displayed in a separate window,
echo * IVP4HEX3 to continue... close the SYSLOG window.
     notepad syslog.txt
echo * IVP4HEX3 Thank you for using HEXCESS by SimoTime Technologies

Refer to the HEXCESS, Example of the PATCH Function section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section IVP, Generate Convert Programs

The GENERATE function will generate (or create) the source code for a program that will do a file conversion. The following four Installation Verification Procedures (IVP's) are provided to verify proper installation of SimoZAPS and the proper configuration for the GENERATE function. Detailed information about the IVP's is provided in the Using SimoZAPS section.

The GENERATE function will generate (or create) the source code for a program that will do a file conversion. The following five Installation Verification Procedures (IVP's) are provided to verify proper installation of SimoZAPS and the proper configuration for the GENERATE function. Detailed information about the IVP's is provided in the Using SIMOZAPS, Generate a Data File Conversion Program section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section EBCDIC Sequential to ASCII Text

The following command (IVP4GFC1.cmd) will run the GENERATE function to create the COBOL source code for doing a file conversion from an EBCDIC Sequential file to an ASCII Text file.

C:\SIMOLIBR> IVP4GFC1

Refer to the Data File Conversion, EBCDIC Sequential to ASCI I Text section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section EBCDIC Sequential to ASCII Indexed

The following command (IVP4GFC2.cmd) will run the GENERATE function to create the COBOL source code for doing a file conversion from an EBCDIC Sequential file to an ASCII Indexed file.

C:\SIMOLIBR> IVP4GFC2

Note:  This program is intended for use when populating a new, empty file. The access mode is sequential and the input file must be in sequence according to the key field.

Refer to the Data File Conversion, EBCDIC Sequential to ASCI I Indexed (Sequential-Add) section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section EBCDIC Sequential to ASCII Sequential

The following command (IVP4GFC3.cmd) will run the GENERATE function to create the COBOL source code for doing a file conversion from an EBCDIC Sequential file to an ASCII Indexed file.

C:\SIMOLIBR> IVP4GFC3

Refer to the Data File Conversion, EBCDIC Sequential to ASCII Sequential section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section ASCII Text to EBCDIC Indexed

The following command (IVP4GFC4.cmd) will run the GENERATE function to create the COBOL source code for doing a file conversion from an ASCII Text file to an EBCDIC Indexed file.

C:\SIMOLIBR> IVP4GFC4

Refer to the Data File Conversion, ASCII Text to EBCDIC Indexed (Sequential-Add) section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section ASCII Text to EBCDIC Indexed (Random)

The following command (IVP4GFC5.cmd) will run the GENERATE function to create the COBOL source code for doing a file conversion from an ASCII Text file to an EBCDIC Indexed file. This IVP uses a random add and update approach for adding or updating records to the output file.

C:\SIMOLIBR> IVP4GFC5

Refer to the Data File Conversion, ASCII Text to EBCDIC Indexed (Random-Add) section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section IVP, Generate Compare Programs

The GENERATE function will generate (or create) the source code for a program that will do a file comparison of two files at the record level. The following Installation Verification Procedure (IVP) is provided to verify proper installation of SimoZAPS and the proper configuration for the GENERATE function for Data File Comparison. Detailed information about the IVP's is provided in the Using SIMOZAPS, Generate a Data File Comparison Program section of this document for a more detailed description of the preceding process.

C:\SIMOLIBR> IVPZFCG1

The following is the Window's Command file (IVPZFCG1.cmd) that executes the IVP.

@echo OFF
rem  * *******************************************************************
rem  *               IVPZFCG1.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  * *******************************************************************
     setlocal
     set PostNote=c:\SimoLIBR\LOGS\SimoTime.LOG
     set JobStatus=0000
     set ShowCode=SHOW
rem  *
     call :PostNote "************************************************************IvpZfcG1.CMD"
     call :PostNote "Starting JobName IvpZfcG1, User is %USERNAME%"
rem  *
     call :PostNote "************************************************************"
     call :PostNote "* This step will create the HTML documentation based on    *"
     call :PostNote "* the copy file that defines the record structure.         *"
rem  *
     call Rec1HTML c:\SimoLIBR\ITEMCB01.CPY c:\SimoLIBR\HTML\ITEMMAST.HTM IBM NOPAUSE
     if ERRORLEVEL = 1 goto :EojNOK
     call :PostNote "* The HTML document has been created.                      *"
rem  *
     call :PostNote "************************************************************"
     call :PostNote "* This step will generate the COBOL program that compares  *"
     call :PostNote "* two data files. If a difference is encountered the delta *"
     call :PostNote "* information will be displayed and written to a log file. *"
rem  *
     call ZapsCOMP c:\SimoLIBR\IvpZfcT1.txt c:\SimoLIBR\DataWrk1\IvpZcpC1.CBL
     if ERRORLEVEL = 1 goto :EojNOK
     call :PostNote "* The COBOL comparison program has been generated.         *"
rem  *
     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
     @echo OFF
     echo %date% %time% %~1            >> %PostNote%
     echo %~1
     goto :EOF
rem  * The preceding :EOF causes a return to caller within this CMD.
rem  *
rem  *********************************************************************
:EojNOK
     call :PostNote "ABENDING JobName IvpZfcG1, User is %USERNAME%"
     pause
rem  *
rem  *********************************************************************
:EojAOK
     call :PostNote "Finished JobName IvpZfcG1, User is %USERNAME%"
     echo * Thank you for using the GENERATE function by SimoTime Technologies
     pause
rem  *
:End

Table of Contents Previous Section Next Section IVP, Text Replacement

The following command (IVP4ZAP1.cmd) will run the MODIFY function to verify that SimoZAPS is installed and working. This IVP will do a "search and replace" function.

C:\SIMOLIBR> IVP4ZAP1

Refer to The MODIFY Function, Changing a Text String section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section IVP, Member Names in Lower Case

The following command (IVP4ZAP2.cmd) will run the MODIFY function to verify that SimoZAPS is installed and working. This IVP will do case conversion on a list of file names.

C:\SIMOLIBR> IVP4ZAP2

Refer to The MODIFY Function, Member Names in Lower Case section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section IVP, Format COBOL Source Code

The following command (IVP4ZAP3.cmd) will run the FormatCOBOL function to verify that SimoZAPS is installed and working.

C:\SIMOLIBR> IVP4ZAP3

Refer to the Format a COBOL Program for Case Consistency section of this document for a more detailed description of the preceding process.

Table of Contents Previous Section Next Section Using SIMOZAPS

SimoZAPS is divided into five functional areas. The following table is a quick summary of the functional areas.

Function Description
Hexcess This function will read a file and produce a new file containing hexadecimal dump information. The new file (SYSLOG) is ASCII/Text. In addition to the hexadecimal format the SYSLOG includes an EBCDIC and ASCII translation when possible.
Generate
Convert This function provides for translation between ASCII/Text and EBCDIC files. The content (ASCII or EBCDIC), record format (variable and fixed), the record lengths and the file type (sequential, indexed or ASCII/Text) may be converted.
Compare This function will compare the contents of two data files at the record level. Text string (by position and length) within each record may be selected for comparison. For keyed-indexed files missing or added records will be identified. Missing or added records may also be identified for sequential files if the files are sorted by a key field.
When a difference occurs the possible ASCII and EBCDIC values are displayed to the screen and written to a log file. A hexadecimal dump of the records is also displayed and written to the log file. This can be very useful in an environment where files have been downloaded from a mainframe in EBCDIC format.
Translate This function provides for simple translation between ASCII/Text and EBCDIC/80-byte files. Both the content (ASCII or EBCDIC) and file format (variable-text and fixed-80-byte) are converted.
Modify This function provides the capability of copying an ASCII/Text file. The content of the output file may be modified in the process. Individual records may be included or deleted based on their content. Also, individual records that are being copied may be modified using such keywords as insert, append, replace and more.
FormatCOBOL This function simply provides a consistent use of upper and lower case for COBOL source code. Many times we work with COBOL code that has evolved over a number of years and the use of upper and lower case varies widely. With the consistent use of upper/lower case it makes the code easier to read and understand.
  Brief Description of the Five Function provided by SIMOZAPS

The functions provided by SimoZAPS are described in more detail in the following sections.

Table of Contents Previous Section Next Section HEXCESS, Hexadecimal Function

The hexadecimal access function (HEXCESS) provides a "VIEW" capability (or hexadecimal dump) of a file in hexadecimal format (HEXDUMP). When possible the EBCDIC and ASCII characters are displayed. The HEXDUMP information is displayed and written to a SYSLOG file. The starting and stopping positions may be specified.

HEXCESS provides a "FIND" capability. A search argument may be specified and the input file is read until a data match is found. Once a data match is found the 128 byte section of the file containing the match is displayed and written to the SYSLOG file.

HEXCESS provides a "PATCH" capability. A data string of a maximum of thirty-two (32) bytes may be specified on the command line. This data string will be written at the position specified within the file.

The HEXCESS function of SimoZAPS is run from the command line as follows.

C:\> run SIMOZAPS HEXCESS filename Keyword=parameter . . .
                                   VIEW=start-position STOP=stop-position DUMP=BOTH
                                                                          DUMP=FILE
                                                                          DUMP=SHOW
                                   FIND=start-position LENGTH=nnn ASCII=xxx
                                                                  EBCDIC=xxxx
                                                                  HEX=xxxx
                                   PATCH=start-position LENGTH=nnn ASCII=xxx
                                                                   EBCDIC=xxxx
                                                                   HEX=xxxx

The following is a summary of the keyword=parameters capabilities provided by SimoZAPS and the HEXCESS function.

Run  Function filename keyword=parameter keyword=parameter etc...
SIMOZAPS HEXCESS filename
VIEW  This keyword=parameter defines the function to be performed and the starting position within the file.
VIEW=nnnnn where nnnnn specifies the starting position within the file.
stop   This keyword=parameter defines the stopping position within the file
STOP=nnnnn where nnnnn is the stopping position within the file.
DUMP   This keyword=parameter defines the output devices for the Hex Dump information. The DUMP=xxxx must be one of the following.
DUMP=BOTH - Hex Dump will be posted to a file and the system console.
DUMP=FILE - Hex Dump will only be posted to a file.
DUMP=SHOW - Hex Dump will only be posted to the system console.
SIMOZAPS HEXCESS filename
FIND   This keyword=parameter defines the function to be performed and the starting position within the file.
FIND=nnnnn where nnnnn specifies the starting position within the file.
length   This keyword=parameter defines the length of the search argument
LENGTH=nnnnn where nnnnn is the length of the search argument.
value   This keyword=parameter defines the format and content of the search argument.
ASCII=xxxxxxxx where xxxxxxxx is the ASCII content of the search argument
EBCDIC= xxxxxxxx where xxxxxxxx is the EBCDIC content of the search argument.
HEX=xxxxxxxx where xxxxxxxx is the hexadecimal content of the search argument. For example, HEX=C1C2 would be the EBCDIC equivalent of the letters AB.
SIMOZAPS HEXCESS filename
PATCH   This keyword=parameter defines the function to be performed and the starting position within the file.
PATCH=nnnnn where nnnnn specifies the starting position within the file.
length   This keyword=parameter defines the length of the search argument
LENGTH=nnnnn where nnnnn is the length of the search argument.
value   This keyword=parameter defines the format and content of the search argument.
ASCII=xxxxxxxx where xxxxxxxx is the ASCII content of the search argument
EBCDIC= xxxxxxxx where xxxxxxxx is the EBCDIC content of the search argument.
HEX=xxxxxxxx where xxxxxxxx is the hexadecimal content of the search argument. For example, HEX=C1C2 would be the EBCDIC equivalent of the letters AB.

HEXCESS includes three installation verification procedures (IVP's) that also serve as examples.

Table of Contents Previous Section Next Section HEXCESS, Hex-View (or HEXDUMP)

The following command (IVP4HEX1.cmd) does a simple hexadecimal view. The information is displayed to the screen and written to the SYSLOG file. The following shows the content of the command file.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4HEX1.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 procedure will read the HELLO.CBL file and produce
rem  * a SYSLOG.TXT file that contains hexadecimal display
rem  * information with an EBCDIC and ASCII translation when
rem  * possible. The information is also displayed on the screen.
rem  *
     echo * IVP4HEX1 Starting the VIEW function of HEXCESS
     set syslog=syslog.txt
     if exist syslog.txt erase syslog.txt
     run SimoZAPS HEXCESS hello.cbl view=129 stop=256
echo *
echo * IVP4HEX1 The SYSLOG is displayed in a separate window,
echo * IVP4HEX1 to continue... close the SYSLOG window.
     start notepad syslog.txt
echo * IVP4HEX1 Thank you for using HEXCESS by SimoTime Technologies

The following is the hexadecimal dump information that is displayed and written to the SYSLOG.

* Hexcess2 hello.cbl view 129 stop 256
* Hexcess2 Starting at   000000000129
* Hexcess2 Stopping at   000000000256
* Hexcess2 File size     000000002287
 Position Hex..... ........ ........ ........ ebcdic.......... ascii...........
000000129 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................ ****************
000000145 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................ ****************
000000161 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A0D0A ................ **************..
000000177 20202020 20202A0D 0A202020 2020202A ................       *..      *
000000193 20534F55 52434520 4D4F4455 4C452048 ..|.....(|..<...  SOURCE MODULE H
000000209 454C4C4F 2E43424C 0D0A2020 20202020 .<<|...<........ ELLO.CBL..
000000225 2A0D0A20 20202020 202A2A2A 2A2A2A2A ................ *..      *******
000000241 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................ ****************
* Hexcess2 Program-is-ENDING...

Table of Contents Previous Section Next Section HEXCESS, the Find Function

The IVP4HEX2.CMD does a find and dump when a match is found. The match process is not case sensitive. The argument for the FIND is specified in upper case it will find text string matches that are upper, lower or mixed case. For example, a FIND argument of 'ABC' would find a match for 'ABC', 'abc', or 'aBc'.

The hexadecimal find information is displayed to the screen and written to the SYSLOG file. The following command (IVP4HEX2.cmd) shows the content of the command file.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4HEX2.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 procedure will read the HELLO.CBL file and produce
rem  * a SYSLOG.TXT file that contains hexadecimal display
rem  * information with an EBCDIC and ASCII translation when
rem  * possible. The information is also displayed on the screen.
rem  * The information displayed is selected based on the search
rem  * argument of the FIND function.
rem  *
     echo * IVP4HEX2 Starting the FIND function of HEXCESS
     set syslog=syslog.txt
     if exist syslog.txt erase syslog.txt
     run SimoZAPS HEXCESS hello.cbl find=1 len=8 ascii=division
echo *
echo * IVP4HEX2 The SYSLOG is displayed in a separate window,
echo * IVP4HEX2 to continue... close the SYSLOG window.
     start notepad syslog.txt
echo * IVP4HEX2 Thank you for using HEXCESS by SimoTime Technologies

The following is the hexadecimal find information that is displayed and written to the SYSLOG.

* Hexcess2 hello.cbl find 1 length 8 ascii division
* Hexcess2 Find from     000000000001
* Hexcess2 Length is     000000000008
* Hexcess2 Find  ASCII   division
* Hexcess2 File size     000000002287
* Hexcess2 Hit Position  000000000023
* Hex-Find Starting... Dump Length = 0128
 Position Hex..... ........ ........ ........ ebcdic.......... ascii...........
000000007 20494445 4E544946 49434154 494F4E20 ....+........|+.  IDENTIFICATION
000000023 44495649 53494F4E 2E0D0A20 20202020 ......|+........ DIVISION...
000000039 20205052 4F475241 4D2D4944 2E202020 ..&.|...(.......   PROGRAM-ID.
000000055 2048454C 4C4F2E0D 0A202020 20202020 ...<<|..........  HELLO...
000000071 41555448 4F522E20 20202020 2020204D ....|..........( AUTHOR.        M
000000087 49434841 454C2053 494D4D4F 4E532E0D .....<...((|+... ICHAEL SIMMONS..
000000103 0A202020 2020202A 2A2A2A2A 2A2A2A2A ................ .      *********
000000119 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................ ****************
* Hex-Find Complete... Dump Length = 0128
* Hexcess2 Hit Position  000000000825
* Hex-Find Starting... Dump Length = 0128
 Position Hex..... ........ ........ ........ ebcdic.......... ascii...........
000000809 20202020 454E5649 524F4E4D 454E5420 .....+...|+(.+..     ENVIRONMENT
000000825 44495649 53494F4E 2E0D0A20 20202020 ......|+........ DIVISION...
000000841 202A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................  ***************
000000857 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................ ****************
000000873 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................ ****************
000000889 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................ ****************
000000905 2A2A0D0A 20202020 20202A0D 0A202020 ................ **..      *..
000000921 20202020 44415441 20444956 4953494F ...............|     DATA DIVISIO
* Hex-Find Complete... Dump Length = 0128
* Hexcess2 Hit Position  000000000930
* Hex-Find Starting... Dump Length = 0128
 Position Hex..... ........ ........ ........ ebcdic.......... ascii...........
000000914 202A0D0A 20202020 20202044 41544120 ................  *..       DATA
000000930 44495649 53494F4E 2E0D0A20 20202020 ......|+........ DIVISION...
000000946 2020574F 524B494E 472D5354 4F524147 ...|...+....|...   WORKING-STORAG
000000962 45205345 4354494F 4E2E0D0A 20202020 .......|+....... E SECTION...
000000978 20202A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................   **************
000000994 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A20 ................ ***************
000001010 20202020 20202020 20202020 20202020 ................
000001026 20202020 20202020 20202020 20202020 ................
* Hex-Find Complete... Dump Length = 0128
* Hexcess2 Hit Position  000000001777
* Hex-Find Starting... Dump Length = 0128
 Position Hex..... ........ ........ ........ ebcdic.......... ascii...........
000001761 20202020 20205052 4F434544 55524520 ......&.|.......       PROCEDURE
000001777 44495649 53494F4E 2E0D0A0D 0A202020 ......|+........ DIVISION.....
000001793 20202020 20202020 50655266 4F724D20 ........&...|.(.         PeRfOrM
000001809 506F5374 2D436F50 79526947 68542E0D &?....?&`....... PoSt-CoPyRiGhT..
000001825 0A0D0A20 20202020 20202020 20207045 ................ ...           pE
000001841 72466F52 6D204469 53704C61 592D4865 ..?._.....</.... rFoRm DiSpLaY-He
000001857 4C6C4F2D 576F526C 442E0D0A 0D0A2020 >%|..?.%........ LlO-WoRlD.....
000001873 20202020 20202020 20474F42 41434B2E ..........|.....          GOBACK.
* Hex-Find Complete... Dump Length = 0128
* Hexcess2 Find Count    000000000004
* Hexcess2 Program-is-ENDING...

Table of Contents Previous Section Next Section HEXCESS, the Patch Function

The following command (IVP4HEX3.cmd) does a patch and dump using the specified data string from the command line. The hexadecimal dump information is displayed to the screen and written to the SYSLOG file.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4HEX3.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 procedure will read the HELLO.CBL file and modify or
rem  * patch the file directly. This is one of the functions that
rem  * does NOT create a new file. Therefore, make a backup copy
rem  * of the file prior to making any changes that use the
rem  * patch function.
rem  *
echo * IVP4HEX3 Starting the PATCH function of HEXCESS
     set syslog=syslog.txt
     if exist syslog.txt erase syslog.txt
     run SimoZAPS HEXCESS hello.cbl patch=1 len=6 hex=303132333435
echo *
echo * IVP4HEX3 The SYSLOG is displayed in a separate window,
echo * IVP4HEX3 to continue... close the SYSLOG window.
     notepad syslog.txt
echo * IVP4HEX3 Thank you for using HEXCESS by SimoTime Technologies

The following is the hexadecimal dump information that is displayed and written to the SYSLOG.

* Hexcess2 hello.cbl patch 1 length 6 hex 303132333435
* Hexcess2 Patching at   000000000001
* Hexcess2 Length is     000000000006
* Hexcess2 Patch HEX     303132333435
* Hexcess2 File size     000000002287
* HexPatch Starting... Dump Length = 0128
 Position Hex..... ........ ........ ........ ebcdic.......... ascii...........
000000001 30313233 34352049 44454E54 49464943 ..........+..... 012345 IDENTIFIC
000000017 4154494F 4E204449 56495349 4F4E2E0D ...|+.......|+.. ATION DIVISION..
000000033 0A202020 20202020 50524F47 52414D2D ........&.|...(. .       PROGRAM-
000000049 49442E20 20202048 454C4C4F 2E0D0A20 .........<<|.... ID.    HELLO...
000000065 20202020 20204155 54484F52 2E202020 ..........|.....       AUTHOR.
000000081 20202020 204D4943 4841454C 2053494D .....(.....<...(      MICHAEL SIM
000000097 4D4F4E53 2E0D0A20 20202020 202A2A2A (|+............. MONS...      ***
000000113 2A2A2A2A 2A2A2A2A 2A2A2A2A 2A2A2A2A ................ ****************
* HexPatch Complete... Dump Length = 0128
* Hexcess2 Program-is-ENDING...

Table of Contents Previous Section Next Section HEXCESS, Micro Focus Environment

The Mainframe Express (MFE) and Net Express products from Micro Focus offer excellent program development environments that run on the PC. Both products have an "Options" capability that provides for the integration of programs and other development tools. This section describes how to integrate the Hex-Dump capabilities of SimoZAPS into either the MFE or Net Express desktop. It is assumed that SimoZAPS has been installed in the C:\SIMOLIBR directory.

If all you want to do is a Hex-Dump of PC files the SIMOZAPS.EXE member is all that is needed. It was originally designed to run from a PC Command Line as a batch process. Using the ZAPSHEX1.CMD file makes it a simple process to add the Hex-Dump capability to the MFE or Net Express toolbar.

The following shows the content of the ZAPSHEX1.cmd file.

@echo OFF
rem  * *******************************************************************
rem  *               ZAPSHEX1.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2018 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Provide a single point to set common environment variables.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * Set the commonly used environment variables. This is used to provide
rem  * a single point for managing the commonly used environment variables.
rem  *
     set JobStatus=0000
     if "%SimoLIBR%" == "" set SimoLIBR=c:\SimoLIBR
     set SYSLOG=%SimoLIBR%\LOGS\ZapsDump.LOG
     set ZapsView=1
     set ZapsStop=20480
     if not "%2" == "" set ZapsView=%2
     if not "%3" == "" set ZapsStop=%3
rem  *
     call SimoNote "************************************************************ZapsHex1"
     call SimoNote "Starting JobName ZapsHex1, User is %USERNAME%"
rem  *
     if exist %SYSLOG% erase %SYSLOG%
     run simozaps hexcess %1 view=%zapsview% stop=%zapsstop%
     if errorlevel = 1 set JobStatus=0001
     if not "%JobStatus%" == "0000" goto :EojNOK
rem  *
echo * ZapsHex1 The HexDump Information is displayed in separate window using Notepad,
echo * ZapsHex1 please close the separate Notepad window to end the task.
     START notepad %SYSLOG%
rem  *
:EojAOK
     call SimoNote "Finished JobName ZapsHex1"
     if not "%4" == "nopause" pause
     goto :End
:EojNOK
     call SimoNote "ABENDING JobName ZapsHex1"
     call SimoNote "ABENDING Message JobStatus %JobStatus%"
     pause
     goto :End
:End

Note:  depending on the version of Windows you are running the pause statement may or may-not be required.

From the toolbar of the desktop for MFE or Net Express select Options, then select Customize IDE from the drop-down menu and a new window will be displayed.

From the "Customize IDE" window select the Tools Tab, then select New Tool.

Enter the following for the ?Enter menu text? prompt.

HexCess 1st 1K, highlight a file

Now enter the following values

   Command: c:\SIMOLIBR\ZAPSHEX1.CMD
   Arguments: $(FileSel) 1 1024 nopause
   Start in; c:\SIMOLIBR

Note:  The $(FileSel) will substitute the name of the high-lighted member when executing ZAPS4HEX1 from the MFE or Net Express Tool bar.

Click OK and this will complete the process of integrating the Hex-Dump function of SimoZAPS.

From the MFE or Net Express desktop (either the source member list or the catalog for MFE) select a member or simple high-light a member name.

Select the Tools option from the MFE or Net Express Tool bar, then select the HexCess 1st 1K, highlight a file from the drop-down menu.

Note:  The dump information will scroll in a window and the dump information will be written to the ZAPSDUMP.LOG file. Notepad will be used to view the dump file.

Table of Contents Previous Section Next Section Generate COBOL Source Code

SimoZAPS does not actually do the Data File Conversion or Comparison. It generates COBOL source code that does the actual conversion or comparison. This COBOL source code may be compiled and executed on a Mainframe System (z/OS or VSE) or a Linux, UNIX or Windows System with Micro Focus COBOL. The following sections describe the Data File Conversion and Comparison processes in more detail.

Table of Contents Previous Section Next Section Generate a File Convert Program

This function will generate the COBOL source code for a file conversion program. This file conversion program (SYSCOBOL) will read an input file (SYSUT1) and create a new output file (SYSUT2). The format of SYSUT1 and SYSUT2 is specified by records contained in a control or specifications file (SYSCNTL).

             
IVP4GFC1
cmd
Start the processing to generate Convert Program
   
SIMOZAPS
utility
Determine if a CONVERT request and call SimoCNVT.
   
SYSCNTL
lseq
   
   
SIMOCNVT
convert
 
 
SYSCOBOL
cbl
Read the specifications from SYSCNTL and use SYSMODEL as a template to create SYSCOBOL.CBL.
   
   
SYSMODEL
lseq
   
   
   
   
EOJ
End-Of-Job
 
Generate a Data File Conversion Program

 

The following (IVP4GFC1.cmd) is an example of a batch file that will generate the source code for a file conversion program.

@echo OFF
     set UtlName=IVP4GFC1
rem  * *******************************************************************
rem  *               IVP4GFC1.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 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 SYSOUT=SYSOUT_%UtlName%.txt
     set JobStatus=0000
     set SimoNote=c:\SimoLIBR\LOGS\SimoTIME.LOG
     call :PostNote "************************************************************%UtlName%"
     call :PostNote "Starting JobName %UtlName%, User is %USERNAME%"
     set SYSCNTL=SYSCNTL1.pcf
     set SYSMODEL=SYSMASK1.txt
     set SYSCOBOL=DATAWRK1\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 Technologies
     if "%1" == "NOSHOW" goto :End
     start notepad %syscobol%
     goto :End
:End
     pause

Table of Contents Previous Section Next Section Process Control File

The following (SYSCNTL1.pcf) is an example of a SYSCNTL file (also referred to as a Process Control File or PCF).

***********************************************************************
*      SYSCNTL1.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 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 following is a description of the statements (or record types) contained in the control file (SYSCNTL) that is ued to generate a Data File Convert Program.

 
The following keyword/parameters are used for file and translate definitions.
Keyword  Parameters
/PROGID
    ProgID=xxxxxxxx - where XXXXXXXX is an eight character name
/DIALECT
    Dialect=xx - where XX is one of the following
C2   COBOL/2 compliant
MF   Micro Focus COBOL compliant
/HEAD34
    A thirty-four (34) character text string that will be included in the header information that is displayed when the generated conversion program is executed.
/VSAMLOAD
Sequential   This will do a sequential or ordered load. The keys are expected to be in sequence. This option should use SYSMASK1.TXT as the SYSMODEL
Random   This will do a random add or update for an unordered load. The keys may be out of sequence. This option should use SYSMASK2.TXT as the SYSMODEL
/SYSUT1 
    org=sequential recfm=fixed rlen=80 block=1600
name   This keyword=parameter defines the 8-character (or less) DD name for SYSUT1. The default value is SYSUT1.
name=SEQINPUT defines the DDNAME for SYSUT1.
org   This keyword=parameter defines the file organization.
org=SEQUENTIAL defines a sequential file.
org=INDEXED defines a a keyed-index file or VSAM Key-Sequenced-Data-Set (KSDS).
org=RELATIVE defines a Relative Record file or a VSAM Relative-Record-Data-Set (RRDS)
org=ASCII/CRLF defines an ASCII/Text file with Carriage Return and Line Feed used as record separators.
org=ASCII/TEXT is the same as ASCII/CRLF.
org=ZOS/V defines a sequential file with variable length records. This file uses a mainframe format and is usually downloaded from a mainframe using FTP with BINARY mode.
recfm   This keyword=parameter defines the format of the records within the file.
recfm=FIXED defines the records as fixed length.
recfm=VARIABLE defines the records as variable length
rlen   This keyword=parameter defines the fixed record length of each record in the file.
rlen=nnnnn where nnnnn is the fixed record length. For variable length records refer to RMIN and RMAX.
rmin   This keyword=parameter defines the minimum record length of records in the file.
rmin=nnnnn where nnnnn is the minimum record length. For fixed record length files refer to RLEN.
rmax   This keyword=parameter defines the maximum record length of records in the file.
rmax=nnnnn where nnnnn is the maximum record length. For fixed record length files refer to RLEN.
block   This keyword=parameter defines the block length.
block=nnnnn where nnnnn is the block length
klen   This keyword=parameter defines the length of the key.
klen=nnnnn where nnnnn is the key length.
kpos   This keyword=parameter defines the starting position of the key within the record.
kpos=nnnnn where nnnnn is the key starting position within a record.
recmode   This keyword will cause the RECORDING MODE to be added to the FD statement using the RECFM value.
recvary   This keyword will cause the RECORD VARYING to be added to the FD statement using the RMIN and RMAX values.
/SYSUT1A 
    alen=6 apos=1 with duplicates
alen   This keyword=parameter defines the length of an alternate key.
alen=nnnnn where nnnnn is the key length.
apos   This keyword=parameter defines the starting postion of an alternate key within the record.
apos=nnnnn where nnnnn is the key starting position within a record.
with   This is an optional keyword
dupes   This keyword (dupes or duplicates) is used to specify a file that has duplicate keys for an alternate key (or index).
/SYSUT2 
    org=sequential recfm=fixed rlen=80 block=1600
name   This keyword=parameter defines the 8-character (or less) DD name for SYSUT1. The default value is SYSUT1.
name=SEQINPUT defines the DDNAME for SYSUT1.
org   This keyword=parameter defines the file organization.
org=SEQUENTIAL defines a sequential file.
org=INDEXED defines a a keyed-index file or VSAM Key-Sequenced-Data-Set (KSDS).
org=RELATIVE defines a Relative Record file or a VSAM Relative-Record-Data-Set (RRDS)
org=ASCII/CRLF defines an ASCII/Text file with Carriage Return and Line Feed used as record separators.
org=ASCII/TEXT is the same as ASCII/CRLF.
org=ZOS/V defines a sequential file with variable length records. This file uses a mainframe format and is usually downloaded from a mainframe using FTP with BINARY mode.
recfm   This keyword=parameter defines the format of the records within the file.
recfm=FIXED defines the records as fixed length.
recfm=VARIABLE defines the records as variable length
rlen   This keyword=parameter defines the fixed record length of each record in the file.
rlen=nnnnn where nnnnn is the fixed record length. For variable length records refer to RMIN and RMAX.
rmin   This keyword=parameter defines the minimum record length of records in the file.
rmin=nnnnn where nnnnn is the minimum record length. For fixed record length files refer to RLEN.
rmax   This keyword=parameter defines the maximum record length of records in the file.
rmax=nnnnn where nnnnn is the maximum record length. For fixed record length files refer to RLEN.
block   This keyword=parameter defines the block length.
block=nnnnn where nnnnn is the block length
klen   This keyword=parameter defines the length of the key.
klen=nnnnn where nnnnn is the key length.
kpos   This keyword=parameter defines the starting position of the key within the record.
kpos=nnnnn where nnnnn is the key starting position within a record.
RECMODE   This keyword will cause the RECORDING MODE to be added to the FD statement using the RECFM value.
RECVARY   This keyword will cause the RECORD VARYING to be added to the FD statement using the RMIN and RMAX values.
EXTEND   This keyword will cause the file to be opened as EXTEND. This is typically used when the file type is sequential or relative.
/SYSUT2A 
    alen=6 apos=1 with duplicates
alen   This keyword=parameter defines the length of an alternate key.
alen=nnnnn where nnnnn is the key length.
apos   This keyword=parameter defines the starting postion of an alternate key within the record.
apos=nnnnn where nnnnn is the key starting position within a record.
with   This is an optional keyword
dupes   This keyword (dupes or duplicates) is used to specify a file that has duplicate keys for an alternate key (or index).
/TRANSMODE 
    TransMODE=XXX - where XXX is one of the following.
Note: if using the /TRANSCALL function to do the conversion then refer to the SimoREC1 documentation for specifying the conversion.
E2A   Do EDCDIC to ASCII conversion
A2E   Do ASCII to EBCDIC conversion
E2E   The input file (SYSUT1) and the output file (SYSUT2) are both EBCDIC. The /TransLATE option will perform the same as the /TransCOPY option.
A2A   The input file (SYSUT1) and the output file (SYSUT2) are both ASCII. The /TransLATE option will perform the same as the /TransCOPY option.
/TRANSINIT 
    TransINIT=XXXXXXXXXX - where XXXXXXXXXXX is one of the following
SPACES   Initialize the SYSUT2 record to all spaces
LOW-VALUES   Initialize the SYSUT2 record to all low-values
HIGH-VALUES   Initialize the SYSUT2 record to all high-values
X'00'   Initialize the SYSUT2 record to the hex value specified
 
The following keyword/parameters are used for data transfer/manipulation within a record.
Keyword  Parameters
/TRANSCALL Callable routine name (eight characters maximum length)
/TRANSCOPY  The TRANSCOPY function will simply copy information from the input record to the output record. The keyword/parameter syntax is as follows:
FROM POS pos-1 LEN len-1 TO POS pos-2 LEN len-2
/TRANSFILL  POS pos-1 LEN len-1 'zzzzzzz'
POS pos-1 LEN len-1 x'zzzzzzz'
/TRANSFLIP  FROM POS pos-1 LEN len-1 TO POS pos-2 LEN len-2
/TRANSLATE  FROM POS pos-1 LEN len-1 TO POS pos-2 LEN len-2
/TRANSVREC The TRANSVREC function requires one parameter. If used it must be ENABLE or DISABLE. If the ENABLE is specified the input record will be copied to the output record based on the length if the input record. If this function is missing the DISABLE keyword is used then the Variable length information will be ignored.
 

Table of Contents Previous Section Next Section ASCII - EBCDIC Convert Tables

The following command member (ASCEBCB1.cpy) is the source code (or COBOL copy file) for the ASCII - EBCDIC conversion tables.

      *****************************************************************
      *               AE9437B1.cpy - a COBOL Copy File                *
      *         Copyright (C) 1987-2018 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * The following tables are used by the INSPECT statement to do  *
      * the conversion between EBCDIC and ASCII.                      *
      *                                                               *
      *   inspect FIELD-NAME converting EBCDIC-INFO to ASCII-INFO     *
      *   inspect FIELD-NAME converting ASCII-INFO  to EBCDIC-INFO    *
      *                                                               *
      * The tables include the alphabet for upper and lower case, the *
      * digits 0-9, the special characters (US) and the alternate     *
      * codes for A, E, I, O, and U with the appropriate acute,       *
      * grave, umlaut, circumflex and tilde.                          *
      * To display the alternate codes the Courier New (Fixed) or     *
      * Times New Roman (Proportional) font should be used.           *
      *                                                               *
      * SimoZAPS contains four tables that may be used for various    *
      * Upper/Lower Case or EBCDIC/ASCII conversion requirements.     *
      * ASCEBCB1.CPY - includes a full character set for the alphabet *
      *                (upper/lower case), digit, special characters  *
      *                and alternate codes for characters with the    *
      *                acute, grave, umlaut, tilde and circumflex.    *
      *                Caution: this table does not convert the Y     *
      *                characters with an umlat.                      *
      * ASCEBCB2.CPY - includes the character set for the translation *
      *                between EBCDIC/ASCII of signed/unsigned,       *
      *                zoned-decimal, numeric fields.                 *
      * ASCEBCB3.CPY - includes the character set for the alternate   *
      *                codes with the acute, grave, umlaut, tilde and *
      *                circumflex. This is primarily used for case    *
      *                conversion.                                    *
      *                Note: this table converts the Y characters     *
      *                with an umlat, this will convert high-values   *
      *                X'FF' to X'DF'                                 *
      * ASCEBCB4.CPY - includes the character set for the alphabet    *
      *                (upper/lower case), digit, special characters. *
      *                This is primarily used in the US where the     *
      *                alternate codes may not be required.           *
      * ASCEBCB5.CPY - includes a full character set for the alphabet *
      *                (upper/lower case), digit, special characters  *
      *                and alternate codes for characters with the    *
      *                acute, grave, umlaut, tilde and circumflex.    *
      *                Caution: this table will convert the Y         *
      *                characters with an umlat.                      *
      *****************************************************************
      *
      *    ------------------------------------------------------------
       01  EBCDIC-DATA.
           05  FILLER pic X(16)
                          value X'000102030405060708090A0B0C0D0E0F'.    000-015
           05  FILLER pic X(16)
                          value X'101112131415161718191A1B1C1D1E1F'.    016-031
           05  FILLER pic X(16)
                          value X'202122232425262728292A2B2C2D2E2F'.    032-047
           05  FILLER pic X(16)
                          value X'303132333435363738393A3B3C3D3E3F'.    048-063
           05  FILLER pic X(16)
                          value X'404142434445464748494A4B4C4D4E4F'.    064-079
           05  FILLER pic X(16)
                          value X'505152535455565758595A5B5C5D5E5F'.    080=095
           05  FILLER pic X(16)
                          value X'606162636465666768696A6B6C6D6E6F'.    096-111
           05  FILLER pic X(16)
                          value X'707172737475767778797A7B7C7D7E7F'.    112-127
           05  FILLER pic X(16)
                          value X'808182838485868788898A8B8C8D8E8F'.    128-143
           05  FILLER pic X(16)
                          value X'909192939495969798999A9B9C9D9E9F'.    144-159
           05  FILLER pic X(16)
                          value X'A0A1A2A3A4A5A6A7A8A9AAABACADAEAF'.    160-175
           05  FILLER pic X(16)
                          value X'B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'.    176-191
           05  FILLER pic X(16)
                          value X'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF'.    192-207
           05  FILLER pic X(16)
                          value X'D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'.    208-223
           05  FILLER pic X(16)
                          value X'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF'.    224-239
           05  FILLER pic X(16)
                          value X'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'.    240-255

       01  E-INFO           redefines EBCDIC-DATA pic X(256).
       01  EBCDIC-TABLE     redefines EBCDIC-DATA.
           05  EBCDIC-BYTE  pic X     occurs 256 times.
      *
      *    ------------------------------------------------------------
       01  ASCII-DATA.
           05  FILLER pic X(16)
                          value X'000102039C09867F978D8E0B0C0D0E0F'.    000-015
           05  FILLER pic X(16)
                          value X'101112139D8508871819928F1C1D1E1F'.    016-031
           05  FILLER pic X(16)
                          value X'80818283840A171B88898A8B8C050607'.    032-047
           05  FILLER pic X(16)
                          value X'909116939495960498999A9B14159E1A'.    048-063
           05  FILLER pic X(16)
                          value X'20A0E2E4E0E1E3E5E7F1A22E3C282B7C'.    064-079
           05  FILLER pic X(16)
                          value X'26E9EAEBE8EDEEEFECDF21242A293BAC'.    080=095
           05  FILLER pic X(16)
                          value X'2D2FC2C4C0C1C3C5C7D1A62C255F3E3F'.    096-111
           05  FILLER pic X(16)
                          value X'F8C9CACBC8CDCECFCC603A2340273D22'.    112-127
           05  FILLER pic X(16)
                          value X'D8616263646566676869ABBBF0FDFEB1'.    128-143
           05  FILLER pic X(16)
                          value X'B06A6B6C6D6E6F707172AABAE6B8C6A4'.    144-159
           05  FILLER pic X(16)
                          value X'B57E737475767778797AA1BFD0DDDEAE'.    160-175
           05  FILLER pic X(16)
                          value X'5EA3A5B7A9A7B6BCBDBE5B5DAFA8B4D7'.    176-191
           05  FILLER pic X(16)
                          value X'7B414243444546474849ADF4F6F2F3F5'.    192-207
           05  FILLER pic X(16)
                          value X'7D4A4B4C4D4E4F505152B9FBFCF9FAFF'.    208-223
           05  FILLER pic X(16)
                          value X'5CF7535455565758595AB2D4D6D2D3D5'.    224-239
           05  FILLER pic X(16)
                          value X'30313233343536373839B3DBDCD9DAFF'.    240-255
       01  A-INFO           redefines ASCII-DATA pic X(256).
       01  ASCII-TABLE      redefines ASCII-DATA.
           05  ASCII-BYTE   pic X     occurs 256 times.
      *
      ***  AE0437B1 - End-of-Copy File - - - - - - - - - - - AE0437B1 *
      *****************************************************************
      *

Table of Contents Previous Section Next Section Model Source Code

The GENERATE Function includes two COBOL source code templates or masks. The first mask (SYSMASK1.TXT} provides the COBOL source code for sequential processing and should be used when the SYSCOBOL or output file is not an indexed file or when the output is an indexed file and the records are written sequentially by key.

The second mask file (SYSMASK2.TXT) should be used when the output file will be an indexed file and the records are written and the keys may not be in sequential order.

The format of the records in the mask file are as follows.

Columns Description
01-06 Should be spaces or a keyword
SPACES - copy the record
PROGID - the ampersand strings in columns 8-72 will be replaced with the program ID.
CNVRT - This record will be replaced with the BUILD-OUTPUT-RECORD logic.
OPEN2 - the ampersand string will be replaced with OUTPUT or I-O for open.
07-72 COBOL source code
73-80 ignored.
  The Format of the Records in the Mask (or Template) File

Columns 1-6 of each record within each of the records in the SYSMASK file should be spaces or a valid keyword. If Columns 1-6 contains a valid keyword then the statement is processed according to the keyword. Otherwise, the statement is simply copied from the SYSMASK file to the SYSCOBOL file.

Table of Contents Previous Section Next Section Model, Consecutive Access (Load/Extend)

The following (SYSMASK1.txt) is the source code for the mask that does sequential output.

      *****************************************************************
      * This program was created with the SYSMASK1.TXT file as input. *
      * The SYSMASK1 provides for the sequential reading of the input *
      * file and the sequential writing of the output file.           *
      *                                                               *
      * If the output file is indexed then the input file must be in  *
      * sequence by the field that will be used to provide the key    *
      * for the output file. This is a sequential load process.       *
      *                                                               *
      * If the key field is not in sequence then refer to SYSMASK2    *
      * to provide for a random add or update of the indexed file.    *
      *                                                               *
      * This program mask will have the ASCII/EBCDIC table inserted   *
      * for use by the /TRANSLATE function of SimoZAPS.               *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 16.01.01          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
PROGID     05  T1 pic X(11) value '* &&&&&&&& '.
HEAD34     05  T2 pic X(34) value '&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'.
           05  T3 pic X(10) value ' v16.01.01'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
PROGID     05  C1 pic X(11) value '* &&&&&&&& '.
           05  C2 pic X(32) value 'This Data File Convert Member wa'.
           05  C3 pic X(32) value 's generated by SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SYSUT1-STATUS.
           05  SYSUT1-STATUS-L     pic X.
           05  SYSUT1-STATUS-R     pic X.
       01  SYSUT1-EOF              pic X       value 'N'.
       01  SYSUT1-OPEN-FLAG        pic X       value 'C'.
RRDS01 01  SYSUT1-RELATIVE-KEY     pic 9(9)    value 0.

       01  SYSUT2-STATUS.
           05  SYSUT2-STATUS-L     pic X.
           05  SYSUT2-STATUS-R     pic X.
       01  SYSUT2-EOF              pic X       value 'N'.
       01  SYSUT2-OPEN-FLAG        pic X       value 'C'.
RRDS02 01  SYSUT2-RELATIVE-KEY     pic 9(9)    value 0.

RLEN1  01  SYSUT1-LRECL            pic 9(5)    value &&&&&.
RLEN2  01  SYSUT2-LRECL            pic 9(5)    value &&&&&.
RLEN1  01  SYSUT1-LRECL-MAX        pic 9(5)    value &&&&&.

      *****************************************************************
      * The following buffers are used to create a four-byte status   *
      * code that may be displayed.                                   *
      *****************************************************************
       01  IO-STATUS.
           05  IO-STAT1            pic X.
           05  IO-STAT2            pic X.
       01  IO-STATUS-04.
           05  IO-STATUS-0401      pic 9     value 0.
           05  IO-STATUS-0403      pic 999   value 0.
       01  TWO-BYTES-BINARY        pic 9(4)  BINARY.
       01  TWO-BYTES-ALPHA         redefines TWO-BYTES-BINARY.
           05  TWO-BYTES-LEFT      pic X.
           05  TWO-BYTES-RIGHT     pic X.

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
PROGID     05  MESSAGE-HEADER      pic X(11)   value '* &&&&&&&& '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

      *****************************************************************
PROGID 01  PROGRAM-NAME            pic X(8)     value '&&&&&&&&'.

       01  INFO-STATEMENT.
           05  INFO-SHORT.
               10  INFO-ID pic X(8)    value 'Starting'.
               10  filler  pic X(2)    value ', '.
               10  filler  pic X(34)
HEAD34             value   '&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'.
           05  filler      pic X(24)
               value ' http://www.SimoTime.com'.

       01  APPL-RESULT             pic S9(9)    comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  WRITE-FLAG      pic X       value 'Y'.

       01  SYSUT1-TOTAL.
           05  SYSUT1-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
SYSUT1     05  filler      pic X(23)   value 'Line count for &&&&&&&&'.
       01  SYSUT2-TOTAL.
           05  SYSUT2-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
SYSUT2     05  filler      pic X(23)   value 'Line count for &&&&&&&&'.

TABAE *    This statement will be replaced by SimoZAPS.
USRDEF*    This statement will be replaced by User Definitions.
ZADDWS*    This statement will be replaced by User Definitions.
      *****************************************************************
       PROCEDURE DIVISION.
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           move INFO-STATEMENT to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           perform Z-POST-COPYRIGHT
           perform SYSUT1-OPEN
           perform SYSUT2-OPEN

           perform until SYSUT1-STATUS not = '00'
               perform SYSUT1-READ
               if  SYSUT1-STATUS = '00'
                   add 1 to SYSUT1-RDR
                   perform BUILD-OUTPUT-RECORD
                   if  WRITE-FLAG = 'Y'
                       perform SYSUT2-WRITE
                       if  SYSUT2-STATUS = '00'
                           add 1 to SYSUT2-ADD
                       end-if
                   end-if
               end-if
           end-perform

USREOJ*    This statement will be replaced by User Logic for EOJ

           move SYSUT1-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           move SYSUT2-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           if  APPL-EOF
               move 'Complete' to INFO-ID
           else
               move 'ABENDING' to INFO-ID
           end-if
           move INFO-STATEMENT to MESSAGE-TEXT(1:79)
           perform Z-DISPLAY-MESSAGE-TEXT

           perform SYSUT2-CLOSE
           perform SYSUT1-CLOSE
           GOBACK.

CNVRT *    This statement will be replaced by SimoZAPS.

      *****************************************************************
      * I/O Routines for the INPUT File...                            *
      *****************************************************************
       SYSUT1-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT1-FILE
           if  SYSUT1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
SYSUT1         move 'CLOSE Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT1-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT1-READ.
           read SYSUT1-FILE
           if  SYSUT1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT1-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if
           if  APPL-AOK
               CONTINUE
           else
               if  APPL-EOF
                   move 'Y' to SYSUT1-EOF
               else
SYSUT1             move 'READ Failure with &&&&&&&&' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move SYSUT1-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT1-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input SYSUT1-FILE
           if  SYSUT1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT1-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
SYSUT1         move 'OPEN Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT1-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       SYSUT2-WRITE.
           if  SYSUT2-OPEN-FLAG = 'C'
               perform SYSUT2-OPEN
           end-if
           write SYSUT2-REC
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT2-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if.
           if  APPL-AOK
               CONTINUE
           else
SYSUT2         move 'WRITE Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-OPEN.
           add 8 to ZERO giving APPL-RESULT.
OPEN2      open &&&&&& SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
SYSUT2         move 'OPEN Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SYSUT2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
SYSUT2         move 'CLOSE Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * The following Z-ROUTINES provide administrative functions     *
      * for this program.                                             *
      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79)
           else
               display MESSAGE-BUFFER
           end-if
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display the file status bytes. This routine will display as   *
      * four digits. If the full two byte file status is numeric it   *
      * will display as 00nn. If the 1st byte is a numeric nine (9)   *
      * the second byte will be treated as a binary number and will   *
      * display as 9nnn.                                              *
      *****************************************************************
       Z-DISPLAY-IO-STATUS.
           if  IO-STATUS not NUMERIC
           or  IO-STAT1 = '9'
               move IO-STAT1 to IO-STATUS-04(1:1)
               subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY
               move IO-STAT2 to TWO-BYTES-RIGHT
               add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-MESSAGE-TEXT
           else
               move '0000' to IO-STATUS-04
               move IO-STATUS to IO-STATUS-04(3:2)
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.

Table of Contents Previous Section Next Section Model, Random Access (Update/Add)

The following (SYSMASK2.txt) is the mask that does output to an indexed file when the keys are not in sequence. This code will do an add of new records and an update of existing records.

      *****************************************************************
      * This program was created with the SYSMASK2.TXT file as input. *
      *                                                               *
      * The SYSMASK2 provides for the sequential reading of the input *
      * file and the random writing of the output file.               *
      *                                                               *
      * If the output file is indexed then the input file does not    *
      * need to be in sequence by the field that will be used to      *
      * provide the key for the output file. This is a random add or  *
      * update process.                                               *
      *                                                               *
      * New records will be added and existing records will be        *
      * updated. If duplicate keys are provided from the input file   *
      * then only the information from the last duplicate key record  *
      * of the input file will be reflected in the output file.       *
      *                                                               *
      * This program mask will have the ASCII/EBCDIC table inserted   *
      * for use by the /TRANSLATE function of SimoZAPS.               *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 16.01.01          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
PROGID     05  T1 pic X(11) value '* &&&&&&&& '.
HEAD34     05  T2 pic X(34) value '&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'.
           05  T3 pic X(10) value ' v16.01.01'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
PROGID     05  C1 pic X(11) value '* &&&&&&&& '.
           05  C2 pic X(32) value 'This Data File Convert Member wa'.
           05  C3 pic X(32) value 's generated by SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SYSUT1-STATUS.
           05  SYSUT1-STATUS-L     pic X.
           05  SYSUT1-STATUS-R     pic X.
       01  SYSUT1-EOF              pic X       value 'N'.
       01  SYSUT1-OPEN-FLAG        pic X       value 'C'.
       01  SYSUT1-RECORD-FOUND     pic X       value 'N'.
RRDS01 01  SYSUT1-RELATIVE-KEY     pic 9(9)    value 0.

       01  SYSUT2-STATUS.
           05  SYSUT2-STATUS-L     pic X.
           05  SYSUT2-STATUS-R     pic X.
       01  SYSUT2-EOF              pic X       value 'N'.
       01  SYSUT2-OPEN-FLAG        pic X       value 'C'.
       01  SYSUT2-RECORD-FOUND     pic X       value 'N'.
RRDS02 01  SYSUT2-RELATIVE-KEY     pic 9(9)    value 0.

RLEN1  01  SYSUT1-LRECL            pic 9(5)    value &&&&&.
RLEN2  01  SYSUT2-LRECL            pic 9(5)    value &&&&&.

      *****************************************************************
      * The following buffers are used to create a four-byte status   *
      * code that may be displayed.                                   *
      *****************************************************************
       01  IO-STATUS.
           05  IO-STAT1            pic X.
           05  IO-STAT2            pic X.
       01  IO-STATUS-04.
           05  IO-STATUS-0401      pic 9     value 0.
           05  IO-STATUS-0403      pic 999   value 0.
       01  TWO-BYTES-BINARY        pic 9(4)  BINARY.
       01  TWO-BYTES-ALPHA         redefines TWO-BYTES-BINARY.
           05  TWO-BYTES-LEFT      pic X.
           05  TWO-BYTES-RIGHT     pic X.

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
PROGID     05  MESSAGE-HEADER      pic X(11)   value '* &&&&&&&& '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

      *****************************************************************
       01  INFO-STATEMENT.
           05  INFO-SHORT.
               10  INFO-ID pic X(8)    value 'Starting'.
               10  filler  pic X(2)    value ', '.
               10  filler  pic X(34)
HEAD34             value   '&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'.
           05  filler      pic X(24)
               value ' http://www.SimoTime.com'.

       01  APPL-RESULT             pic S9(9)   comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  SYSUT1-TOTAL.
           05  SYSUT1-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
SYSUT1     05  filler      pic X(23)   value 'Read count for &&&&&&&&'.

       01  SYSUT2-TOTAL-ADDS.
           05  SYSUT2-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
SYSUT2     05  filler      pic X(17)   value 'Adds for &&&&&&&&'.
       01  SYSUT2-TOTAL-UPDATES.
           05  SYSUT2-UPD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
SYSUT2     05  filler      pic X(20)   value 'Updates for &&&&&&&&'.

TABAE *    This statement will be replaced by SimoZAPS.

      *****************************************************************
       PROCEDURE DIVISION.
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           move INFO-STATEMENT to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           perform Z-POST-COPYRIGHT
           perform SYSUT1-OPEN
           perform SYSUT2-OPEN

           perform UNTIL SYSUT1-EOF = 'Y'
               if  SYSUT1-EOF = 'N'
                   perform SYSUT1-READ
                   if  SYSUT1-EOF = 'N'
                       add 1 to SYSUT1-RDR
                       perform BUILD-OUTPUT-RECORD
                       perform SYSUT2-READ
                       perform BUILD-OUTPUT-RECORD
                       if  SYSUT2-RECORD-FOUND = 'Y'
                           add 1 to SYSUT2-UPD
                           perform SYSUT2-REWRITE
                       else
                           add 1 to SYSUT2-ADD
                           perform SYSUT2-WRITE
                       end-if
                   end-if
               end-if
           end-perform.

           move SYSUT1-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           move SYSUT2-TOTAL-ADDS to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           move SYSUT2-TOTAL-UPDATES to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           if  APPL-EOF
               move 'is Complete...' to MESSAGE-TEXT
           else
               move 'is ABENDING...' to MESSAGE-TEXT
           end-if
           perform Z-DISPLAY-MESSAGE-TEXT

           perform SYSUT2-CLOSE
           perform SYSUT1-CLOSE
           GOBACK.

CNVRT *    This statement will be replaced by SimoZAPS...

      *****************************************************************
      * I/O Routines for the INPUT File...                            *
      *****************************************************************
       SYSUT1-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT1-FILE
           if  SYSUT1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
SYSUT1         move 'CLOSE Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT1-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT1-READ.
           read SYSUT1-FILE
           if  SYSUT1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT1-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if
           if  APPL-AOK
               CONTINUE
           else
               if  APPL-EOF
                   move 'Y' to SYSUT1-EOF
               else
SYSUT1             move 'READ Failure with &&&&&&&&' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move SYSUT1-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT1-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input SYSUT1-FILE
           if  SYSUT1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT1-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
SYSUT1         move 'OPEN Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT1-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       SYSUT2-WRITE.
           if  SYSUT2-OPEN-FLAG = 'C'
               perform SYSUT2-OPEN
           end-if
           write SYSUT2-REC
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT2-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if.
           if  APPL-AOK
               CONTINUE
           else
SYSUT2         move 'WRITE Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-REWRITE.
           if  SYSUT2-OPEN-FLAG = 'C'
               perform SYSUT2-OPEN
           end-if
           rewrite SYSUT2-REC
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT2-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if.
           if  APPL-AOK
               CONTINUE
           else
SYSUT2         move 'REWRITE Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open I-O SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
SYSUT2         move 'OPEN Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-READ.
           move 'N' to SYSUT2-RECORD-FOUND
           move 'N' to SYSUT2-EOF
           add  12  to ZERO giving APPL-RESULT
           read SYSUT2-FILE
           evaluate SYSUT2-STATUS
               when '00'   move 'Y' to SYSUT2-RECORD-FOUND
                           subtract APPL-RESULT from APPL-RESULT
               when '23'   move 'N' to SYSUT2-RECORD-FOUND
                           subtract APPL-RESULT from APPL-RESULT
               when '10'   move 'N' to SYSUT2-RECORD-FOUND
                           move 'Y' to SYSUT2-EOF
                           subtract APPL-RESULT from APPL-RESULT
           end-evaluate.
           if  APPL-AOK
               CONTINUE
           else
SYSUT2         move 'READ Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SYSUT2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
SYSUT2         move 'CLOSE Failure with &&&&&&&&' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * The following Z-ROUTINES provide administrative functions     *
      * for this program.                                             *
      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79)
           else
               display MESSAGE-BUFFER
           end-if
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display the file status bytes. This routine will display as   *
      * four digits. If the full two byte file status is numeric it   *
      * will display as 00nn. If the 1st byte is a numeric nine (9)   *
      * the second byte will be treated as a binary number and will   *
      * display as 9nnn.                                              *
      *****************************************************************
       Z-DISPLAY-IO-STATUS.
           if  IO-STATUS not NUMERIC
           or  IO-STAT1 = '9'
               move IO-STAT1 to IO-STATUS-04(1:1)
               subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY
               move IO-STAT2 to TWO-BYTES-RIGHT
               add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-MESSAGE-TEXT
           else
               move '0000' to IO-STATUS-04
               move IO-STATUS to IO-STATUS-04(3:2)
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.

Table of Contents Previous Section Next Section Convert, Consecutive Access (Load/Extend)

Consecutive access of a file will maintain the sequence of the physical records in a file. The file access (reads and writes) can be buffered or cached for faster processing. This is the preferred method of processing if the logical sequence of the output file is not dependent on a key field with an alpha-numeric format that is being converted between ASCII and EBCDIC encoding.

Table of Contents Previous Section Next Section EBCDIC Sequential to ASCII Text

The following (IVP4GFC1.cmd) is the Windows Command file that is used to generate a program that read an EBCDIC Sequential file and creates an ASCII Text file.

@echo OFF
     set UtlName=IVP4GFC1
rem  * *******************************************************************
rem  *               IVP4GFC1.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 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 SYSOUT=SYSOUT_%UtlName%.txt
     set JobStatus=0000
     set SimoNote=c:\SimoLIBR\LOGS\SimoTIME.LOG
     call :PostNote "************************************************************%UtlName%"
     call :PostNote "Starting JobName %UtlName%, User is %USERNAME%"
     set SYSCNTL=SYSCNTL1.pcf
     set SYSMODEL=SYSMASK1.txt
     set SYSCOBOL=DATAWRK1\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 Technologies
     if "%1" == "NOSHOW" goto :End
     start notepad %syscobol%
     goto :End
:End
     pause

This example uses the following process control file (SYSCNTL1.pcf) to generate the COBOL source code that does the data file conversion.

***********************************************************************
*      SYSCNTL1.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 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

You may view the COBOL source code that is generated from the information in the control file (SYSCNTL1.pcf) and the mask file (SYSMASK1.TXT).

Table of Contents Previous Section Next Section EBCDIC Sequential to ASCII Indexed

The following (IVP4GFC2.cmd) is the Windows Command file that is used to generate a program that reads an EBCDIC Sequential file and creates an ASCII Indexed file.

@echo OFF
     set UtlName=IVP4GFC2
rem  * *******************************************************************
rem  *               IVP4GFC2.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 SYSCNTL2.TXT file and create the
rem  * ZAP001C1.CBL file using the SYSMASK1.TXT as a mask.
rem  * The SYSCNTL2.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.
rem  *
     echo * %UtlName% Starting the GENERATE function of SimoZAPS
     call EZMFPATH
     set SYSOUT=SYSOUT_%UtlName%.txt
     set SYSCNTL=SYSCNTL2.pcf
     set SYSMODEL=SYSMASK1.txt
     set SYSCOBOL=DATAWRK1\ZAP002C1.cbl
     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%
     goto :End
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 * %UtlName% %~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  ******************************************************************************
:End
     echo * %UtlName% Thank you for using the GENERATE function by SimoTime Technologies
     pause

This example uses the following control file (SYSCNTL2.pcf) to generate the COBOL source code that does the data file conversion.

***********************************************************************
*      SYSCNTL2.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 a sequential,  80-byte, fixed,    ebcdic file.     *
* SYSUT2 should be an INDEXED,   256-byte, variable, ascii file       *
*        with key position at 1 for a key length of 6.                *
*                                                                     *
* The DIALECT statement specifies the use of COBOL/2 compliant code   *
* for the generated conversion program.                               *
*                                                                     *
* The TransINIT statement will initialize the SYSUT2 record to X'20'  *
* or an ASCII SPACE character. This is especially useful when the     *
* output record length for SYSUT2 is greater than the input record    *
* length of SYSUT1. The hex value is used since the generated program *
* could run on the PC or the mainframe.                               *
*                                                                     *
* The VSAMLOAD statement specifies a sequential load or add of        *
* records to the indexed (i.e VSAM KSDS) file. If the input records   *
* (from SYSUT1) do not provide records in sequence by the key then a  *
* write error will occur when an attempt is made to write the record  *
* to SYSUT2. The IVP4GFC5.BAT provides an example of an unordered or  *
* random load or update of a VSAM Keyed Sequential Data Set.          *
***********************************************************************
/Dialect   C2
/VSAMload  Sequential
/progid    ZAP002C1
/sysut1    name=ZAP002D1 org=sequential recfm=fixed    rlen=80
/sysut2    name=ZAP002D2 org=indexed    recfm=variable rlen=256 klen=6 kpos=1
*
/transmode E2A
/transinit X'20'
/translate From pos 1 len 80 To pos 1 len 80
*
/END

You may view the COBOL source code that is generated from the information in the control file (SYSCNTL2.pcf) and the mask file (SYSMASK1.TXT).

Table of Contents Previous Section Next Section EBCDIC Sequential to ASCII Sequential

The following (IVP4GFC3.cmd) is the Windows Command file that is used to generate a program to read an EBCDIC Sequential file and create an ASCII Record Sequential file.

@echo OFF
     set UtlName=IVP4GFC3
rem  * *******************************************************************
rem  *               IVP4GFC3.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 SYSCNTL3.TXT file and create the
rem  * ZAP003C1.CBL file using the SYSMASK1.TXT as a mask.
rem  * The SYSCNTL3.TXT file is expected to contains the specifications
rem  * for reading a sequential, 80-byte, fixed, EBCDIC file and creating
rem  * a sequential, 80-byte, fixed, ascii file.
rem  * This example does a simple copy of an EBCDIC sequential file to an
rem  * ASCII sequential file of the same record length.
rem  *
     echo * %UtlName% Starting the GENERATE function of SimoZAPS
     call EZMFPATH
     set SYSOUT=SYSOUT_%UtlName%.txt
     set SYSCNTL=SYSCNTL3.pcf
     set SYSMODEL=SYSMASK1.txt
     set SYSCOBOL=DATAWRK1\ZAP003C1.cbl
     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

This example uses the following control file (SYSCNTL3.pcf) to generate the COBOL source code that does the data file conversion.

***********************************************************************
*      SYSCNTL3.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 a sequential, 80-byte, fixed, ebcdic file.         *
* SYSUT2 should be a sequential, 80-byte, fixed, ascii file.          *
* This example does a simple copy of an EBCDIC sequential file to     *
* an ASCII sequential file of the same record length.                 *
***********************************************************************
/DIALECT   C2
/PROGID    ZAP003C1
/SYSUT1    name=ZAP003D1 org=SEQUENTIAL recfm=FIXED    rlen=80  block=800
/SYSUT2    name=ZAP003D2 org=SEQUENTIAL recfm=FIXED    rlen=80  block=800
*
/TRANSMODE E2A
/TRANSINIT X'20'
/TRANSLATE FROM pos 1 len 80 TO pos 1 len 80
*
/END

You may view the COBOL source code that is generated from the information in the control file (SYSCNTL3.pcf) and the mask file (SYSMASK1.TXT).

Table of Contents Previous Section Next Section ASCII Text to EBCDIC Indexed

The following (IVP4GFC4.cmd) is the Windows Command file that is used to generate a program to read an ASCII/Text file and create an ASCII Indexed file or Key-Sequenced-Data-Set (KSDS).

@echo OFF
     set UtlName=IVP4GFC4
rem  * *******************************************************************
rem  *               IVP4GFC4.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  * SYSUT1 should be a ASCII/CRLF, 80-byte, variable, ascii file.
rem  * SYSUT2 should be a indexed,    80-byte, variable, ebcdic file.
rem  * This example does a copy of an ASCII text file with carriage return
rem  * and line feed characters used as record separators to an indexed
rem  * file of EBCDIC records. The maximum record length is 80 and the key
rem  * position is one with a key length of 6.
rem  *
     echo * %UtlName% Starting the GENERATE function of SimoZAPS
     call EZMFPATH
     set SYSOUT=SYSOUT_%UtlName%.txt
     set SYSCNTL=SYSCNTL4.pcf
     set SYSMODEL=SYSMASK1.txt
     set SYSCOBOL=DATAWRK1\ZAP004C1.cbl
     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

This example uses the following control file (SYSCNTL4.pcf) to generate the COBOL source code that does the data file conversion.

***********************************************************************
*      SYSCNTL4.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 a ASCII/CRLF, 80-byte, variable, ascii file.       *
* SYSUT2 should be a indexed,    80-byte, variable, ebcdic file.      *
* This example does a copy of an ASCII text file with carriage return *
* and line feed characters used as record separators to an indexed    *
* file of EBCDIC records. The maximum record length is 80 and the key *
* position is one with a key length of 6.                             *
***********************************************************************
/DIALECT   C2
/PROGID    ZAP004C1
/SYSUT1    name=ZAP004D1 ORG=ASCII/CRLF RECFM=VARIABLE RLEN=80
/SYSUT2    name=ZAP004D2 ORG=INDEXED    RECFM=VARIABLE RLEN=80 KPOS=1 KLEN=6
*
/TRANSMODE A2E
/TRANSINIT X'40'
/TRANSLATE FROM POS 1 LEN 80 to POS 1 LEN 80
*
/END

You may view the COBOL source code that is generated from the information in the control file (SYSCNTL4.pcf) and the mask file (SYSMASK1.TXT).

Table of Contents Previous Section Next Section Convert, Random Access (Update/Add)

WIP

Table of Contents Previous Section Next Section ASCII Text to EBCDIC Indexed

The following (IVP4GFC5.cmd) is the Windows Command file that is used to generate a program that will read an ASCII/Text file and access an existing ASCII Indexed file or Key-Sequenced-Data-Set (KSDS) to randomly add new records or update existing records.

@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

This example uses the following control file (SYSCNTL5.pcf) to generate the COBOL source code that does the data file conversion.

***********************************************************************
*      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

You may view the COBOL source code that is generated from the information in the control file (SYSCNTL5.pcf) and the mask file (SYSMASK2.TXT).

Table of Contents Previous Section Next Section Generate a File Compare Program

This function will generate the COBOL source code for a file comparison program. This generated file comparison program (SYSCOBOL) will read two files (SYSUT1) and (SYSUT2). The format of the two input files (SYSUT1 and SYSUT2) is specified by records contained in a control or specifications file (SYSCNTL).

             
IVPZFCG1
cmd
Start the processing to generate Compare Program
   
SIMOZAPS
utility
Determine if a COMPARE request and call SimoCNVT.
   
SYSCNTL
lseq
   
   
SIMOCNVT
compare
 
 
SYSCOBOL
cbl
Read the specifications from SYSCNTL and use SYSMODEL as a template to create SYSCOBOL.CBL.
   
   
SYSMODEL
lseq
   
   
   
   
EOJ
End-Of-Job
 
Generate a Data File Comparison Program

A Window's Command (.CMD) file is provided for easy execution of SimoZAPS and the "Generate a Comparison Program" function.

C:\SIMOLIBR> ZAPSCOMP name-of-control-file.txt name-of-generated-cobol.cbl SYSUT3

The preceding statement will run SimoZAPS and create a COBOL source member that will do a file comparison. The first parameter is the fully-qualified file name for the control file. The second parameter is the name of the COBOL program to be generated. The third parameter is optional and SYSUT3 will cause a COBOL program to be generated that will read a control file (containing /COMPARE statements) at execution time.

SimoZAPS has the ability to generate two types of compare programs. One type determines the positions to be compared at compiled time and the other determines the positions to be compared at execution time. This is covered in more detail in the following sections.

The reading and comparing of the two files are the easy parts. What to compare in each record is determined by the use of a /COMPARE statement in the control file (SYSCNTL for compile time or SYSUT3 for execution time). Multiple /COMPARE statements may be specified in the control files. The following is an example of a /COMPARE statement.

/COMPARE SYSUT1  POS  nnnnn  LEN  nnnn  SYSUT2  POS  nnnnn  LEN  nnnn

The maximum length of a text string that may be compared is 1,024 bytes. If a record exceeds this length then multiple /COMPARE statements will be required. If more than 1.024 bytes needs to be compared then multiple "/COMPARE" statements will be required.

Table of Contents Previous Section Next Section Compare Positions Defined at Compile Time

The first type of program will simple read two files and do the comparison of positions within the records base on hard-coded values in the generated program. This type of program has the /COMPARE statements in the same control file (SYSCNTL) that is used to generate the COBOL source code. The positions to be compared will be determined at compile time and become part of the generated source code. The advantage of using this approach is that fewer parameters are required at execution time. The disadvantage of using this approach is that it requires the program to be regenerated and compiled if a user wants to change the positions within the records to be compared.

Table of Contents Previous Section Next Section Prepare a Control File & Generate Program

The following is an example of a control file that will generate the COBOL source code that will compare the contents of two files based on the /COMPARE statements in a control file (SYSCNTL) used at compile time. The compare positions will be included in the generated COBOL source code.

***********************************************************************
*              IVPZCPT1spec.CTL - Input Specifications                *
*    This is an example of the compare specifications to generate a   *
*        Data File Comparison 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                  *
***********************************************************************
* Accepted - Specification File is IVPZCPT1spec.CTL
* Accepted - Generation Date: 2012/04/10  Time: 22:06:42:86
* Accepted - HTML documentation will be created
* Accepted - A Data File Compare Program will be created
* Accepted - Compare positions defined at compile time
*
/SYSLOG    ENABLE
*HEAD34    ....:....1....:....2....:....3....
/HEAD34    Compare, ASCII/Text, 80 Bytes
/PROGID    CPLS80C1
/SYSUT1    name=LS0080D1 org=ASCII/Text recfm=FIXED rlen=80
/SYSUT2    name=LS0080D2 org=ASCII/Text recfm=FIXED rlen=80
/DELTAMAX  5 EOF
/COMPARE   PHYSICAL SYSUT1 pos  1 len 80 SYSUT2 pos  1 len 80
/DFORMAT   ASC HEX EBC
/DISPLAY   SYSOUT
/END

The following is the command to generate a compare program using the preceding control file.

C:\SIMOLIBR> ZAPSCOMP IVPZCPT1spec.CTL CPLS80C1.CBL

Table of Contents Previous Section Next Section Compile the Program

Once the COBOL source code has been generated it needs to be compiled. Since this example uses an ASCII/Text file for input (on the mainframe this would need to be a sequential file) we will use Micro Focus COBOL on a Windows platform to compile the program. We will compile to a .GNT for improved performance over .INT and use the ASSIGN(EXTERNAL) directive for mapping file names when we execute the program.

Table of Contents Previous Section Next Section Execute the Program

The following (CPLS80W1.cmd) is an example of a Windows command file (or batch file) that will set the environment and execute (or run) the program.

@echo OFF
     set CmdName=CPLS80W1
rem  * *******************************************************************
rem  *               CPLS80W1.CMD - a Windows Command File               *
rem  *       This Job Script 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  *
rem  * Text   - Compare two line sequential files
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This set of programs will run on a mainframe under MVS or on a
rem  * Personal Computer with Windows and Micro Focus Net Express.
rem  *
rem  *                     ************
rem  *                     * CPLS80W1 *
rem  *                     ********cmd*
rem  *                          *
rem  *                          *
rem  *    ************     ************     ************
rem  *    *  SYSUT1  *-----* CPLS80C1 *-----* SYSLUSER *
rem  *    *******lseq*  *  ********cbl*     *******lseq*
rem  *                  *       *
rem  *    ************  *       *
rem  *    *  SYSUT2  *--*       *
rem  *    *******lseq*          *
rem  *                          *
rem  *                     ************
rem  *                     *   EOJ    *
rem  *                     ************
rem  *
rem  * *******************************************************************
rem  * Step 1 of 2, Prepare the environment...
rem  *
     call ..\ENV1BASE %CmdName%
     set JobStatus=0000
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
:PrepareQSAM
     call SimoNOTE "StepInfo Prepare the File Name Mapping"
     set SYSUT1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D1.TXT
     set SYSUT2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D2.TXT
     set SYSLUSER=%BaseLib1%\LOGS\SIMOTIME.SYSLUSER.CPLS80W1.txt
rem  *
rem  * *******************************************************************
rem  * Step 2 of 2, Compare the two files...
rem  *
:ExecuteCompareRoutine
     call SimoNOTE "StepInfo Execute the Compare Program"
     run CPLS80C1
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "Compare-One is %SYSUT1%"
     call SimoNOTE "Compare-Two is %SYSUT2%"
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
     if not "%JobStatus%" == "0" start NotePad %SYSLUSER%
:End
     if not "%SIMOGENS%" == "BATCH" pause
     exit /b

Table of Contents Previous Section Next Section Compare Positions Defined at Execute Time

The second type file comparison program will read a control file (SYSUT3) containing /COMPARE statements at execution time and do positional comparisons within the records based on the /COMPARE statements submitted at execution time. The advantage of this approach is the compare positions are defined when the generated COBOL program is executed. The user may change the positions within the record to be compared without having to re-generate and compile the program. The disadvantage is that it is necessary to have a control file with compare statements at execution time.

Table of Contents Previous Section Next Section Prepare a Control File & Generate Program

The following is an example of a control file that will generate the COBOL source code that will compare the contents of two files based on the /COMPARE statements in a control file (SYSUT3) that will be processed when the generated program is executed.

***********************************************************************
*              IVPZCPT2spec.CTL - Input Specifications                *
*    This is an example of the compare specifications to generate a   *
*        Data File Comparison 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                  *
***********************************************************************
* Accepted - Specification File is IVPZCPT2spec.CTL
* Accepted - Generation Date: 2012/04/10  Time: 22:06:42:86
* Accepted - HTML documentation will be created
* Accepted - A Data File Compare Program will be created
* Accepted - Compare positions defined at execution time
*
/SYSLOG    ENABLE
*HEAD34    ....:....1....:....2....:....3....
/HEAD34    Compare, ASCII/Text, 80 Bytes
/PROGID    CPLS80C2
/SYSUT1    name=LS0080D1 org=ASCII/Text recfm=FIXED rlen=80
/SYSUT2    name=LS0080D2 org=ASCII/Text recfm=FIXED rlen=80
/SYSUT3    name=LS0080D3 org=ASCII/Text recfm=FIXED rlen=80
/DELTAMAX  5 EOF
/DFORMAT   ASC HEX EBC
/DISPLAY   SYSOUT
/END

The following is the command to generate a compare program using the preceding control file.

C:\SIMOLIBR> ZAPSCOMP IVPZCPT2spec.CTL CPLS80C2.CBL

Table of Contents Previous Section Next Section Compile the Program

Once the COBOL source code has been generated it needs to be compiled. Since this example uses an ASCII/Text file for input (on the mainframe this would need to be a sequential file) we will use Micro Focus COBOL on a Windows platform to compile the program. We will compile to a .GNT for improved performance over .INT and use the ASSIGN(EXTERNAL) directive for mapping file names when we execute the program.

Table of Contents Previous Section Next Section Execute the Program

The following (CPLS80W3.cmd) is an example of a Windows command file (or batch file) that will set the environment and execute (or run) the program.

@echo OFF
rem  * *******************************************************************
rem  *               CPLS80W3.CMD - a Windows Command File               *
rem  *       This Job Script 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  *
rem  * Text   - Compare two line sequential files
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This set of programs will run on a on a Linux, UNIX or Windows
rem  * System using Micro Focus COBOL or GnuCOBOL.
rem  *
rem  *                     ************
rem  *                     * CPLS80W3 *
rem  *                     ********cmd*
rem  *                          *
rem  *                          *
rem  *    ************     ************     ************
rem  *    *  SYSUT1  *-----* CPLS80C3 *-----* SYSLUSER *
rem  *    *******lseq*  *  ********cbl*     *******lseq*
rem  *                  *       *
rem  *    ************  *       *
rem  *    *  SYSUT2  *--*       *
rem  *    *******lseq*          *
rem  *                  *       *
rem  *    ************  *       *
rem  *    *  SYSUT3  *--*       *
rem  *    *******lseq*          *
rem  *                          *
rem  *                     ************
rem  *                     *   EOJ    *
rem  *                     ************
rem  *
rem  * *******************************************************************
rem  * Step 1 of 2, Prepare the environment...
rem  *
     set CmdName=CPLS80W3
     call ..\Env1BASE %CmdName%
     set JobStatus=00
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
:PrepareQSAM
     call SimoNOTE "StepInfo Prepare the File Name Mapping"
     set SYSUT1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D1.TXT
     set SYSUT2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D2.TXT
     set SYSUT3=%BaseLib1%\PARMLIB\LSSYSUT3.ctl
     set SYSLUSER=%BaseLib1%\LOGS\SIMOTIME.SYSLUSER.CPLS80W3.txt
rem  *
rem  * *******************************************************************
rem  * Step 2 of 2, Compare the two files...
rem  *
:ExecuteCompareRoutine
     call SimoNOTE "StepInfo Execute the Compare Program"
     run CPLS80C3
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "Compare-One is %SYSUT1%"
     call SimoNOTE "Compare-Two is %SYSUT2%"
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
     if not "%JobStatus%" == "0" start NotePad %SYSLUSER%
:End
     if not "%SIMOGENS%" == "BATCH" pause
     exit /b

For this example the control file (SYSUT3) contains the following compare statement. Since the maximum record size for the file is 80 bytes this will compare the entire record content.

/COMPARE SYSUT1 pos 1 len 80 SYSUT2 pos 1 len 80

Table of Contents Previous Section Next Section Compare, Advanced Functions

The following is an example of a control file that uses some of the advanced functions of the SIMOZAPS Compare capabilities.

***********************************************************************
*              IVPZCPT3spec.CTL - Input Specifications                *
*    This is an example of the compare specifications to generate a   *
*        Data File Comparison 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                  *
***********************************************************************
* Accepted - Specification File is ITP09401spec.TXT
* Accepted - Generation Date: 2012/04/16  Time: 14:42:50:93
* Accepted - HTML documentation will be created
* Accepted - A Data File Compare Program will be created
* Accepted - Compare positions defined at compile time
*
/HEAD34    Compare, Indexed, Key & Positions
/progid    ITP094C1
/sysut1    name=ITCOMPD1 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
/sysut2    name=ITCOMPD2 org=Indexed recfm=variable rlen=512 klen=12 kpos=1
/DELTAMAX  250 EOF
/KEYFIELD  SYSUT1 pos  1 len 12 SYSUT2 pos  1 len 12
/COMPARE   SYSUT1 pos  1 len 94 SYSUT2 pos  1 len 94
/DELTAMAX  5 EOF
/DFORMAT   ASC HEX EBC
/DISPLAY   SYSOUT
/SYSLOG    DISABLE
/END

The preceding example will generate a Compare Program that will compare the contents of two indexed files or VSAM, Key-Sequenced-Data-Sets (KSDS).

The use of the /KEYFIELD statement will generate program logic to test for missing records. Since this is an indexed file (VSAM, KSDS) and the records are processed sequentially by key then it is possible to check for inserted or deleted records when the compare program is executed.

Table of Contents Previous Section Next Section Compare, Sample Output for Not Equal

What to do when a not equal condition occurs can be challenging on a single platform but in today's environment with multiple platforms and a mix of encoding schemes (such as EBCDIC and ASCII) and numeric formats (such as PACKED and BINARY) the task can become time consuming and difficult.

When a difference is found the type of display or logging information is defined by the use of a /DFORMAT statement in the control file. The following shows the format of the /DFORMAT statement.

/DFORMAT     ASC   HEX   EBC
NOASC NOHEX NOEBC

SimoZAPS does not actually do the data file comparison but generates a COBOL program to do the comparison. This technique provides greater flexibility since the COBOL program may be compiled on an IBM mainframe (z/OS or VSE) and Windows or UNIX using Micro Focus. Also, unique comparison requirements may be addressed by simply modifying the generated COBOL program.

The generated comparison program provides support for Keyed data sets and Sequential files. For Keyed data sets support is included for inserted, added or deleted records. If Sequential files are in sequence by a certain field then support for inserted, added or deleted records is provided. For files not in sequence a record by record comparison is performed.

It is possible to compare parts or segments of a record.

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 GREEN 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 MAROON row shows the positions that are equal (=) or not equal (#).

*** 2005/04/01 08:57:37:40 Starting  - Data File Content Comparison by SimoTime Enterprises, LLC
*** 2005/04/01 08:57:37:41 SYSUT1.....Record Number(position:length) 000000001(00001:00094)
*** 2005/04/01 08:57:37:41 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....
*** 2005/04/01 08:57:37:42 000000000001Distributor Cap                                 ........Each            ...2....i.
*** 2005/04/01 08:57:37:42 3333333333334677766776724672222222222222222222222222222222220000000046662222222222220003900068
*** 2005/04/01 08:57:37:42 000000000001493429254F203100000000000000000000000000000000000000000051380000000000000002C0009C
*** 2005/04/01 08:57:37:42 .....................?.../.........................................../........................
*** 2005/04/01 08:57:37:43 SYSUT2.....Record Number(position:length) 000000001(00001:00094)
*** 2005/04/01 08:57:37:43 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....
*** 2005/04/01 08:57:37:43 000000000001Distributor Cap                                 ...$....Each            ...2....i.
*** 2005/04/01 08:57:37:43 3333333333334677766776724672222222222222222222222222222222220002000046662222222222220003900068
*** 2005/04/01 08:57:37:44 000000000001493429254F203100000000000000000000000000000000000004000C51380000000000000002C0009C
*** 2005/04/01 08:57:37:44 .....................?.../.........................................../........................
*** 2005/04/01 08:57:37:44 ===============================================================#===#==========================
*** 2005/04/01 08:57:37:45 *
*** 2005/04/01 08:57:37:45 SYSUT1.....Record Number(position:length) 000000002(00001:00094)
*** 2005/04/01 08:57:37:45 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....
*** 2005/04/01 08:57:37:45 000000000002Rotor                                           ........Each            ........)\
*** 2005/04/01 08:57:37:46 3333333333335676722222222222222222222222222222222222222222220000000046662222222222220000800025
*** 2005/04/01 08:57:37:47 0000000000022F4F200000000000000000000000000000000000000000000000000051380000000000000009C0009C
*** 2005/04/01 08:57:37:47 .............?.?...................................................../.......................*
*** 2005/04/01 08:57:37:48 SYSUT2.....Record Number(position:length) 000000002(00001:00094)
*** 2005/04/01 08:57:37:48 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....
*** 2005/04/01 08:57:37:49 000000000002Rotor                                           ...$....Each            ........)\
*** 2005/04/01 08:57:37:49 3333333333335676722222222222222222222222222222222222222222220002000046662222222222220000800025
*** 2005/04/01 08:57:37:49 0000000000022F4F200000000000000000000000000000000000000000000004000C51380000000000000009C0009C
*** 2005/04/01 08:57:37:50 .............?.?...................................................../.......................*
*** 2005/04/01 08:57:37:51 ===============================================================#===#==========================
*** 2005/04/01 08:57:37:52 *
*** 2005/04/01 08:57:37:53 Summary   - Data File Content Comparison
*** 2005/04/01 08:57:37:53 000000005 - Record count for ITCOMPD1
*** 2005/04/01 08:57:37:54 000000005 - Record count for ITCOMPD2
*** 2005/04/01 08:57:37:55 000000002 - Unequal count
*** 2005/04/01 08:57:37:55 Finished  - Data File Content Comparison by SimoTime Enterprises, LLC

The summary information shows the record counts and the number of unequal compares by record count.

 

Table of Contents Previous Section Next Section Compare, Process Control File

The following is a description of the statements (or record types) contained in the control file (SYSCNTL) that is used to generate a Data File Compare Program.

Keyword  Parameters
/DIALECT
xx   where XX is one of the following
C2   COBOL/2 compliant
MF   Micro Focus COBOL compliant
/PROGID
xxxxxxxx   where XXXXXXXX is an eight character program name
/SYSUT1  NAME=xxxxxxxx ORG=xxxxxxxxxx RECFM=xxxxxxxx rlen=nnnnn KLEN=nnnn KPOS=nnnn
name   This keyword=parameter defines the 8-character (or less) DD name for SYSUT1. The default value is SYSUT1..
name=SEQINPUT defines the DDNAME for SYSUT1
org   This keyword=parameter defines the file organization.
org=SEQUENTIAL defines a sequential file.
org=INDEXED defines a a keyed-index file or VSAM Data Set (KSDS).
org=ASCII/CRLF defines an ASCII/Text file with Carriage Return and Line Feed used as record separators.
org=ASCII/TEXT is the same as ASCII/CRLF.
recfm   This keyword=parameter defines the format of the records within the file.
recfm=FIXED defines the records as fixed length.
recfm=VARIABLE defines the records as variable length
rlen   This keyword=parameter defines the fixed record length of each record in the file.
rlen=nnnnn where nnnnn is the fixed record length. For variable length records refer to RMIN and RMAX.
rmin   This keyword=parameter defines the minimum record length of records in the file.
rmin=nnnnn where nnnnn is the minimum record length. For fixed record length files refer to RLEN.
rmax   This keyword=parameter defines the maximum record length of records in the file.
rmax=nnnnn where nnnnn is the maximum record length. For fixed record length files refer to RLEN.
block   This keyword=parameter defines the block length.
block=nnnnn where nnnnn is the block length
klen   This keyword=parameter defines the length of the key.
klen=nnnnn where nnnnn is the key length.
kpos   This keyword=parameter defines the starting postion of the key within the record.
kpos=nnnnn where nnnnn is the key starting position within a record.
recmode   This keyword will cause the RECORDING MODE to be added to the FD statement using the RECFM value.
recvary   This keyword will cause the RECORD VARYING to be added to the FD statement using the RMIN and RMAX values. This will add the DEPENDING ON to the FD statement using the eight-byte filename-LRECL field name.
/SYSUT2  NAME=xxxxxxxx ORG=xxxxxxxxxx RECFM=xxxxxxxx rlen=nnnnn KLEN=nnnn KPOS=nnnn
name   This keyword=parameter defines the 8-character (or less) DD name for SYSUT2. The default value is SYSUT2..
name=TEMPOUT defines the DDNAME for SYSUT2.
org   This keyword=parameter defines the file organization.
org=SEQUENTIAL defines a sequential file.
org=INDEXED defines a a keyed-index file or VSAM Data Set (KSDS).
org=ASCII/CRLF defines an ASCII/Text file with Carriage Return and Line Feed used as record separators.
org=ASCII/TEXT is the same as ASCII/CRLF.
recfm   This keyword=parameter defines the format of the records within the file.
recfm=FIXED defines the records as fixed length.
recfm=VARIABLE defines the records as variable length
rlen   This keyword=parameter defines the fixed record length of each record in the file.
rlen=nnnnn where nnnnn is the fixed record length. For variable length records refer to RMIN and RMAX.
rmin   This keyword=parameter defines the minimum record length of records in the file.
rmin=nnnnn where nnnnn is the minimum record length. For fixed record length files refer to RLEN.
rmax   This keyword=parameter defines the maximum record length of records in the file.
rmax=nnnnn where nnnnn is the maximum record length. For fixed record length files refer to RLEN.
block   This keyword=parameter defines the block length.
block=nnnnn where nnnnn is the block length
klen   This keyword=parameter defines the length of the key.
klen=nnnnn where nnnnn is the key length.
kpos   This keyword=parameter defines the starting postion of the key within the record.
kpos=nnnnn where nnnnn is the key starting position within a record.
recmode   This keyword will cause the RECORDING MODE to be added to the FD statement using the RECFM value.
recvary   This keyword will cause the RECORD VARYING to be added to the FD statement using the RMIN and RMAX values. This will add the DEPENDING ON to the FD statement using the eight-byte filename-LRECL field name.
/UT1OMIT IF POS nnnn LEN nnnn EQ xxxx BYPASS RECORD +nnn
IF   Conditional keyword
POS nnnn   Position within the record to start the compare (for SYSUT1)
LEN nnnn   Length of the text string to compare (for SYSUT1)
BYPASS   This is the action to be performed if the condition is true. BYPASS is the default.
RECORD   Identifies what is to be omitted, RECORD is the default.
+nnn   Specifies the number of additional records to omit or bypass.
/UT2OMIT IF POS nnnn LEN nnnn EQ xxxx BYPASS RECORD +nnn
IF   Conditional keyword
POS nnnn   Position within the record to start the compare (for SYSUT2)
LEN nnnn   Length of the text string to compare (for SYSUT2)
BYPASS   This is the action to be performed if the condition is true. BYPASS is the default.
RECORD   Identifies what is to be omitted, RECORD is the default.
+nnn   Specifies the number of additional records to omit or bypass.
/UT1CALL The name of a callable translation routine to be executed immediatley after a read of a SYSUT1 record.
/UT2CALL The name of a callable translation routine to be executed immediatley after a read of a SYSUT2 record.
/DELTAMAX 
Parm-1   The first parameter must be a numeric value, five (5) digits or less).
nnnnn   where nnnnn is the maximum number of differences before comparing will stop
Parm-2   The second parameter must be one of the following two values.
EOF   When DELTAMSX is reached or exceeded continue to read and count records until end-of-file.
QUIT   When DELTAMSX is reached or exceeded close files and quit.
/KEYFIELD  SYSUT1 POS nnnn LEN nnnn SYSUT2 POS nnnn LEN nnnn
SYSUT1   References the first file
POS nnnn   Position within the record to start the compare (for SYSUT1)
LEN nnnn   Length of the text string to compare (for SYSUT1)
SYSUT2   References the second file
POS nnnn   Position within the record to start the compare (for SYSUT2)
LEN nnnn   Length of the text string to compare (for SYSUT2)
/COMPARE compare_type SYSUT1 POS nnnn LEN nnnn SYSUT2 POS nnnn LEN nnnn
compare_type   PHYSICAL or LOGICAL keyword, if missing the default is PHYSICAL
PHYSICAL   A physical compare requires the bit-patterns of each byte to be the same in order to get an equal compare results.
LOGICAL   An equal compare can result if the bit-patterns of each byte are the same or if the logical charater of the encoding schemas (or character set) match.
SYSUT1   References the first file
POS nnnn   Position within the record to start the compare (for SYSUT1)
LEN nnnn   Length of the text string to compare (for SYSUT1)
SYSUT2   References the second file
POS nnnn   Position within the record to start the compare (for SYSUT2)
LEN nnnn   Length of the text string to compare (for SYSUT2)

Note: It is possible to have more than one compare statement. The maximum length for each compare string is 1,024 bytes. Therefore, if a record is longer that 1,024 bytes it will require multiple compare statements.
/DFORMAT ASC HEX EBC
ASC   Show the possible ASCII translation, NOASC will not show the possible ASCII translation.
HEX   Show the hexadecimal value of two lines, NOHEX will not show the hexidecimal value.
EBC   Show the possible EBCDIC translation, NOEBC will not show the possible EBCDIC translation.
/SYSLOG ENABLE, DISABLE or SYSPROBE
/DISPLAY NONE, SYSOUT or CONSOLE
/END End of control statements, this statement is optional.

 

Table of Contents Previous Section Next Section Compare, Create Test Data

The following (CPMK80W8.cmd) is an example of a Windows Command File that will create test data for the compare process of files with 80 byte records.

@echo OFF
rem  * *******************************************************************
rem  *               CPMK80W8.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  *
rem  * Text   - Create Sequential Data Sets on disk using IEBGENER.
rem  * Author - SimoTime Technologies
rem  * Date   = January 24, 1996
rem  *
rem  * The first job step (DeleteTEXT) will delete any previously created
rem  * files.
rem  * The second job step (CreateTEXT) will create a new ASCII/Text file.
rem  * The third step will convert the Line Sequential file to a Record
rem  * Sequential file.
rem  *
rem  * This set of programs will run on a Personal Computer with Windows
rem  * and Micro Focus Net Express.
rem  *
     set CmdName=CPMK80W8
     call ..\Env1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%, User is %USERNAME%"
     call SimoNOTE "StepInfo Delete previously created files"
     set CPLS80D1=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D1.TXT
     set CPLS80D2=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D2.TXT
     set CPLS80D3=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.CPLS80D3.TXT
rem  *
rem  * *******************************************************************
rem  * Step   1 of 6  Create and populate a new ASCII/TEXT file...
rem  * This step will create a sequential file with three records. The
rem  * length of the records is 80 bytes.
rem  *
     call SimoNOTE "StepInfo Create an ASCII/Text File"
     if exist %CPLS80D1% del %CPLS80D1%
rem  * ..1....:....2....:....3....:....4....:....5....:....6....:....7.
echo Record 001, Text String 001...>%CPLS80D1%
echo Record 002, Text String 002...>>%CPLS80D1%
echo Record 003, Text String 003...>>%CPLS80D1%
     if exist %CPLS80D1% call SimoNOTE "DataMake %CPLS80D1%"
     if not exist %CPLS80D1% set JobStatus=9001
     if not %JobStatus% == 0000 goto :EojNok
rem  *
rem  * *******************************************************************
rem  * Step   2 of 6  Create and populate a new ASCII/TEXT file...
rem  * This step will create a sequential file with three records. The
rem  * length of the records is 80 bytes.
rem  * This file contains the same records as the file created in the
rem  * preceding job step.
rem  *
     call SimoNOTE "StepInfo Create an ASCII/Text File"
     if exist %CPLS80D2% del %CPLS80D2%
rem  * ..1....:....2....:....3....:....4....:....5....:....6....:....7.
echo Record 001, Text String 001...>%CPLS80D2%
echo Record 002, Text String 002...>>%CPLS80D2%
echo Record 003, Text String 003...>>%CPLS80D2%
     if exist %CPLS80D2% call SimoNOTE "DataMake %CPLS80D2%"
     if not exist %CPLS80D2% set JobStatus=9001
     if not %JobStatus% == 0000 goto :EojNok
rem  *
rem  * *******************************************************************
rem  * Step   3 of 6  Create and populate a new ASCII/TEXT file...
rem  * This step will create a sequential file with three records. The
rem  * length of the records is 80 bytes.
rem  * This file contains similar records as the file created in the
rem  * preceding job step. However, the content of the second record
rem  * contains additional text.
rem  *
     call SimoNOTE "StepInfo Create an ASCII/Text File"
     if exist %CPLS80D3% del %CPLS80D3%
rem  * ..1....:....2....:....3....:....4....:....5....:....6....:....7.
echo Record 001, Text String 001...>%CPLS80D3%
echo Record 002, Text String 002... Catch me...>>%CPLS80D3%
echo Record 003, Text String 003...>>%CPLS80D3%
     if exist %CPLS80D3% call SimoNOTE "DataMake %CPLS80D3%"
     if not exist %CPLS80D3% set JobStatus=9001
     if not %JobStatus% == 0000 goto :EojNok
rem  *
rem  * *******************************************************************
rem  * Step   4 of 6  Convert ASCII/TEXT file to ASCII RSEQ File...
rem  *
     call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential"
     set GETLS080=%CPLS80D1%
     set PUTRS080=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT01.DAT
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALAR
     if not ERRORLEVEL = 0 set JobStatus=0030
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "DataTake %GETLS080%"
     call SimoNOTE "DataMake %PUTRS080%"
rem  *
rem  * *******************************************************************
rem  * Step   5 of 6  Convert ASCII/TEXT file to ASCII RSEQ File...
rem  *
     call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential"
     set GETLS080=%CPLS80D2%
     set PUTRS080=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT02.DAT
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALAR
     if not ERRORLEVEL = 0 set JobStatus=0030
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "DataTake %GETLS080%"
     call SimoNOTE "DataMake %PUTRS080%"
rem  *
rem  * *******************************************************************
rem  * Step   4 of 6  Convert ASCII/TEXT file to ASCII RSEQ File...
rem  *
     call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential"
     set GETLS080=%CPLS80D3%
     set PUTRS080=%BaseLib1%\DATA\APPL\SIMOTIME.TEST.RS80TT03.DAT
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALAR
     if not ERRORLEVEL = 0 set JobStatus=0030
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "DataTake %GETLS080%"
     call SimoNOTE "DataMake %PUTRS080%"
rem  *
:EojAok
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :End
:EojNok
     call SimoNOTE "NOTE ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
:End
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Translate Function, 80/80 Convert

This procedure will read an ASCII/Text file and create an EBCDIC, 80-byte, fixed-record-length file. The intent of this function is to convert the many "control card" files used in a mainframe job stream. It is an 80/80 copy with conversion between EBCDIC and ASCII.

SIMOZAPS TRANSLATE  sysin  sysout  ASCtoEBC NODISPLAY KEEPNULLS
EBCtoASC DISPLAY PADNULLS

The following is a summary of the parameters used by the Translate Function.

Parameter Description
sysin This is the name of the input file. Depending on the ASCtoEBC or EBCtoASC parameter this will be an ASCII/Text file or an 80-byte EBCDIC file.
sysout This is the name of the output file. Depending on the ASCtoEBC or EBCtoASC parameter this will be an 80-byte EBCDIC file or an ASCII/Text file.
ASCtoEBC
EBCtoASC
ASCtoA80
This keyword/parameter will explicitly define the format of the output file. The format of the input file is implicitly defined, it is the complement of the output file. If this keyword/parameter is missing then ASCtoEBC is the default value.
ASCtoEBC - copy from an ASCII/Text file to an 80-byte, fixed-length, EBCDIC file.
EBCtoASC - copy from an 80-byte, fixed-length, EBCDIC file to an ASCII/Text file to .
ASCtoA80 - copy from an ASCII/Text file to an 80-byte, fixed-length, ASCII file.
NODISPLAY
or
DISPLAY
This keyword/parameter provides the capability of displaying the records from the input file as they are being converted. If this keyword/parameter is missing then NODISPLAY is the default value.
KEEPNULLS
or
PADNULLS
This keyword/parameter provides the capability of leaving null values (low-values or hex'00') unchanged or converting null values to spaces. If the keyword/parameter is missing then KEEPNULLS is the default value.
  Parameters used by the Translate 80/80 Function

For additional file conversion capability refer to the Generate a Data File Conversion Program section of this document. This additional file convert function of SimoZAPS does not do the actual conversion of a file. It creates a COBOL source member that may be compiled and executed on a Mainframe System or a Windows, UNIX or Linux System with Micro Focus COBOL.

Table of Contents Previous Section Next Section Modify Function

The MODIFY function of SimoZAPS provides the capability of copying an ASCII/Text file with include, omit or modify capability. As the SYSIN file is being read a record may be selected (included or omitted) based on content for writing to the SYSOUT file. Prior to writing a record to the SYSOUT file the record may be changed using the keyword/parameter combinations described below.

The following is the command line format for the MODIFY function of SimoZAPS.

SIMOZAPS  MODIFY  sysin    sysout  COMMAND   keyword  parameters

or

SIMOZAPS  MODIFY  sysin    sysout  LISTFILE  filename.ext

Note:  the COMMAND keyword may be abbreviated as CMD and the LISTFILE keyword may be abbreviated as LIST or FILE.

The following keyword/parameters are used to include or omit records.

Keyword Parameters
INCLUDE  IF position EQ literal AND CASE [IGNORE /MATCH ]
OMIT IF position EQ literal AND CASE [IGNORE /MATCH ]
  Include and/or Omit Records based on a Positional Value

The following keyword/parameters are used to format each record.

Keyword Parameters
APPEND literal-1
COMPRESS FROM position-1 TO position-2
COPYNOW IF position EQ literal AND CASE [IGNORE /MATCH ]
FORCE literal-1 AT position-1
INSERT literal-1 AT position-1
REMOVE FROM position-1 TO position-2
REPEAT FROM position-1 TO position-2 AT position-3
REPLACE [FIRST /ALL /VARIABLE] value-1 WITH value-2
Note: For FIRST and ALL value-1 and value-2 must be the same length.
For VARIABLE the information after value-1 will be shifted if the values are different lengths. The following shows the two formats for the VARIABLE replacement function.
VARIABLE value-1 WITH value-2
VARIABLE value-1 DROP
If the DROP keyword is specified and value-2 is not specified the specified variable string will be dropped from the output.
SEQUENCE FROM position-1 TO position-2 by value-1
TOLOWER FROM position-1 TO position-2
TOUPPER FROM position-1 TO position-2
  Record Content Modification

Table of Contents Previous Section Next Section Capabilities, Possibilities & Limitations

This section will describe how and when to use the SimoZAPS utility program. Practical examples will be used.

When specifying literals with leading, embedded or trailing spaces it will be necessary to place the literal within a pair of double-quotes. Since double-quotes are used to define the beginning and end of a literal then a literal that contains double-quotes cannot be specified.

When specifying values with the percent sign (%) the results may not be as anticipated if using the COMMAND function.

Item Description
1 When using the COMMAND function the actual percent value will be substituted.
2 When using a LISTFILE the percent string literal will be substituted.
  Considerations when using the Modify Function

When multiple statements that use conditional arguments are specified then consideration should be given to the sequence of the statements with the longest search arguments being specified first if subsequent shorter search argument contain identical text strings. For example, changing the sequence of the following two statements would produce different results because in the first sequence the value "ABCDEF" would never to be found.

Keyword Description
INCLUDE  IF 1 EQ "ABC" AND CASE MATCH
OMIT IF 1 EQ "ABCDEF" AND CASE MATCH
  Considerations when using Multiple Condition Statements

Table of Contents Previous Section Next Section Change a Text String

This section will describe how to use the MODIFY function of SimoZAPS to make a global change to a text string in an ASCII/Text file.

             
IVP4ZAP1
cmd
Start the processing for Search/Replace
   
IVP4ZAP1
TXT
 
 
SIMOZAPS
cbl
 
 
IVP4ZAP1
NEW
Use the MODIFY function to create a new file replacing occurrences of " zap " with " SimoZAP1 "
   
EOJ
End-Of-Job
 
The Modify Function, Changing a Text String (Search, Replace, Insert and more)

The IVP4ZAP1.cmd will execute the SimoZAPS program with the MODIFY function. The CMD parameter indicates the additional parameters are included in the command line. In this example the text string " zap " will be replaced with " " SimoZAP1 " when the file is copied.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4ZAP1.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  * Read the TXT4ZAP1.TXT file and create the TXT4ZAP1.NEW file.
rem  * Replace the word " zap " with " SimoZAP1 "
rem  * Notice the use of the double quotes for embedded spaces.
rem  *
echo * IVP4ZAP1 is Starting...
run simozaps MODIFY txt4zap1.txt txt4zap1.new CMD REPLACE VARIABLE " zap " WITH " SimoZAP1 "
if   ERRORLEVEL = 1 GOTO :ABEND01
echo *
echo * IVP4ZAP1 TXT4ZAP1.TXT - original file is left unchanged...
echo *
type txt4zap1.txt
echo *
echo * IVP4ZAP1 TXT4ZAP1.NEW - the new file with modifications...
echo *
type txt4zap1.new
echo *
echo * IVP4ZAP1 End of Job...
goto :END
rem  *
:ABEND01
     echo * IVP4ZAP1 is ABENDING !!!
     goto :END
rem  *
:END

The following is the contents of the TXT4ZAP1.txt file.

The keyword is zap
Repeat keyword is zap
The keyword should be replaced with SimoZAP1.
If successful the new keyword should be SimoZAP1.

After running IVP4ZAP1.cmd the new file (TXT4ZAP1.new) should have the text string " zap " replaced with " SimoZAP1 ".

Table of Contents Previous Section Next Section Member Names in Lower Case

One of the problems we encountered when building our Web site was the naming of the members within a directory. Windows is not case sensitive to member names but UNIX systems are case sensitive to member names. We developed the Web site on a Windows platform and everything worked fine. After uploading the files to the UNIX server we encountered many missing links even though the members were copied to the UNIX server. The missing links were due to the case sensitivity for member names.

The following is an example of using the MODIFY function of SimoZAPS to create a batch file to ensure the member names within our Web directory are all lower case. There are other ways to do this but the purpose here is to illustrate the capabilities of the SimoZAPS utility.

CAUTION!!! A back-up copy of the target directory should be created prior to executing this type of process.

             
IVP4ZAP2
cmd
Start the processing to rename Member Names
   
DIR
cmd
 
 
SYSWORK2
lseq
Create a file with a list of member names
   
TXT4ZAP2
lseq
   
   
SIMOZAPS
cbl
 
 
DOITONCE
lseq
Read the list of member names and create a new executable CMD file
   
   
SYSWORK2
lseq
   
   
   
   
EOJ
End-Of-Job
 
Changing Member Names into Lower Case

The following is the IVP4ZAP2.cmd file referenced in the preceding figure.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4ZAP2.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  * Convert member names to lower case.
rem  *
echo * IVP4ZAP2 is Starting...
if exist SYSWORK2.TXT erase SYSWORK2.TXT
echo *
@echo ON
dir  *.*/on/b/a-d>syswork2.txt
@echo OFF
echo * The preceding DIR command will do the following.
echo * The /on organizes the list by name.
echo * The /b will cause the dir function to only list the file name.ext.
echo * The /a-d will not include directory names in the list.
echo * The piping will write the dir information to ivp4zap2.txt.
echo * This file will be used by the following command.
echo *
if exist DOITONCE.CMD erase DOITONCE.CMD
@echo ON
run simozaps MODIFY SYSWORK2.TXT doitonce.cmd FILE TXT4ZAP2.TXT
@echo OFF
if   ERRORLEVEL = 1 GOTO :ABEND01
echo *
echo * The DOITONCE.CMD file has been created from SYSWORK2.TXT.
echo * Please review the results and execute accordingly.
echo *
goto :END
rem  *
:ABEND01
     echo * IVP4ZAP2 is ABENDING !!!
     goto :END
rem  *
:END

The following is the contents of the TXT4ZAP2.txt file used by the MODIFY function of SimoZAPS.

*
* The following control statements will create a DOS
* Command to rename a member using lower case.
*
omit    if 1 eq *
repeat  from 1  to 12 at 14
toupper from 1  to 12
tolower from 14 to 25
*
* The following statement may need to be modified to point
* to the proper drive and directory.
*
insert "c:\simozaps\" at 1
*
* The following statement is required to do the renaming
* from mixed or upper case to all lower case.
*
insert "rename " at 1
*

In the preceding example the MODIFY function of SimoZAPS does not actually do the task of renaming the members in the directory to ensure a lower-case format. The MODIFY function of SimoZAPS is used to create the DOITONCE.CMD file that will do the actual task.

Table of Contents Previous Section Next Section Format COBOL Source Code

This program will read an ASCII/Text file of COBOL source code and format in UPPER/lower case. It will create a SYSOUT file in the new format, the original file is unchanged.

CAUTION!!! A back-up copy of the target directory should be created prior to executing this type of process.

SIMOZAPS FormatCOBOL sysin sysout Display   CobolLower NamesUpper

NoDisplay CobolUpper NamesLower
Parameter Expected Parameter Values
FormatCOBOL This is a keyword an must be "FormatCOBOL"
sysin The input file name
sysout The Output file name
display or NoDisplay, Display is the default value and as the sysin is read the records will be displayed to the screen. If NoDisplay is specified the records will not be displayed to the screen.
CobolLower or CobolUpper, CobolLower is the default value and the COBOL verbs will be changed to lower case. If CobolUpper is specified the COBOL verbs will be changed to upper case.
NameUpper or NamesLower, NamesUpper is the default value and the names will be changed to upper case. If NamesLower is specified the names will be changed to lower case.
  Command Line Format and Parameter Descriptions

Table of Contents Previous Section Next Section COBOL Code, Case Consistency

This section will describe how to use the FormatCOBOL function of SimoZAPS to read a COBOL source member and create a new file with case consistency. The following shows the contents of the IVP4ZAP3.cmd file.

@echo OFF
rem  * *******************************************************************
rem  *               IVP4ZAP3.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 program will read the HELLO.CBL COBOL source member that contains
rem  * an erratic use of upper and lower case.
rem  *
rem  * Create HELLO.NEW with a consistent use of upper and lower case.
rem  *
echo *
echo * IVP4ZAP3 - Installation Verification Program for the FormatCOBOL function.
run simozaps FormatCOBOL hello.cbl hello.new nodisplay
if   ERRORLEVEL = 1 GOTO :ABEND01
echo * IVP4ZAP3 - The FormatCOBOL function is complete,
echo * IVP4ZAP3 - Review the HELLO.CBL and HELLO.NEW files.
echo *
goto :END
rem  *
:ABEND01
     echo * IVP4ZAP1 is ABENDING !!!
     goto :END
rem  *
:END

In the preceding example the FormatCOBOL function will read the HELLO.CBL member and create a new HELLO.NEW file with case consistency. The "nodisplay" option suppresses the scrolling of source code on the screen.

In the new COBOL.NEW file the COBOL verbs will be lower case and the user defined fields will be upper case.

Table of Contents Previous Section Next Section Summary

The SIMOZAPS Utility Program is intended to assist programmers in performing a variety of utilitarian tasks when working with non-relational data structures. 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 Purchases, 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.

 

The SimoZAPS program, the documentation, the Installation Verification Procedures (IVP's) and examples are provided electronically or on a Compact Disk (CD) with a predefined SETUP procedure. Additional information about acquiring SimoZAPS may be obtained by contacting the helpdesk at SimoTime or refer to the Product Availability and Pricing document.

Link to Internet   Link to Server   Explore the Principles of Data File Conversion. This link includes guidelines for defining requirements and determining the scope of effort for a data conversion effort.

Link to Internet   Link to Server   Explore How to Generate a Data File Convert 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 the actual data file conversion. The User Guide contains a list of the PCF statements that are used for the data file convert process.

Link to Internet   Link to Server   Explore the Principles of Data File Validation. This link includes guidelines for defining requirements and determining the scope of effort for a data validation effort. This effort includes a data file compare process, a technique for accumulating summary totals with a record count and a technique for reading a VSAM, KSDS and producing a hex-dump output based on a list of user-defined keys.

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.

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

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
SimoZAPS - Data File Utility with Hex View, Convert between EBCDIC/ASCII or Compare Two Files
Copyright © 1987-2019
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com