File Convert, LRECL=80
Record & Line Sequential Files
  Table of Contents  v-24.01.01 - data8001.htm 
  Introduction
  Command Files for the Application
  Create the Sequential Test Files
  Delete the Sequential Test Files
  Command Files for Data Convert
  ASCII/Text to ASCII Sequential
  ASCII/Text to EBCDIC Sequential
  EBCDIC Sequential to ASCII/Text
  Batch Job to Convert a Single File
  Batch Job to Convert Multiple Files
  COBOL Convert Programs
  ASCII/Text to ASCII Sequential
  ASCII/Text to EBCDIC Sequential
  EBCDIC Sequential to ASCII/Text
  Common or Shared Functions
  Set the Environment
  Display and Log Messages
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This suite of sample programs will show an approach to the task of File format conversion between Line Sequential and Record Sequential files. Also, record content conversion between ASCII and EBCDIC will be discussed. This example uses sequential files with 80-byte records. The following terms and abbreviations will be used in this document.

Terms or Abbreviations Descriptions
File Format Conversion This term is used when the task involved requires a conversion of the physical file format. For example, a conversion between a Record Sequential file and a Line Sequential file or a conversion between a sequential file and a VSAM, KSDS.
Record Content Conversion This term is used when the task involved requires a conversion of the record content or format. For example, a conversion between EBCDIC-encoding and ASCII-encoding would be considered as record content conversion.
RSEQ This is an abbreviation for Record Sequential.
Record Sequential This type of file may contain any of the 256-byte character set and be referred to as a BINARY-encoded file. A programmer may limit the format of the data stored in the records within the file to EBCDIC-encoded or ASCII-encoded display characters. This type of file may contain fixed or variable length records. In the suite of sample programs fixed-length records of 80 bytes will be used. The records are concatenated one after the other without a record separator. Therefore, the total size of the file must be a multiple of the fixed-record length.
LSEQ This is an abbreviation for Line Sequential.
Line Sequential This is another term used for an ASCII/Text file.
ASCII/Text This type of file contains ASCII-encoded records. The length of the records within the file may vary in size. The records are separated by a record separator bytes. For Windows the record separator is two (2) bytes consisting of x'0D0A'. This string may be referred to as a Carriage-Return, Line-Feed (or CRLF). This type of file may be edited using Windows and the NotePAD text editor.
  Terms and Abbreviations used in this Document

Applications running on a mainframe system typically create, read and update record sequential files. These files are EBCDIC encoded and typically contain records of fixed length with fields of fixed length. When transferring or sharing data between a Mainframe System and a Windows System running a Micro Focus sub-system it usually requires a file format and/or a file content conversion.

This link provides additional detail for  Micro Focus Files and various Numeric Formats  being used in a multi-system complex consisting of Mainframe (z/OS), Linux, UNIX or Windows environments.

This suite of sample programs will describe possible approaches for the data file conversion process. However, in order to convert a file we need to have a file that has been populated with data. There are two choices, use an existing data file or create a new data file. This example contains a Windows command file that will create a number of sequential files starting with the creation of an ASCII/Text file that is populated with data. This file is then converted to other file formats with ASCII or EBCDIC encoded content. The following section will describe this process.


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

Table of Contents Previous Section Next Section Command Files for the Application

The following Microsoft Windows Command Files (referred to as scripts) will describe how to create an initial file with data and then convert this file to many other formats. Some of the scripts will run COBOL programs that have been compiled with Micro Focus Net Express. The COBOL programs were generated by the SimoTime Conversion technologies.

Table of Contents Previous Section Next Section Create the Sequential Test Files

The following (D80CRTW1.cmd) is the Windows Command file that uses the Microsoft "ECHO" command to pipe instream data to an ASCII/Text file. Once the LSEQ file (or ASCII/Text file) is created it is used as input to create a Record Sequential (RSEQ) file of 80-byte, ASCII-encoded records. Next, the Line Sequential (LSEQ or ASCII/Text) file is read a second time. The record content is converted from ASCII to EBCDIC. A new Record Sequential (RSEQ) file is created with the EBCDIC-encoded records.

@echo OFF
rem  * ************************************************************************
rem  *                 D80CRTW1.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   - Create various sequential files with 80-byte records.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This procedure uses the Microsoft "ECHO" command to pipe instream
rem  * data to an ASCII/Text file. The following terms are used.
rem  *
rem  * LSEQ - a Line Sequential File or ASCII/Text File
rem  * RSEQ - a Record Sequential File. This example uses a file of
rem  *        80-byte records that may be ASCII or EBCDIC encoded.
rem  *
rem  * Once the LSEQ file is created it is used as input to create an
rem  * RSEQ file of 80-byte, ASCII-encoded records.
rem  *
rem  * Next, the LSEQ file is read a second time. The record content is
rem  * converted from ASCII to EBCDIC. A new RSEQ file is created with
rem  * the EBCDIC-encodd records.
rem  *
rem  * *******************************************************************
rem  * Step 1, Delete any previously created file...
rem  *
     set CmdName=D80CRTW1
     call ..\Env1BASE
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%"
:DeleteLSEQ
     call SimoNOTE "Identify JobStep DeleteLSEQ"
     set LSEQ0080=%BaseLib1%\DATA\Txt1\LSEQ0080.TXT
     if exist %LSEQ0080% del %LSEQ0080%
rem  *
rem  * *******************************************************************
rem  * Step 2, Create a new output file. Use the "echo" command provided
rem  *         with Microsoft Windows to pipe instream data to a new
rem  *         ASCII/Text file.
rem  *
:ExecuteCreateLSEQ
     call SimoNOTE "Identify JobStep ExecuteCreateLSEQ"
