EBCDIC-Sequential to ASCII-Indexed
 COBOL Source To Create a Micro Focus File
When technology complements business    Copyright © 1987-2013  SimoTime Enterprises  All Rights Reserved
  Table of Contents Version 12.11.16 
  Introduction
  EBCDIC-Sequential to ASCII-Text (Sequential Add)
  The COBOL Source Code
  The Copy File for Tables
  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 that has been downloaded from a mainframe in EBCDIC format and write to an ASCII-Idexed file. The COBOL source code was generated using SimoZAPS, a product of SimoTime Enterprises. The SimoZAPS utility program also has the capability of reading, writing or converting between other file formats.

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

EBCDIC-Sequential to ASCII-Text (Sequential Add)
(Next) (Previous) (Table-of-Contents)

This program will read an EBCDIC, Sequential (QSAM) file and write an ASII-Indexed (VSAM, KSDS - Keyed Sequential Data Set) file. The keys must be in sequence (as defined by the ASCII collating sequence) for writing to the output file.

The sorting or collating sequence for ASCII and EBCDIC are different and produce different results. For example, with ASCII the numbers are sorted before the alphabet and with EBCDIC the numbers are sorted after the alphabet. If the key field is a combination of numeric and alphabetic characters it will probably be necessary to convert the EBCDIC-Sequential file to an ASCII-Sequential file, sort the ASCII-Sequential file and then convert the ASCII-Sequential file to an ASCII-Indexed file. Another alternative is to do an unordered load (or random-add) of the Indexed or KSDS file. This approach is slower than an ordered load but does allow for the key-fields to be added randomly to the indexed or KSDS file.

The COBOL Source Code
(Next) (Previous) (Table-of-Contents)

The following is the COBOL source code for the file conversion.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    ZAP002C1.
       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-04-16  Generation Time: 23:30:14:21    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     ZAP002D1 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  OUTPUT    ZAP002D2 INDEXED       VARIABLE   00256    00001   *
      *                                                       00006   *
      *                                                               *
      *            Translation Mode is EBCDIC to ASCII                *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT ZAP002D1-FILE  ASSIGN TO       ZAP002D1
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS ZAP002D1-STATUS.
           SELECT ZAP002D2-FILE  ASSIGN TO       ZAP002D2
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS ZAP002D2-PKEY-00001-00006
                  FILE STATUS   IS ZAP002D2-STATUS.

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

       FD  ZAP002D2-FILE
           DATA RECORD    IS ZAP002D2-REC
           .
       01  ZAP002D2-REC.
           05  ZAP002D2-PKEY-00001-00006        PIC X(00006).
           05  ZAP002D2-DATA-00007-00250        PIC X(00250).

      *****************************************************************
      * 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 '* ZAP002C1 '.
           05  T2 pic X(34) value 'Convert RSEQ-80-EBC to KSDS-ASC   '.
           05  T3 pic X(10) value ' v12.04.05'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* ZAP002C1 '.
           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  ZAP002D1-STATUS.
           05  ZAP002D1-STATUS-L     pic X.
           05  ZAP002D1-STATUS-R     pic X.
       01  ZAP002D1-EOF              pic X       value 'N'.
       01  ZAP002D1-OPEN-FLAG        pic X       value 'C'.

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

       01  ZAP002D1-LRECL            pic 9(5)    value 00080.
       01  ZAP002D2-LRECL            pic 9(5)    value 00256.
       01  ZAP002D1-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 '* ZAP002C1 '.
           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 'ZAP002C1'.

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

      *****************************************************************
      * 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 ZAP002D1-OPEN
           perform ZAP002D2-OPEN

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

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

           move ZAP002D2-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 ZAP002D2-CLOSE
           perform ZAP002D1-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *    TransMODE is E2A...
      *    TransLATE...
           move ZAP002D1-REC(00001:00080) to ZAP002D2-REC(00001:00080)
           inspect ZAP002D2-REC(1:80)      converting E-INFO to A-INFO
           exit.

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

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

The Copy File for 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.

      *****************************************************************
      *         Copyright (C) 1987-2011 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.
      **   End-of-Copy File -------------------------------- ASCEBCB1 *
      *****************************************************************
      *

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

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

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

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

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and/or QSAM files.

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

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

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

The following links will require an internet connect.

A good place to start is The SimoTime Home Page via Internet Connect for access to white papers, program examples and product information.

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

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

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

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
EBCDIC-Sequential to ASCII-Indexed
Copyright © 1987-2013 SimoTime Enterprises  All Rights Reserved
When technology complements business
http://www.simotime.com