File Conversion
 ASCII and EBCDIC - QSAM and VSAM
When technology complements business    Copyright © 1987-2013  SimoTime Enterprises  All Rights Reserved
  Table of Contents Version 12.11.21 
  Introduction
  JCL for the Mainframe
  EBCDIC to ASCII, JCL for Executing the Conversion Program
  EBCDIC Character Set, JCL for Creating a QSAM Test File
  ASCII to EBCDIC, JCL for Executing the Conversion Program
  ASCII Character Set, JCL for Creating a QSAM Test File
  The COBOL Conversion Programs
  Convert EBCDIC Sequential File to ASCII
  Convert ASCII Sequential File to EBCDIC
  The ASCII and EBCDIC Tables
  Program Generation, Process Control File
  Summary
  Software Agreement and Disclaimer
  Downloads and Links to Similar Pages
  Downloads and Links, Internet Access Required
  Glossary of Terms
  Comments, Suggestions or Feedback
  Company Overview
The SimoTime Home Page

Introduction
(Next) (Previous) (Table-of-Contents)

This is an example of how a COBOL program can read a sequential file with EBCDIC content that is downloaded from a mainframe in binary format using FTP (File Transfer Protocol). The example then describes how to translate the EBCDIC content to ASCII and write an ASCII file. At first glance the conversion between EBCDIC and ASCII appears to be a simple and practical task. Typically the EBCDIC files reside on a mainframe legacy system. These files may be very large and may have been updated over a period of many years. In addition to containing displayable EBCDIC characters the records may contain binary and packed decimal fields that cannot simply be converted using an EBCDIC/ASCII table. Signed numbers cannot be converted in the same manner as text data.

Also, some of the fields in a record may contains low-values (i.e. x'00') that are being handle as a space characters on the mainframe. The low-values remain low-values when converted to ASCII and when downloaded or ported to the PC these low-values may be treated as null characters and this presents a problem if not addressed in the initial conversion process.

A general guideline to follow is, "The scope of effort for converting a mainframe legacy file from EBCDIC to ASCII is directly proportional to the size of the file, the age of the file and the number and type of numeric fields." Estimating the time for conversion between EBCDIC and ASCII can be done with a high degree of accuracy. Estimating the time for "scrubbing the data" may be a challenging task.

The COBOL source code described in this document was generated using SimoZAPS, a product of SimoTime Enterprises. The SimoZAPS utility program also has the capability of reading, writing or converting between other file formats. In the world of programming there are many ways to solve a problem. This program is provided as a COBOL example of one of the possible solutions to the problem of changing the contents and structure of data files.

Additional information for doing various file conversions may be found in the Downloads and Links to Similar Pages section of this document.

JCL for the Mainframe
(Next) (Previous) (Table-of-Contents)

This suite of sample JCL Members describes and demonstrates how to create test data sets and convert between the EBCDIC and ASCII character sets.

EBCDIC to ASCII, JCL for Executing the Conversion Program
(Next) (Previous) (Table-of-Contents)

This JCL member (CBLE2AJ1.JCL) will read an EBCDIC file, do the data translation from EBCDIC to ASCII and create a new sequential file. The DD statements will probably need to be modified to run on different mainframes. This JCL member will run on an IBM Mainframe with ZOS or a Linux, UNIX or Linux System with Micro Focus Enterprise Server.

//CBLE2AJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CBLE2AJ1.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by: SimoTime Enterprises        *
//*           (C) Copyright 1987-2013 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Read QSAM 80-byte EBCDIC and write QSAM 80-byte ASCII.
//* Author - SimoTime Enterprises
//* Date   - January 24, 1996
//*
//* The job will read an 80-byte file (QSAM080E) in EBCDIC format and
//* create an 80-byte file (QSAM080A) in ASCII format. This is an
//* 80/80 repro with conversion from EBCDIC to ASCII.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//*                     ************
//*                     * CBLE2AJ1 *
//*                     ********jcl*
//*                          *
//*                          *
//*    ************     ************     ************
//*    * EBCFILE  *-----* CBLE2AC1 *-----* ASCFILE  *
//*    ************     ************     ************
//*                          *
//*                          *
//*                     ************
//*                     *   EOJ    *
//*                     ************
//*
//* *******************************************************************
//* Step   1 of 1  This is a single step job.
//*
//EXECC2A1 EXEC PGM=CBLE2AC1
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB,DISP=SHR
//EBCFILE  DD  DSN=SIMOTIME.DATA.QSAM080E,DISP=SHR
//ASCFILE  DD  DSN=SIMOTIME.DATA.QSAM080A,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//