rem  ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
echo 000100 Anderson       Adrian    111 Peachtree Plaza     Atlanta        GA 26101 >%LSEQ0080%
echo 000200 Brown          Billie    222 Baker Boulevard     Baltimore      MD 35702 >>%LSEQ0080%
echo 000300 Carson         Cameron   333 Crenshaw Blvd.      Cupertino      CA 96154 >>%LSEQ0080%
echo 000400 Davidson       Dion      444 Main Street         Wilmington     DE 27323 >>%LSEQ0080%
echo 000500 Everest        Evan      555 5TH Avenue          New York       NY 10341 >>%LSEQ0080%
echo 000600 Franklin       Francis   666 66TH Avenue         Bedrock        NY 11903 >>%LSEQ0080%
echo 000700 Garfunkel      Gwen      777 77TH Street         New York       NY 16539 >>%LSEQ0080%
echo 000800 Harrison       Hilary    888 88TH Street         Pocatello      ID 79684 >>%LSEQ0080%
echo 000900 Isley          Isabel    999 99TH Avenue         Indianapolis   IN 38762 >>%LSEQ0080%
echo 001000 Johnson        Jamie     1010 Paradise Drive     Larkspur       CA 90504 >>%LSEQ0080%
echo 001100 Kemper         Kelly     1111 Oak Circle         Kansas City    KS 55651 >>%LSEQ0080%
echo 001200 Lemond         Lesley    1212 Lockwood Road      Mohave Desert  AZ 80303 >>%LSEQ0080%
echo 001300 Mitchell       Marlow    1313 Miller Creek Road  Anywhere       TX 77123 >>%LSEQ0080%
echo 001400 Newman         Noel      1414 Park Avenue        Santa Monica   CA 90210 >>%LSEQ0080%
echo 001500 Osborn         Owen      1515 Center Stage       Rolling Rock   PA 36613 >>%LSEQ0080%
echo 001600 Powell         Pierce    PO Box 1616             Ventura        CA 97712 >>%LSEQ0080%
echo 001700 Quigley        Quincy    1717 Farm Hill Road     Oshkosh        WI 43389 >>%LSEQ0080%
echo 001800 Ripley         Ray       1818 Alien Lane         Wayout         KS 55405 >>%LSEQ0080%
echo 001900 Smith          Sammy     1919 Carnoustie Drive   Novato         CA 94919 >>%LSEQ0080%
echo 002000 Tucker         Taylor    2020 Sanger Lane        St. Paul       MN 43998 >>%LSEQ0080%
echo 002100 Underwood      Ulysses   2121 Wall Street        New York       NY 17623 >>%LSEQ0080%
echo 002200 Van Etten      Valerie   2222 Vine Street        Hollywood      CA 98775 >>%LSEQ0080%
echo 002300 Wilson         Wiley     2323 Main Street        Boston         MA 01472 >>%LSEQ0080%
echo 002400 Xray           Xavier    2424 24TH Street        Nashville      TN 44190 >>%LSEQ0080%
echo 002500 Young          Yanni     2525 Yonge Street       Toronto        ON 6B74A6>>%LSEQ0080%
echo 002600 Zenith         Zebulon   2626 26TH Street        Dallas         TX 71922 >>%LSEQ0080%
echo 123456 Doe            John      123 Main Street         Anywhere       OR 88156 >>%LSEQ0080%
echo 123457 Goetlieb       Günther   4567 Main Street        Anywhere       OR 88156 >>%LSEQ0080%
rem  *
     if not exist %LSEQ0080% set JobStatus=0002
     if not "%JobStatus%" == "0000" goto EojNok
     call SimoNOTE "Produced DataSet %LSEQ0080%"
rem  *
:ConvertLSEQtoRSEQasc
rem  *
rem  * *******************************************************************
rem  * Step 3, Read the previously created Line Sequential File (LSEQ)
rem  *         and write a Record Sequential File (RSEQ) with 80-byte,
rem  *         ASCII-encoded records.
rem  *
     call SimoNOTE "Identify JobStep ConvertLSEQtoRSEQasc"
     set GETLS080=%LSEQ0080%
     set PUTRS080=%BaseLib1%\DATA\Asc1\SIMOTIME.DATA.QSAM0080.DAT
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALAR
     if not exist %PUTRS080% set JobStatus=0003
     if not "%JobStatus%" == "0000" goto EojNok
     call SimoNOTE "Produced DataSet %PUTRS080%"
rem  *
:ConvertLSEQtoRSEQebc
rem  *
rem  * *******************************************************************
rem  * Step 4, Read the previously created Line Sequential File (LSEQ)
rem  *         and write a Record Sequential File (RSEQ) with 80-byte,
rem  *         EBCDIC-encoded records.
rem  *
     call SimoNOTE "Identify JobStep ConvertLSEQtoRSEQebc"
     set GETLS080=%LSEQ0080%
     set PUTRS080=%BaseLib1%\DATA\Ebc1\SIMOTIME.DATA.QSAM0080.DAT
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALER
     if not exist %PUTRS080% set JobStatus=0004
     if not "%JobStatus%" == "0000" goto EojNok
     call SimoNOTE "Produced DataSet %PUTRS080%"
rem  *
rem  * *******************************************************************
rem  *
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Delete the Sequential Test Files

The following (D80DELW1.cmd) is the Windows Command file that is used to delete the sequential files created by the D80CRTE1.CMD command.

@echo OFF
rem  * ************************************************************************
rem  *                 D80DELW1.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   - Delete various sequential files with 80-byte records.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This procedure will delete the sequential files created by
rem  * the D80CRTE1.CMD command.
rem  *
rem  * *******************************************************************
rem  * Step 1, Delete any previously created file...
rem  *
     set CmdName=D80DELW1
     call ..\ENV1BASE
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%"
:DeleteLSEQ
     call SimoNOTE "Identify JobStep DeleteLSEQ"
     set LSEQ0080=%BaseLib1%\DATA\Txt1\LSEQ0080.TXT
     if exist %LSEQ0080% del %LSEQ0080%
rem  *
:DeleteRSEQasc
     call SimoNOTE "Identify JobStep DeleteRSEQasc"
     set PUTRS080=%BaseLib1%\DATA\Asc1\SIMOTIME.DATA.QSAM0080.DAT
     if exist %PUTRS080% del %PUTRS080%
rem  *
:DeleteRSEQebc
     call SimoNOTE "Identify JobStep DeleteRSEQebc"
     set PUTRS080=%BaseLib1%\DATA\Ebc1\SIMOTIME.DATA.QSAM0080.DAT
     if exist %PUTRS080% del %PUTRS080%
rem  *
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Command Files for Data Convert

The following Windows Command Files will do file format and record content conversions.

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

The following (ALAR80E1.cmd) is the Windows Command file that is used to perform the file format conversion for a single file. The input file is Line Sequential (LSEQ or ASCII/Text) and the output file is Record Sequential (RSEQ).

@echo OFF
rem  * ************************************************************************
rem  *                 ALAR80E1.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 perform the following conversion for a single file.
rem  * 1. Read an ASCII-encoded, Line Sequential file having variable-length
rem  *    records with a maximum record length of eighty-bytes.
rem  * 2. Write an ASCII-encoded, Record Sequential file having eighty-byte,
rem  *    fixed-length records.
rem  * ************************************************************************
rem  * This procedure calls the following Windows Command Files or Programs.
rem  * 1. ENV1BASE.cmd - this provides a single point for setting commonly
rem  *    used environment variables.
rem  * 2. SIMONOTE.cmd - this provides a consistent process for displaying
rem  *    messages to the screen and writing to a journal or log file.
rem  * 3. RUN CV80ALAR - For the specified file perform the following actions.
rem  *                 - Do the file format conversion between Line Sequential
rem  *                   and Record Sequential.
rem  *                 - Leave the records in their ASCII-encoded content.
rem  * ************************************************************************
     set CmdName=ALAR80E1
     call ..\ENV1BASE %CmdName%
rem  *
     call SIMONOTE "*******************************************************%CmdName%.cmd"
     call SIMONOTE "Starting JobName %CmdName%.cmd"
rem  *
     set GETLS080=%BaseLib1%\DATA\Txt1\LSEQ0080.TXT
     set PUTRS080=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.QSAM0080.DAT
     call SIMONOTE "DataTAKE is %GETLS080%"
     call SIMONOTE "DataMAKE is %PUTRS080%"
     if exist %PUTRS080% erase %PUTRS080%
     run CV80ALAR
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
     if not exist %PUTRS080% set JobStatus=0035
     if not "%JobStatus%" == "0000" goto :EojNOK
     goto EojAok
:EojAOK
     call SIMONOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SIMONOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     echo %DATE% - %TIME% Starting User ABEND Processing...>>%SYSLOG%
     set >>%SYSLOG%
     echo %DATE% - %TIME% Complete User ABEND Processing...>>%SYSLOG%
     goto :End
:End
     call SIMONOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

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

The following (ALER80E1.cmd) is the Windows Command file that is used to perform the ASCII to EBCDIC file content conversion. Also, it will do the file format conversion between Line Sequential and Record Sequential. The input file is Line Sequential (LSEQ or ASCII/Text) and the output file is Record Sequential (RSEQ).

@echo OFF
rem  * ************************************************************************
rem  *                 ALAR80E1.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 perform the following conversion for a single file.
rem  * 1. Read an ASCII-encoded, Line Sequential file having variable-length
rem  *    records with a maximum record length of eighty-bytes.
rem  * 2. Write an ASCII-encoded, Record Sequential file having eighty-byte,
rem  *    fixed-length records.
rem  * ************************************************************************
rem  * This procedure calls the following Windows Command Files or Programs.
rem  * 1. ENV1BASE.cmd - this provides a single point for setting commonly
rem  *    used environment variables.
rem  * 2. SIMONOTE.cmd - this provides a consistent process for displaying
rem  *    messages to the screen and writing to a journal or log file.
rem  * 3. RUN CV80ALAR - For the specified file perform the following actions.
rem  *                 - Do the file format conversion between Line Sequential
rem  *                   and Record Sequential.
rem  *                 - Leave the records in their ASCII-encoded content.
rem  * ************************************************************************
     set CmdName=ALAR80E1
     call ..\ENV1BASE %CmdName%
rem  *
     call SIMONOTE "*******************************************************%CmdName%.cmd"
     call SIMONOTE "Starting JobName %CmdName%.cmd"
rem  *
     set GETLS080=%BaseLib1%\DATA\Txt1\LSEQ0080.TXT
     set PUTRS080=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.QSAM0080.DAT
     call SIMONOTE "DataTAKE is %GETLS080%"
     call SIMONOTE "DataMAKE is %PUTRS080%"
     if exist %PUTRS080% erase %PUTRS080%
     run CV80ALAR
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
     if not exist %PUTRS080% set JobStatus=0035
     if not "%JobStatus%" == "0000" goto :EojNOK
     goto EojAok
:EojAOK
     call SIMONOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SIMONOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     echo %DATE% - %TIME% Starting User ABEND Processing...>>%SYSLOG%
     set >>%SYSLOG%
     echo %DATE% - %TIME% Complete User ABEND Processing...>>%SYSLOG%
     goto :End
:End
     call SIMONOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

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

This section will describe how to convert a single file and how to convert multiple files using a list of file names.

Table of Contents Previous Section Next Section Batch Job to Convert a Single File

The following (ERAL80E1.cmd) is the Windows Command file that is used to perform the EBCDIC to ASCII file content conversion for a single file. Also, it will do the file format conversion between Record Sequential and Line Sequential.