EBCDIC Character Set, JCL for Creating a QSAM Test File
(Next) (Previous) (Table-of-Contents)

This JCL member (CBLE2AJ8.JCL) is provided to create an EBCDIC file that may be used as input when attempting to execute the conversion program. The DD statements will probably need to be modified to run on different mainframes. This JCL member will run on an IBM Mainframe with ZOS or a Linux, UNIX or Linux System with Micro Focus Enterprise Server that is configured to use the EBCDIC character set.

//CBLE2AJ8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CBLE2AJ8.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by: SimoTime Enterprises        *
//*           (C) Copyright 1987-2013 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Create a Sequential Data Set on disk using IEBGENER.
//* Author - SimoTime Enterprises
//* Date   - January 24, 1996
//*
//* The first job step (DELTQSAM) will delete any previously created
//* file. The second job step (CRTQNAME) will create a new file.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//* *******************************************************************
//* Step   1   Delete any previously created file...
//*
//         SET DSN4CUST=SIMOTIME.DATA.QSAM080E
//QSAMDELT EXEC PGM=IEFBR14
//QSAM0080 DD  DSN=&DSN4CUST,
//             DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step   2   Create and populate a new QSAM file...
//*
//QSAMCRT1 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  DSN=SIMOTIME.PDS.PARMLIB(CUSR80D1),
//             DISP=SHR
//SYSUT2   DD  DSN=&DSN4CUST,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//


ASCII to EBCDIC, JCL for Executing the Conversion Program
(Next) (Previous) (Table-of-Contents)

This JCL member (CBLA2EJ1.JCL) will read an ASCII file, do the data translation from ASCII to EBCDIC and create a new sequential file. The DD statements will probably need to be modified to run on different mainframes. This JCL member will run on an IBM Mainframe with ZOS or a Linux, UNIX or Linux System with Micro Focus Enterprise Server.

//CBLA2EJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CBLA2EJ1.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by: SimoTime Enterprises        *
//*           (C) Copyright 1987-2013 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Read QSAM 80-byte EBCDIC and write QSAM 80-byte ASCII.
//* Author - SimoTime Enterprises
//* Date   - January 24, 1996
//*
//* The job will read an 80-byte file (QSAM080A) in ASCII format and
//* create an 80-byte file (QSAM080E) in EBCDIC format. This is an
//* 80/80 repro with conversion from ASCII to EBCDIC.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//*                     ************
//*                     * CBLA2EJ1 *
//*                     ********jcl*
//*                          *
//*                          *
//*    ************     ************     ************
//*    * ASCFILE  *-----* CBLA2EC1 *-----* EBCFILE  *
//*    ************     ************     ************
//*                          *
//*                          *
//*                     ************
//*                     *   EOJ    *
//*                     ************
//*
//*
//* *******************************************************************
//* Step 1 of 2, Delete any previously created file...
//*
//QSAMDELT EXEC PGM=IEFBR14
//SYSUT2   DD  DSN=SIMOTIME.DATA.QSAM080E,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//* *******************************************************************
//* Step 2 of 2, Convert the file....
//*
//EXECA2E1 EXEC PGM=CBLA2EC1
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//ASCFILE  DD  DSN=SIMOTIME.DATA.QSAM080A,DISP=SHR
//EBCFILE  DD  DSN=SIMOTIME.DATA.QSAM080E,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//

ASCII Character Set, JCL for Creating a QSAM Test File
(Next) (Previous) (Table-of-Contents)

This JCL member (CBLA2EJ8.JCL) is provided to create an ASCII file that may be used as input when attempting to execute the conversion program. The DD statements will probably need to be modified to run on different mainframes. This JCL member will run on an IBM Mainframe with ZOS or a Linux, UNIX or Linux System with Micro Focus Enterprise Server that is configured to use the ASCII character set.