@echo OFF
rem  * ************************************************************************
rem  *                 ERAL80E1.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 perform the following conversion for a single file.
rem  * Read an EBCDIC-encoded, Record Sequential file containing eighty-byte,
rem  * fixed-length records.
rem  * Write an ASCII-encoded, Line Sequential file containing variable-length
rem  * records with a maximum record length of eighty-bytes.
rem  * ************************************************************************
rem  * This procedure calls the following Windows Command Files or Programs.
rem  * 1. ENV1BASE.CMD - this provides a single point for setting commonly
rem  *    used environment variables.
rem  * 2. SimoNOTE.CMD - this provides a consistent process for displaying
rem  *    messages to the screen and writing to a journal or log file.
rem  * 3. RUN ERAL80C1 - For the specified file perform the following actions.
rem  *                 - Do the file content conversion between EBCDIC & ASCII
rem  *                 - Do the file format conversion between Line Sequential
rem  *                   and Record Sequential.
rem  * ************************************************************************
     set CmdName=ERAL80E1
     call ..\Env1BASE %CmdName%
rem  *
     call SimoNOTE "*******************************************************%CmdName%.CMD"
     call SimoNOTE "Starting JobName %CmdName%.CMD"
rem  *
     set GETRS080=%BaseLib1%\DATA\CblEbc\CblBitC1.CBL
     set PUTLS080=%BaseLib1%\DATA\CblASC\CblBitC1.CBL
     run CV80ERAL
     call SimoNOTE "Finished JobName %CmdName%.CMD"
     if not "%SimoGENS%" == "BATCH" pause
     endlocal

Table of Contents Previous Section Next Section Batch Job to Convert Multiple Files

The following (ERAL80E2.cmd) is the Windows Command file that is used to perform the EBCDIC to ASCII file content conversion for multiple files.. Also, it will do the file format conversion between Record Sequential and Line Sequential.

@echo OFF
rem  * ************************************************************************
rem  *                 ERAL80E2.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 perform the following conversion for multiple files.
rem  * Read an EBCDIC-encoded, Record Sequential file containing eighty-byte,
rem  * fixed-length records.
rem  * Write an ASCII-encoded, Line Sequential file containing variable-length
rem  * records with a maximum record length of eighty-bytes.
rem  * ************************************************************************
rem  * This procedure calls the following Windows Command Files or Programs.
rem  * 1. Env1BASE.CMD - this provides a single point for setting commonly
rem  *    used environment variables.
rem  * 2. SimoNOTE.CMD - this provides a consistent process for displaying
rem  *    messages to the screen and writing to a journal or log file.
rem  * 3. DIR Command  - this will create a file that is a list of all the
rem  *    Cobol program in the specified directory.
rem  * 4. FOR Command  - for each of the file names in the list file perform
rem  *                   the following actions.
rem  *                 - Do the file content conversion between EBCDIC & ASCII
rem  *                 - Do the file format conversion between Line Sequential
rem  *                   and Record Sequential.
rem  * ************************************************************************
     set CmdName=ERAL80E2
     call ..\Env1BASE %CmdName%
rem  *
     call SimoNOTE "*******************************************************%CmdName%.CMD"
     call SimoNOTE "Starting JobName %CmdName%.CMD"
     DIR /on /b /a-d %BaseLib1%\DATA\CblEbc\*.CBL>ListCobolSourceCode.TXT
rem  *
     FOR /F %%i in (ListCobolSourceCode.TXT) do (set GETRS080=%BaseLib1%\DATA\CblEbc\%%i
                                                 set PUTLS080=%BaseLib1%\DATA\CblAsc\%%i
                                                 run CV80ERAL)
     call SimoNOTE "Finished JobName %CmdName%.CMD"
     if not "%SimoGENS%" == "BATCH" pause
     endlocal

Table of Contents Previous Section Next Section COBOL Convert Programs

This section describes the COBOL programs that are used to do the actual file format and/or file content conversions.

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

The following (CV80ALAR.cbl) is the COBOL program that is used to perform the file format conversion for a single file. The input file is Line Sequential (LSEQ or ASCII/Text) and the output file is Record Sequential (RSEQ). This conversion process uses a single COBOL program.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CV80ALAR.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2020-03-20  Generation Time: 16:54:50:92    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   GETLS080 ASCII/CRLF    VARIABLE   00080            *
      *                                                               *
      *  SECONDARY PUTRS080 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT GETLS080-FILE  ASSIGN TO       GETLS080
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS GETLS080-STATUS.
           SELECT PUTRS080-FILE  ASSIGN TO       PUTRS080
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS PUTRS080-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  GETLS080-FILE
           DATA RECORD    IS GETLS080-REC
           .
       01  GETLS080-REC.
           05  GETLS080-DATA-01 PIC X(00080).

       FD  PUTRS080-FILE
           DATA RECORD    IS PUTRS080-REC
           .
       01  PUTRS080-REC.
           05  PUTRS080-DATA-01 PIC X(00080).

      *****************************************************************
      * 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 20.00.00          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CV80ALAR '.
           05  T2 pic X(34) value 'Convert 80/80 ASC_LSEQ to ASC_RSEQ'.
           05  T3 pic X(10) value ' v20.00.00'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CV80ALAR '.
           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  GETLS080-STATUS.
           05  GETLS080-STATUS-L     pic X.
           05  GETLS080-STATUS-R     pic X.
       01  GETLS080-EOF              pic X       value 'N'.
       01  GETLS080-OPEN-FLAG        pic X       value 'C'.

       01  PUTRS080-STATUS.
           05  PUTRS080-STATUS-L     pic X.
           05  PUTRS080-STATUS-R     pic X.
       01  PUTRS080-EOF              pic X       value 'N'.
       01  PUTRS080-OPEN-FLAG        pic X       value 'C'.

       01  GETLS080-LRECL            pic 9(5)    value 00080.
       01  PUTRS080-LRECL            pic 9(5)    value 00080.
       01  GETLS080-LRECL-MAX        pic 9(5)    value 00080.
       01  PUTRS080-LRECL-MAX        pic 9(5)    value 00080.

      *****************************************************************
      * 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-TO-SYSOUT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(011)  value '* CV80ALAR '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(068)  value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.
       01  MSG-LSB                 pic 9(5)    value 267.

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

       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)
                   value   'Convert 80/80 ASC_LSEQ to ASC_RSEQ'.
           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  GETLS080-TOTAL.
           05  GETLS080-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for GETLS080'.
       01  PUTRS080-TOTAL.
           05  PUTRS080-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for PUTRS080'.

      *****************************************************************
       PROCEDURE DIVISION.
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           move INFO-STATEMENT to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           perform Z-POST-COPYRIGHT
           perform GETLS080-OPEN
           perform PUTRS080-OPEN

      *    USRSOJ Processing not specified...

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

      *    USREOJ Processing not specified...

           move GETLS080-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS

           move PUTRS080-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS

           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-TO-SYSOUT

           perform PUTRS080-CLOSE
           perform GETLS080-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *    TransINIT process...
           move ALL X'20'       to PUTRS080-REC
      *    TransCOPY...
           move GETLS080-REC(00001:00080) to PUTRS080-REC(00001:00080)
           exit.

      *****************************************************************
      * I/O Routines for the INPUT File...                            *
      *****************************************************************
       GETLS080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close GETLS080-FILE
           if  GETLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with GETLS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move GETLS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       GETLS080-READ.
           read GETLS080-FILE
           if  GETLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  GETLS080-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 GETLS080-EOF
               else
                   move 'READ Failure with GETLS080' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TO-USERS
                   move GETLS080-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       GETLS080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input GETLS080-FILE
           if  GETLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to GETLS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with GETLS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move GETLS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       PUTRS080-WRITE.
           if  PUTRS080-OPEN-FLAG = 'C'
               perform PUTRS080-OPEN
           end-if
           write PUTRS080-REC
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  PUTRS080-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
               move 'WRITE Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       PUTRS080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT PUTRS080-FILE
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to PUTRS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       PUTRS080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close PUTRS080-FILE
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to PUTRS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-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-TO-USERS
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-CALCULATE-MESSAGE-LSB.
           add 267 to ZERO giving MSG-LSB
           perform until MSG-LSB < 80
                      or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE
             if MESSAGE-BUFFER(MSG-LSB:1) = SPACE
                subtract 1 from MSG-LSB
             end-if
           end-perform
           exit.

      *****************************************************************
      * Post message to the SYSOUT device, clear message buffer...    *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-SYSOUT.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.
      *****************************************************************
      * Display message to console, do not clear message buffer...    *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-CONSOLE.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB) upon console
           exit.
      *****************************************************************
      * Display message to console and post to SYSOUT device...       *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-USERS.
           perform Z-DISPLAY-MESSAGE-TO-CONSOLE
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           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-TO-USERS
           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-TO-USERS
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2020-03-20  Generation Time: 16:54:50:94    *
      *****************************************************************

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

The following (CV80ALER.cbl) is the COBOL program that is used to perform the ASCII to EBCDIC file content conversion. Also, it will do the file format conversion between Line Sequential and Record Sequential. The input file is Line Sequential (LSEQ or ASCII/Text) and the output file is Record Sequential (RSEQ).

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CV80ALER.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2020-03-20  Generation Time: 16:54:51:22    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   GETLS080 ASCII/CRLF    VARIABLE   00080            *
      *                                                               *
      *  SECONDARY PUTRS080 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *                                                               *
      *            Translation Mode is ASCII to EBCDIC                *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT GETLS080-FILE  ASSIGN TO       GETLS080
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS GETLS080-STATUS.
           SELECT PUTRS080-FILE  ASSIGN TO       PUTRS080
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS PUTRS080-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  GETLS080-FILE
           DATA RECORD    IS GETLS080-REC
           .
       01  GETLS080-REC.
           05  GETLS080-DATA-01 PIC X(00080).

       FD  PUTRS080-FILE
           DATA RECORD    IS PUTRS080-REC
           .
       01  PUTRS080-REC.
           05  PUTRS080-DATA-01 PIC X(00080).

      *****************************************************************
      * 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 20.00.00          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CV80ALER '.
           05  T2 pic X(34) value 'Convert 80/80 ASC_LSEQ to EBC_RSEQ'.
           05  T3 pic X(10) value ' v20.00.00'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CV80ALER '.
           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  GETLS080-STATUS.
           05  GETLS080-STATUS-L     pic X.
           05  GETLS080-STATUS-R     pic X.
       01  GETLS080-EOF              pic X       value 'N'.
       01  GETLS080-OPEN-FLAG        pic X       value 'C'.

       01  PUTRS080-STATUS.
           05  PUTRS080-STATUS-L     pic X.
           05  PUTRS080-STATUS-R     pic X.
       01  PUTRS080-EOF              pic X       value 'N'.
       01  PUTRS080-OPEN-FLAG        pic X       value 'C'.

       01  GETLS080-LRECL            pic 9(5)    value 00080.
       01  PUTRS080-LRECL            pic 9(5)    value 00080.
       01  GETLS080-LRECL-MAX        pic 9(5)    value 00080.
       01  PUTRS080-LRECL-MAX        pic 9(5)    value 00080.

      *****************************************************************
      * 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-TO-SYSOUT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(011)  value '* CV80ALER '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(068)  value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.
       01  MSG-LSB                 pic 9(5)    value 267.

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

       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)
                   value   'Convert 80/80 ASC_LSEQ to EBC_RSEQ'.
           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  GETLS080-TOTAL.
           05  GETLS080-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for GETLS080'.
       01  PUTRS080-TOTAL.
           05  PUTRS080-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for PUTRS080'.

      *****************************************************************
      * The following copy file contains the translation tables for   *
      * the ASCII and EBCDIC conversion. Also, sections of the tables *
      * may be used for case conversion.                              *
      *****************************************************************
       COPY ASCEBCB1.
      *****************************************************************
       PROCEDURE DIVISION.
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           move INFO-STATEMENT to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           perform Z-POST-COPYRIGHT
           perform GETLS080-OPEN
           perform PUTRS080-OPEN

      *    USRSOJ Processing not specified...

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

      *    USREOJ Processing not specified...

           move GETLS080-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS

           move PUTRS080-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS

           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-TO-SYSOUT

           perform PUTRS080-CLOSE
           perform GETLS080-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *    TransMODE is A2E...
      *    TransINIT process...
           move ALL X'40'       to PUTRS080-REC
      *    TransLATE...
           move GETLS080-REC(00001:00080) to PUTRS080-REC(00001:00080)
           inspect PUTRS080-REC(1:80)      converting A-INFO to E-INFO
           exit.

      *****************************************************************
      * I/O Routines for the INPUT File...                            *
      *****************************************************************
       GETLS080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close GETLS080-FILE
           if  GETLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with GETLS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move GETLS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       GETLS080-READ.
           read GETLS080-FILE
           if  GETLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  GETLS080-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 GETLS080-EOF
               else
                   move 'READ Failure with GETLS080' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TO-USERS
                   move GETLS080-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       GETLS080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input GETLS080-FILE
           if  GETLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to GETLS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with GETLS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move GETLS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       PUTRS080-WRITE.
           if  PUTRS080-OPEN-FLAG = 'C'
               perform PUTRS080-OPEN
           end-if
           write PUTRS080-REC
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  PUTRS080-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
               move 'WRITE Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       PUTRS080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT PUTRS080-FILE
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to PUTRS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       PUTRS080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close PUTRS080-FILE
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to PUTRS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-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-TO-USERS
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-CALCULATE-MESSAGE-LSB.
           add 267 to ZERO giving MSG-LSB
           perform until MSG-LSB < 80
                      or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE
             if MESSAGE-BUFFER(MSG-LSB:1) = SPACE
                subtract 1 from MSG-LSB
             end-if
           end-perform
           exit.

      *****************************************************************
      * Post message to the SYSOUT device, clear message buffer...    *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-SYSOUT.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.
      *****************************************************************
      * Display message to console, do not clear message buffer...    *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-CONSOLE.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB) upon console
           exit.
      *****************************************************************
      * Display message to console and post to SYSOUT device...       *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-USERS.
           perform Z-DISPLAY-MESSAGE-TO-CONSOLE
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           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-TO-USERS
           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-TO-USERS
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2020-03-20  Generation Time: 16:54:51:22    *
      *****************************************************************

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