//CBLA2EJ8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CBLA2EJ8.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by: SimoTime Enterprises        *
//*           (C) Copyright 1987-2013 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Create a Sequential Data Set on disk using IEBGENER.
//* Author - SimoTime Enterprises
//* Date   - January 24, 1996
//*
//* The first job step (DELTQSAM) will delete any previously created
//* file. The second job step (CRTQNAME) will create a new file.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//* *******************************************************************
//* Step   1   Delete any previously created file...
//*
//         SET DSN4CUST=SIMOTIME.DATA.QSAM080A
//QSAMDELT EXEC PGM=IEFBR14
//QSAM0080 DD  DSN=&DSN4CUST,
//             DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step   2   Create and populate a new QSAM file...
//*
//QSAMCRT1 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  DSN=SIMOTIME.PDS.PARMLIB(CUSR80D1),
//             DISP=SHR
//SYSUT2   DD  DSN=&DSN4CUST,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//


The COBOL Conversion Programs
(Next) (Previous) (Table-of-Contents)

This approach to data file conversion between EBCDIC and ASCII encoding schemas (or data formats) uses COBOL programs that do the data or record content conversion and the possible file format conversion (i.e. sequential file to VSAM, KSDS). This document focuses on the record content (or EBCDIC and ASCII) conversion task.

Convert EBCDIC Sequential File to ASCII
(Next) (Previous) (Table-of-Contents)

This program (CBLE2AC1.CBL) will read a record sequential (QSAM) EBCDIC file and write a record sequential (QSAM) ASCII file. This program may be compiled on an IBM Mainframe with ZOS or a Linux, UNIX or Linux System with Micro Focus COBOL.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CBLE2AC1.
       AUTHOR.        SIMOTIME ENTERPRISES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2012-01-02  Generation Time: 00:55:58:02    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     EBCFILE  SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  OUTPUT    ASCFILE  SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *                                                               *
      *            Translation Mode is EBCDIC to ASCII                *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT EBCFILE-FILE  ASSIGN TO       EBCFILE
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS EBCFILE-STATUS.
           SELECT ASCFILE-FILE  ASSIGN TO       ASCFILE
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS ASCFILE-STATUS.

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

       FD  ASCFILE-FILE
           DATA RECORD    IS ASCFILE-REC
           .
       01  ASCFILE-REC.
           05  ASCFILE-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 additional information contact SimoTime Enterprises.      *
      *                                                               *
      *        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 '* CBLE2AC1 '.
           05  T2 pic X(34) value 'Convert EBC to ASC for RSEQ-80/80 '.
           05  T3 pic X(10) value ' v11.05.02'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CBLE2AC1 '.
           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  EBCFILE-STATUS.
           05  EBCFILE-STATUS-L     pic X.
           05  EBCFILE-STATUS-R     pic X.
       01  EBCFILE-EOF              pic X       value 'N'.
       01  EBCFILE-OPEN-FLAG        pic X       value 'C'.

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

       01  EBCFILE-LRECL            pic 9(5)    value 00080.
       01  ASCFILE-LRECL            pic 9(5)    value 00080.
       01  EBCFILE-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-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* CBLE2AC1 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

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

       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 EBC to ASC for RSEQ-80/80 '.
           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  EBCFILE-TOTAL.
           05  EBCFILE-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for EBCFILE '.
       01  ASCFILE-TOTAL.
           05  ASCFILE-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for ASCFILE '.

      *****************************************************************
      * The following copy file contains the translation tables for   *
      * the ASCII and EBCDIC conversion. Sections of the tables may   *
      * also be used for case conversion.                             *
      *****************************************************************
       COPY ASCEBCB1.

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

           perform until EBCFILE-STATUS not = '00'
               perform EBCFILE-READ
               if  EBCFILE-STATUS = '00'
                   add 1 to EBCFILE-RDR
                   perform BUILD-OUTPUT-RECORD
                   perform ASCFILE-WRITE
                   if  ASCFILE-STATUS = '00'
                       add 1 to ASCFILE-ADD
                   end-if
               end-if
           end-perform

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

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

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

           perform ASCFILE-CLOSE
           perform EBCFILE-CLOSE
           GOBACK.

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

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

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

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

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

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

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2012-01-02  Generation Time: 00:55:58:07    *
      *****************************************************************

Convert ASCII Sequential File to EBCDIC
(Next) (Previous) (Table-of-Contents)