The following (CV80ERAL.cbl) is the COBOL program that is used to perform the EBCDIC to ASCII file content conversion for a single file. Also, it will do the file format conversion between Record Sequential (RSEQ) and Line Sequential (LSEQ or ASCII/Text) .

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CV80ERAL.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2020-03-20  Generation Time: 16:54:52:38    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   GETRS080 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  SECONDARY PUTLS080 ASCII/CRLF    VARIABLE   00080            *
      *                                                               *
      *                                                               *
      *            Translation Mode is EBCDIC to ASCII                *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT GETRS080-FILE  ASSIGN TO       GETRS080
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS GETRS080-STATUS.
           SELECT PUTLS080-FILE  ASSIGN TO       PUTLS080
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS PUTLS080-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  GETRS080-FILE
           DATA RECORD    IS GETRS080-REC
           .
       01  GETRS080-REC.
           05  GETRS080-DATA-01 PIC X(00080).

       FD  PUTLS080-FILE
           DATA RECORD    IS PUTLS080-REC
           .
       01  PUTLS080-REC.
           05  PUTLS080-DATA-01 PIC X(00080).

      *****************************************************************
      * 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 20.00.00          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CV80ERAL '.
           05  T2 pic X(34) value 'Convert 80/80 EBC_RSEQ to ASC_LSEQ'.
           05  T3 pic X(10) value ' v20.00.00'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CV80ERAL '.
           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  GETRS080-STATUS.
           05  GETRS080-STATUS-L     pic X.
           05  GETRS080-STATUS-R     pic X.
       01  GETRS080-EOF              pic X       value 'N'.
       01  GETRS080-OPEN-FLAG        pic X       value 'C'.

       01  PUTLS080-STATUS.
           05  PUTLS080-STATUS-L     pic X.
           05  PUTLS080-STATUS-R     pic X.
       01  PUTLS080-EOF              pic X       value 'N'.
       01  PUTLS080-OPEN-FLAG        pic X       value 'C'.

       01  GETRS080-LRECL            pic 9(5)    value 00080.
       01  PUTLS080-LRECL            pic 9(5)    value 00080.
       01  GETRS080-LRECL-MAX        pic 9(5)    value 00080.
       01  PUTLS080-LRECL-MAX        pic 9(5)    value 00080.

      *****************************************************************
      * 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-TO-SYSOUT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(011)  value '* CV80ERAL '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(068)  value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.
       01  MSG-LSB                 pic 9(5)    value 267.

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

       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)
                   value   'Convert 80/80 EBC_RSEQ to ASC_LSEQ'.
           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  GETRS080-TOTAL.
           05  GETRS080-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for GETRS080'.
       01  PUTLS080-TOTAL.
           05  PUTLS080-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for PUTLS080'.

      *****************************************************************
      * The following copy file contains the translation tables for   *
      * the ASCII and EBCDIC conversion. Also, sections of the tables *
      * may be used for case conversion.                              *
      *****************************************************************
       COPY ASCEBCB1.
      *****************************************************************
       PROCEDURE DIVISION.
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           move INFO-STATEMENT to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           perform Z-POST-COPYRIGHT
           perform GETRS080-OPEN
           perform PUTLS080-OPEN

      *    USRSOJ Processing not specified...

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

      *    USREOJ Processing not specified...

           move GETRS080-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS

           move PUTLS080-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS

           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-TO-SYSOUT

           perform PUTLS080-CLOSE
           perform GETRS080-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *    TransMODE is E2A...
      *    TransINIT process...
           move ALL X'20'       to PUTLS080-REC
      *    TransLATE...
           move GETRS080-REC(00001:00080) to PUTLS080-REC(00001:00080)
           inspect PUTLS080-REC(1:80)      converting E-INFO to A-INFO
           exit.

      *****************************************************************
      * I/O Routines for the INPUT File...                            *
      *****************************************************************
       GETRS080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close GETRS080-FILE
           if  GETRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with GETRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move GETRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       GETRS080-READ.
           read GETRS080-FILE
           if  GETRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  GETRS080-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 GETRS080-EOF
               else
                   move 'READ Failure with GETRS080' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TO-USERS
                   move GETRS080-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       GETRS080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input GETRS080-FILE
           if  GETRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to GETRS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with GETRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move GETRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       PUTLS080-WRITE.
           if  PUTLS080-OPEN-FLAG = 'C'
               perform PUTLS080-OPEN
           end-if
           write PUTLS080-REC
           if  PUTLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  PUTLS080-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
               move 'WRITE Failure with PUTLS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTLS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       PUTLS080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT PUTLS080-FILE
           if  PUTLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to PUTLS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with PUTLS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTLS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       PUTLS080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close PUTLS080-FILE
           if  PUTLS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to PUTLS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with PUTLS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTLS080-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-TO-USERS
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-CALCULATE-MESSAGE-LSB.
           add 267 to ZERO giving MSG-LSB
           perform until MSG-LSB < 80
                      or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE
             if MESSAGE-BUFFER(MSG-LSB:1) = SPACE
                subtract 1 from MSG-LSB
             end-if
           end-perform
           exit.

      *****************************************************************
      * Post message to the SYSOUT device, clear message buffer...    *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-SYSOUT.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.
      *****************************************************************
      * Display message to console, do not clear message buffer...    *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-CONSOLE.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB) upon console
           exit.
      *****************************************************************
      * Display message to console and post to SYSOUT device...       *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-USERS.
           perform Z-DISPLAY-MESSAGE-TO-CONSOLE
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           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-TO-USERS
           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-TO-USERS
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2020-03-20  Generation Time: 16:54:52:38    *
      *****************************************************************