This program (CBLA2EC1.CBL) will read a record sequential (QSAM) ASCII file and write a record sequential (QSAM) EBCDIC file. This program may be compiled on an IBM Mainframe with ZOS or a Linux, UNIX or Linux System with Micro Focus COBOL.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CBLA2EC1.
       AUTHOR.        SIMOTIME ENTERPRISES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2012-01-02  Generation Time: 00:55:54:95    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     ASCFILE  SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  OUTPUT    EBCFILE  SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *                                                               *
      *            Translation Mode is ASCII to EBCDIC                *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT ASCFILE-FILE  ASSIGN TO       ASCFILE
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS ASCFILE-STATUS.
           SELECT EBCFILE-FILE  ASSIGN TO       EBCFILE
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS EBCFILE-STATUS.

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

       FD  EBCFILE-FILE
           DATA RECORD    IS EBCFILE-REC
           .
       01  EBCFILE-REC.
           05  EBCFILE-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 additional information contact SimoTime Enterprises.      *
      *                                                               *
      *        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 '* CBLA2EC1 '.
           05  T2 pic X(34) value 'Convert ASC to EBC for RSEQ-80/80 '.
           05  T3 pic X(10) value ' v11.05.02'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CBLA2EC1 '.
           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  ASCFILE-STATUS.
           05  ASCFILE-STATUS-L     pic X.
           05  ASCFILE-STATUS-R     pic X.
       01  ASCFILE-EOF              pic X       value 'N'.
       01  ASCFILE-OPEN-FLAG        pic X       value 'C'.

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

       01  ASCFILE-LRECL            pic 9(5)    value 00080.
       01  EBCFILE-LRECL            pic 9(5)    value 00080.
       01  ASCFILE-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-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* CBLA2EC1 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

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

       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 ASC to EBC for RSEQ-80/80 '.
           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  ASCFILE-TOTAL.
           05  ASCFILE-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for ASCFILE '.
       01  EBCFILE-TOTAL.
           05  EBCFILE-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for EBCFILE '.

      *****************************************************************
      * The following copy file contains the translation tables for   *
      * the ASCII and EBCDIC conversion. Sections of the tables may   *
      * also be used for case conversion.                             *
      *****************************************************************
       COPY ASCEBCB1.

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

           perform until ASCFILE-STATUS not = '00'
               perform ASCFILE-READ
               if  ASCFILE-STATUS = '00'
                   add 1 to ASCFILE-RDR
                   perform BUILD-OUTPUT-RECORD
                   perform EBCFILE-WRITE
                   if  EBCFILE-STATUS = '00'
                       add 1 to EBCFILE-ADD
                   end-if
               end-if
           end-perform

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

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

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

           perform EBCFILE-CLOSE
           perform ASCFILE-CLOSE
           GOBACK.

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

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

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

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

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

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

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2012-01-02  Generation Time: 00:55:54:98    *
      *****************************************************************

The ASCII and EBCDIC Tables
(Next) (Previous) (Table-of-Contents)