Table of Contents Previous Section Next Section Common or Shared Functions

This section describes the command files that are used or called from other command files to perform various system or sub-system oriented tasks. For example, setting the commonly used environment variables in a single, callable command simplifies the process and makes it easier to adjust if the environment changes.

Table of Contents Previous Section Next Section Set the Environment

The following (ENV1BASE.cmd) is the Windows Command file that is used to set the environment variables that are commonly used across the application.

@echo OFF
rem  * *******************************************************************
rem  *               ENV1BASE.cmd - a Windows Command File               *
rem  *        This program is provided by SimoTime Technologies          *
rem  *           (C) Copyright 1987-2021 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 SimoLIBR=c:\SimoLIBR
     set BASELIB1=c:\SIMOSAM1\DEVL
     set BASELIB8=c:\SimoSAM8
     set BaseWIP1=c:\SimoSAM1\WIP1
     set DATAZERO=c:\SIMODATA\DEVL\DATA\ZERO
     set BASEAPP=%BaseLib1%
     set BASESYS=%BaseLib1%\SYS1
     set BASECAT=%BaseLib1%\DATA
     set UMAPALIB=%BASECAT%\ASC1
     set UMAPELIB=%BASECAT%\EBC1
     set SYSLOG=%BASESYS%\LOGS\SYSLOG_USER.DAT
     set SYSOUT=%BASEAPP%\LOGS\SYSOUT_SIMSAM01.txt
     set SLZMSG=%BASEAPP%\LOGS\SLZMSG_USER.TXT
     set PostNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT
     set SIMONOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.txt
     set USERPOST=%BASEAPP%\LOGS\ASSIGNED_USER_POST_FILE.txt
     if [%1]==[] goto NO_POST
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_%1.txt
     call SIMONOTE "+ ENV1BASE *"
     call SIMONOTE "+ ENV1BASE ********************************************************************%1"
     call SIMONOTE "+ ENV1BASE is preparing the System Environment..."
     call SIMONOTE "+ SIMOLIBR is %SIMOLIBR%"
     call SIMONOTE "+ MIFOSYS1 is %MIFOSYS1%"
     call SIMONOTE "+ BASELIB1 is %BASELIB1%"
:NO_POST
     call SIMONOTE "+ SIMONOTE Job Log File is %SIMONOTE% "
rem  *
     set MQBASE=C:\Program Files\IBM\WebSphere MQ
rem  *
rem  * Set the location for the Apache-Tomcat Server...
     set CATALINA_HOME=C:\APACHETC\apache-tomcat-7.0.52
rem     set CATALINA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_112
rem  *
rem  * Set the Environment for the Java Environment...
rem     set JAVABASE=C:\APACHETC\apache-tomcat-7.0.52
     set JAVABASE=C:\Program Files (x86)\Java\jdk1.8.0_112
     set JAVASDK="%JAVABASE%\bin"
     set JAVA_HOME=%JAVABASE%
     set JRE_HOME=%JAVABASE%
     set SIMOTCAT=%CATALINA_HOME%\webapps\simotcat
     set SIMPACKS=%CATALINA_HOME%\webapps\simotcat\WEB-INF\classes\simpacks
rem  *
rem  * Set the environment for the Micro Focus technology...
     set MIFOEDEV=C:\Program Files (x86)\Micro Focus\Enterprise Developer
     set MIFOVCBL=C:\Program Files (x86)\Micro Focus\Visual COBOL Build Tools
     set MIFOESTU=C:\Program Files (x86)\Micro Focus\Studio Enterprise Edition 6.0
     set MIFOEMFE="C:\Program Files (x86)\Micro Focus\Mainframe Express"
rem  *
rem  * Large file support, performance tuning and record locking of the File Handler
     set EXTFH=%BASESYS%\CONFIG\EXTFHBIG.CFG