The following COBOL copy file (ASCEBCB1.CPY) contains the ASCII and EBCDIC tables. The tables may also be used to do case conversion.

      *****************************************************************
      *               ASCEBCB1.CPY - a COBOL Copy File                *
      *         Copyright (C) 1987-2013 SimoTime Enterprises          *
      *                     All Rights Reserved                       *
      *              Provided by SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * The following tables are used by the INSPECT statement to do  *
      * the conversion between EBCDIC and ASCII.                      *
      *   inspect FIELD-NAME converting EBCDIC-INFO to ASCII-INFO     *
      *   inspect FIELD-NAME converting ASCII-INFO  to EBCDIC-INFO    *
      *                                                               *
      * The tables may also be used to convert between lower and      *
      * upper case.                                                   *
      *   inspect FIELD-NAME converting EBCDIC-LOWER to EBCDIC-UPPER  *
      *   inspect FIELD-NAME converting ASCII-LOWER  to ASCII-UPPER   *
      *                                                               *
      * The tables include the alphabet for upper and lower case, the *
      * digits 0-9, the special characters (US) and the alternate     *
      * codes for A, E, I, O, and U with the appropriate acute,       *
      * grave, umlaut, circumflex and tilde.                          *
      * To display the alternate codes the Courier New (Fixed) or     *
      * Times New Roman (Proportional) font should be used.           *
      *                                                               *
      * SimoZAPS contains four tables that may be used for various    *
      * Upper/Lower Case or EBCDIC/ASCII conversion requirements.     *
      * ASCEBCB1.CPY - includes a full character set for the alphabet *
      *                (upper/lower case), digit, special characters  *
      *                and alternate codes for characters with the    *
      *                acute, grave, umlaut, tilde and circumflex.    *
      * ASCEBCB2.CPY - includes the character set for the translation *
      *                between EBCDIC/ASCII of signed/unsigned,       *
      *                zoned-decimal, numeric fields.                 *
      * ASCEBCB3.CPY - includes the character set for the alternate   *
      *                codes with the acute, grave, umlaut, tilde and *
      *                circumflex. This is primarily used for case    *
      *                conversion.                                    *
      * ASCEBCB4.CPY - includes the character set for the alphabet    *
      *                (upper/lower case), digit, special characters. *
      *                This is primarily used in the US where the     *
      *                alternate codes may not be required.           *
      *****************************************************************
      *
      *    ------------------------------------------------------------
      *    **  The EBCDIC Table ...
      *    **  01  EBCDIC space character     40
      *    **  02                             A B C D E F G H I
      *    **  03                             J K L M N O P Q R
      *    **  04                             S T U V W X Y Z
      *    **  05                             a b c d e f g h i
      *    **  06                             j k l m n o p q r
      *    **  07                             s t u v w x y z
      *    **  08                             0 1 2 3 4 5 6 7 8 9
      *    **  09                             . < ( + | & ! $ * )
      *    **  10                             ;5F - / , % _ > ? `
      *    **  11  7D/7F Single/Double quote  : # @7D =7F [ ] { }
      *    **  12                             \ ~ ^
       01  EBCDIC-DATA.
           05  EBCDIC-SPACE pic X     value X'40'.
           05  E-UPPER.
               10  EBCDIC-UPPER-CASE-USA.
                   15  filler  pic X(9)  value X'C1C2C3C4C5C6C7C8C9'.   A-I
                   15  filler  pic X(9)  value X'D1D2D3D4D5D6D7D8D9'.   J-R
                   15  filler  pic X(8)  value X'E2E3E4E5E6E7E8E9'.     S-Z
               10  E-UPPER-USA redefines EBCDIC-UPPER-CASE-USA
                               pic X(26).
               10  EBCDIC-UPPER-CASE-EXT.
                   15  filler  pic X(7)  value X'62636465666769'.       IN-AN
                   15  filler  pic X(8)  value X'7172737475767778'.     IN-EI
                   15  filler  pic X(5)  value X'EBECEDEEEF'.           IN-O
                   15  filler  pic X(6)  value X'FBFCFDFE9EAD'.         IN-UAEY
                   15  filler  pic X(2)  value X'6780'.                 IN-AO
                   15  filler  pic X     value X'68'.                   CEDILLA
               10  E-UPPER-EXT redefines EBCDIC-UPPER-CASE-EXT
                               pic X(29).
           05  EBCDIC-UPPER    redefines E-UPPER
                               pic X(55).
           05  E-LOWER.
               10  EBCDIC-LOWER-CASE-USA.
                   15  filler  pic X(9)  value X'818283848586878889'.   a-i
                   15  filler  pic X(9)  value X'919293949596979899'.   j-r
                   15  filler  pic X(8)  value X'A2A3A4A5A6A7A8A9'.     s-z
               10  E-LOWER-USA redefines EBCDIC-LOWER-CASE-USA
                               pic X(26).
               10  EBCDIC-LOWER-CASE-EXT.
                   15  filler  pic X(7)  value X'42434445464749'.       IN-an
                   15  filler  pic X(8)  value X'5152535455565758'.     IN-ei
                   15  filler  pic X(5)  value X'CBCCCDCECF'.           IN-o
                   15  filler  pic X(6)  value X'DBDCDDDE9C8D'.         IN-uaey
                   15  filler  pic X(2)  value X'4770'.                 IN-ao
                   15  filler  pic X     value X'48'.                   cedilla
               10  E-LOWER-EXT redefines EBCDIC-LOWER-CASE-EXT
                               pic X(29).
           05  EBCDIC-LOWER    redefines E-LOWER
                               pic X(55).
           05  EBCDIC-DIGITS.
               10  filler   pic X(10) value X'F0F1F2F3F4F5F6F7F8F9'.    0-9
           05  EBCDIC-SPECIAL.
               10  filler   pic X(8)  value X'4B4C4D4E4F505A5B'.        .<(+|&!$
               10  filler   pic X(8)  value X'5C5D5E5F60616B6C'.        *);¬-/,%
               10  filler   pic X(8)  value X'6D6E6F797A7B7C7D'.        _>?`:#@'
               10  filler   pic X(8)  value X'7E7FBABBC0D0E0A1'.        ="[]{}\~
               10  filler   pic X(6)  value X'4A6AB020B1B2'.            ˘¦^€ŁĄ
      *    **  EBCDIC-SPECIAL...
      *    **  X'4A' is US Cent Sign, X'6A' is two-piece vertical bar
      *    **  X'20' is Euro, X'B1' is British Pound, X'B2' is Yen
       01  E-INFO           redefines EBCDIC-DATA pic X(159).
       01  EBCDIC-TABLE     redefines EBCDIC-DATA.
           05  EBCDIC-BYTE  pic X     occurs 159 times.
      *
      *    ------------------------------------------------------------
      *    **  The ASCII Table ...
      *    **  01  ASCII space character      20
      *    **  02                             A B C D E F G H I
      *    **  03                             J K L M N O P Q R
      *    **  04                             S T U V W X Y Z
      *    **  05                             a b c d e f g h i
      *    **  06                             j k l m n o p q r
      *    **  07                             s t u v w x y z
      *    **  08                             0 1 2 3 4 5 6 7 8 9
      *    **  09                             . < ( + | & ! $ * )
      *    **  10                             ;5F - / , % _ > ? `
      *    **  11  27/22 Single/Double quote  : # @27 =22 [ ] { }
      *    **  12                             \ ~ ^
       01  ASCII-DATA.
           05  ASCII-SPACE  pic X     value X'20'.
           05  A-UPPER.
               10  ASCII-UPPER-CASE-USA.
                   15  filler  pic X(9)  value X'414243444546474849'.   A-I
                   15  filler  pic X(9)  value X'4A4B4C4D4E4F505152'.   J-R
                   15  filler  pic X(8)  value X'535455565758595A'.     S-Z
               10  A-UPPER-USA redefines ASCII-UPPER-CASE-USA
                               pic X(26).
               10  ASCII-UPPER-CASE-EXT.
                   15  filler  pic X(7)  value X'C2C4C0C1C3C5D1'.       IN-AN
                   15  filler  pic X(8)  value X'C9CACBC8CDCECFCC'.     IN-EI
                   15  filler  pic X(5)  value X'D4D6D2D3D5'.           IN-O
                   15  filler  pic X(6)  value X'DBDCD9DAC6DD'.         IN-UAEY
                   15  filler  pic X(2)  value X'C5D8'.                 IN-AO
                   15  filler  pic X     value X'C7'.                   CEDILLA
               10  A-UPPER-EXT redefines ASCII-UPPER-CASE-EXT
                               pic X(29).
           05  ASCII-UPPER     redefines A-UPPER
                               pic X(55).
           05  A-LOWER.
               10  ASCII-LOWER-CASE-USA.
                   15  filler  pic X(9)  value X'616263646566676869'.   a-i
                   15  filler  pic X(9)  value X'6A6B6C6D6E6F707172'.   j-r
                   15  filler  pic X(8)  value X'737475767778797A'.     s-z
               10  A-LOWER-USA redefines ASCII-LOWER-CASE-USA
                               pic X(26).
               10  ASCII-LOWER-CASE-EXT.
                   15  filler  pic X(7)  value X'E2E4E0E1E3E5F1'.       IN-a+
                   15  filler  pic X(8)  value X'E9E2E4E0EDEEEFEC'.     IN-ei
                   15  filler  pic X(5)  value X'F4F6F2F3F5'.           IN-o
                   15  filler  pic X(6)  value X'FBFCF9FAE6FD'.         IN-uaey
                   15  filler  pic X(2)  value X'E5F8'.                 IN-ao
                   15  filler  pic X     value X'E7'.                   cedilla
              10  A-LOWER-EXT redefines ASCII-LOWER-CASE-EXT
                               pic X(29).
           05  ASCII-LOWER     redefines A-LOWER
                               pic X(55).
           05  ASCII-DIGITS.
               10  filler   pic X(10) value X'30313233343536373839'.    0-9
           05  ASCII-SPECIAL.
               10  filler   pic X(8)  value X'2E3C282B7C262124'.        .<(+|&!$
               10  filler   pic X(8)  value X'2A293BAC2D2F2C25'.        *);¬-/,%
               10  filler   pic X(8)  value X'5F3E3F603A234027'.        _>?`:#@'
               10  filler   pic X(8)  value X'3D225B5D7B7D5C7E'.        ="[]{}\~
               10  filler   pic X(6)  value X'A2A65E80A3A5'.            ˘¦^€ŁĄ
      *    **  ASCII-SPECIAL...
      *    **  X'A2' is US Cent Sign, X'A6' is two-piece vertical bar
      *    **  X'80' is Euro, X'A3' is British Pound, X'A5' is Yen
       01  A-INFO           redefines ASCII-DATA pic X(159).
       01  ASCII-TABLE      redefines ASCII-DATA.
           05  ASCII-BYTE   pic X     occurs 159 times.
      *
      ***  ASCEBCB1 - End-of-Copy File - - - - - - - - - - - ASCEBCB1 *
      *****************************************************************
      *

Program Generation, Process Control File
(Next) (Previous) (Table-of-Contents)

The Data File Conversion programs are generated using the SimoTime Utility program (SimoZAPS) and a Process Control File. The following (CBLE2A01.PCF) shows the content of the Process Control File.

***********************************************************************
*                CBLE2A01.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*            (C) Copyright 1987-2013 All Rights Reserved              *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 is an EBCDIC-encoded Sequential File, 80-byte records.
* SYSUT2 is an ASCII-encoded Sequential File, 80-byte records.
***********************************************************************
&SIMOPREP  call ..\Env1Base
&USERPREP  call UserCONV
&CONFORM   IBM
&DIALECT   C2
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Convert EBC to ASC for RSEQ-80/80
&IOMODNAME CBLE2AC1
&SYSUT1    name=EBCFILE org=Sequential recfm=FIXED    rlen=80
&SYSUT2    name=ASCFILE org=Sequential recfm=FIXED    rlen=80
&TransMODE E2A
&TransINIT X'20'
&TRANSLATE FROM POS 1 LEN 80 TO POS 1 LEN 80
&END

Summary
(Next) (Previous) (Table-of-Contents)

The purpose of this document is to assist as a tutorial for new programmers or as a quick reference for experienced programmers. In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a choice of alternatives.