rem  *
rem  * For IMS Support
     set ES_IMSLIB=%BASEAPP%\IMSLIB
     set ES_ACBLIB=%BASEAPP%\IMSLIB
rem  *
rem  * EZASOKETS Check EZASOKETS Enabled box or set ES_EZASOKET_SUPPORT=YES
     set EZACONFG=BASESYS1\CONFIG\EZACONFG.dat
rem  *
rem  * Resource Allocation and Performance for SORT and non-Relational Data
rem  set MFJSENGINE=SYNCSORT
     set SORTSCHEME=1
     set SORTSPACE=750000000
     set TMP=C:\SORTWORK
rem  *
     set ES_ALLOC_OVERRIDE=%BASESYS%\CONFIG\CATMAPA1.cfg
rem  * For CORE_ON_ERROR function, ABEND Dump
rem  *     set COBCONFIG_=%BASESYS%\CONFIG\diagnose.cfg
rem  *
rem  * Consolidated Trace Facility (CTF)
rem  *     set MFTRACE_CONFIG=%BASESYS%\CONFIG\ctf.cfg
rem  *     set MFTRACE_LOGS=c:\ctflogs
rem  *
rem  * For Job Restart, ABEND Recovery
     set MF_UCC11=Y
     set ES_JES_RESTART=Y
rem  *
rem  * Set environment for MFBSI (Micro Focus Batch Scheduling Interface)
     set ES_EMP_EXIT_1=mfbsiemx
     set MFBSI_DIR=%BASESYS%\LOGS\%JESSERVERNAME%
     set MFBSIEOP_CMD=ENABLE
     set MFBSIEOP_CSV=ENABLE
     set MFBSIEOP_HTM=ENABLE
     set MFBSIEOP_XML=ENABLE
rem  *
rem  * Set Behavior and Trace Flags for GETJOBDD
rem  *   Position=12345678/12345678
     set JDDFLAGS=nnnWnnnn/YYnnnnnn
rem  *
rem  * If not already set then set the PATH for Micro Focus Directories
     if "%SIMOPATH%" == "Y" goto JUMPPATH
     if "%MIFOSYS1%" == "EDEV" goto JUMPEDEV
     if "%MIFOSYS1%" == "VCBL" goto JUMPVCBL
     if "%MIFOSYS1%" == "ESTU" goto JUMPESTU
     if "%MIFOSYS1%" == "EMFE" goto JUMPEMFE
:JUMPEDEV
     set path=%BASESYS%\LOADLIB;%MIFOEDEV%\bin;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOEDEV%\CPYLIB
     set MIFOBASE=%MIFOEDEV%
     goto JUMPPATH
:JUMPVCBL
     set path=%MIFOVCBL%\bin;%MIFOVCBL%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set MIFOBASE=%MIFOVCBL%
     goto JUMPPATH
:JUMPESTU
     set MIFOBASE=%MIFOESTU%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
:JUMPEMFE
     set MIFOBASE=%MIFOEMFE%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
rem  *
:JUMPPATH
     set SIMOPATH=Y
rem  *
     set MAINFRAME_FLOATING_POINT=true
     set COBIDY=%BASEAPP%\COBIDY
     set COBPATH=.;%BASEAPP%\LOADLIB;%BASEAPP%\LOADLIB\GNTS;%BASESYS%\LOADLIB;%SimoLIBR%
     set LIBPATH=.;%BASEAPP%\LOADLIB;%BASEAPP%\LOADLIB\GNTS;%BASESYS%\LOADLIB;%SimoLIBR%
     set TXDIR=%BASESYS%\LOADLIB;%MIFOBASE%
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%
rem  *
     set USERCLASS=%BASELIB1%\LOADLIB
     set CLASSPATH=.
     set CLASSPATH=%CLASSPATH%;%JAVABASE%
     set CLASSPATH=%CLASSPATH%;%JAVABASE%\lib
     set CLASSPATH=%CLASSPATH%;\%USERCLASS%\simpacks
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes\simpacks
rem  *
     if "%MIFOSYS1%" == "ESTU" set CLASSPATH=%CLASSPATH%;%MIFOBIN%
     if "%MIFOSYS1%" == "EDEV" set CLASSPATH=%CLASSPATH%;%MIFOEDEV%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%\bin\mfcobol.jar
rem  *
     set JobStatus=0000
     call SIMONOTE "+ ENV1BASE is returning to caller"


Table of Contents Previous Section Next Section Display and Log Messages

The following (SIMONOTE.cmd) is typically called from other command files to display a message to the screen and write the message to a log file with a time stamp.

@echo OFF
rem  * *******************************************************************
rem  *               SIMONOTE.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    - Display message on screen and write to a log file.
rem  * Author  - SimoTime Technologies
rem  *
rem  * This script may be called from other scripts and expects a single
rem  * parameter enclosed in double quotes. The double quotes will be
rem  * removed. Before writing to the log file a date and time stamp
rem  * will be inserted in front of the message text.
rem  *
rem  * Note: The tilde (~) removes leading/trailing double-quotes.
rem  *
if "%SimoNOTE%" == "" set SimoNOTE=c:\SimoLIBR\LOGS\SimoTime.LOG
echo %date% %time% %~1>> %SimoNOTE%
echo %~1

Table of Contents Previous Section Next Section Summary

Applications that are currently running on a Mainframe System (or being migrated to a distributed system) may still have an abundance of files with 80-byte records. This document describes a process for converting these files with 80-byte records to various file formats and encoding schemas. The document may be used 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 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  Contact or Feedback  section of this document.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note: A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore a Suite of Utility Programs that process sequential files with 80 byte records. This includes programs for an IBM Mainframe System, a Micro Focus COBOL environment or a GnuCOBOL environment. The programs perform various file format and record content conversions or data file comparison functions.

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 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 An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore The 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 that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

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 (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Contact 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
Data File Format and Record Content Conversion with Eighty Byte Records
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com