Software Agreement and Disclaimer
(Next) (Previous) (Table-of-Contents)

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

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

Downloads and Links to Similar Pages
(Next) (Previous) (Table-of-Contents)

This section includes links to documents with additional information that are beyond the scope and purpose of this document.

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 How to Generate a Data File Convert Program using simple specification statements in a Process Control File. 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.

Link to Internet   Link to Server   Explore How to Generate a Data File Compare Program using simple specification statements in a Process Control File. 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 comparison.

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

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

Downloads and Links, Internet Access Required
(Next) (Previous) (Table-of-Contents)

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 via Internet Connect for access to white papers, program examples and product information.

Explore The Micro Focus Web Site via Internet Connect for more information about products and services available from Micro Focus.

Glossary of Terms
(Next) (Previous) (Table-of-Contents)

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.

Comments, Suggestions or Feedback
(Next) (Previous) (Table-of-Contents)

This document was created and is copyrighted and maintained by SimoTime Enterprises.

If you have any questions, suggestions, comments or feedback please call or send an e-mail to: helpdesk@simotime.com

We appreciate hearing from you.

Company Overview
(Next) (Previous) (Table-of-Contents)

Founded in 1987, SimoTime Enterprises is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems.

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


Return-to-Top
File Conversion, ASCII and EBCDIC - QSAM and VSAM
Copyright © 1987-2013 SimoTime Enterprises  All Rights Reserved
When technology complements business
http://www.simotime.com