EBCDIC to ASCII Convert
Customer File with Packed & Binary Data
  Table of Contents  v-16.01.01 - cuse2a01.htm 
  Introduction
  JCL Member
  CMD File
  The COBOL I/O Program
  The COBOL Conversion Routine
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This suite of sample programs describes how to convert an EBCDIC encoded VSAM Key-Sequenced-Data-Set (KSDS) to an ASCII encoded VSAM Key-Sequenced-Data-Set (KSDS). The SimoTime Utility program is used to accomplish this task. The utility program does not actually do the conversion. It generates two (2) COBOL programs that are capable of doing both file format and file content conversion.

The first program does the File I/O (i.e. file format conversion) of reading the EBCDIC encoded Customer Master File and writing the new ASCII encoded Customer Master File. The File I/O program calls the second program (i.e. file content conversion) to do the EBCDIC to ASCII conversion of the records within the file. The COBOL programs were generated by SimoTime technology using a COBOL copy file that defines the record layout. The generation of the programs is done on a Windows system running Micro Focus COBOL. However, since the generated COBOL source code is COBOL/390 compliant it may be compiled and executed on an IBM Mainframe, a Windows system with Micro Focus or a UNIX system with Micro Focus.

Note: For the Micro Focus environment the programs are normally compiled using a Mainframe dialect using he CHARSET(EBCDIC) or CHARSET(ASCII) compiler directives. If the programs are compiled using a non-Mainframe dialect the IBMCOMP directive must be used since the customer master file used in this example contains binary (or COMP) fields.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2017
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section JCL Member

The term Mainframe-Oriented refers to an actual IBM Mainframe, Micro Focus Mainframe Express or Micro Focus Enterprise Server with the Mainframe Transaction Option and the Batch Facility. The following (CUSE2AJ1.jcl) is a listing of the JCL member needed to run this job.

//CUSE2AJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CUSE2AJ1.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2017 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   -   Execute a COBOL program to read VSAM and write VSAM.
//* Author -   SimoTime Technologies
//* Date   -   January 01, 1997
//*
//* This COBOL program will read a VSAM, KSDS, EBCDIC, 512-byte,
//* record-length file and write a KSDS, VSAM ASCII-encoded data set.
//*
//*                     ************
//*                     * CUSE2AJ1 *
//*                     ********jcl*
//*                          *
//*                          *
//*    ************     ************     ************
//*    * CUS512KE *-----* CUSE2AIO *-----* CUS512KA *
//*    *******ksds*     ********cbl*     *******ksds*
//*                          *
//*                          *
//*                     ************
//*                     *   EOJ    *
//*                     ************
//*
//* *******************************************************************
//* Step 1 of 2, Delete/Define a VSAM Data Set.
//*
//CUCRTS01 EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
 DELETE    SIMOTIME.DATA.CUS512KA   -
           FILE (CUS512KA)          -
           PURGE                    -
           ERASE                    -
           CLUSTER
 SET       MAXCC = 0
 DEFINE    CLUSTER  (NAME(SIMOTIME.DATA.CUS512KA)             -
                    TRACKS(45,15)                             -
                    INDEXED)                                  -
           DATA     (NAME(SIMOTIME.DATA.CUS512KA.DAT)         -
                    KEYS(12,0)                                -
                    RECORDSIZE(512,512)                       -
                    FREESPACE(10,15)                          -
                    CISZ(8192))                               -
           INDEX    (NAME(SIMOTIME.DATA.CUS512KA.IDX))
//*
//* *******************************************************************
//* Step 2 of 2, Convert from EBCDIC-encoding to ASCII-encoding.
//*
//CUSE2AS1 EXEC PGM=CUSE2AIO
//STEPLIB  DD  DISP=SHR,DSN=SIMOTIME.DEMO.LOADLIB1
//CUS512KE DD  DISP=SHR,DSN=SIMOTIME.DATA.CUS512KE
//CUS512KA DD  DISP=SHR,DSN=SIMOTIME.DATA.CUS512KA
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section CMD File

The following is the Windows Command file (CUSE2AE1.cmd) that is needed to run this job as a batch task in a Micro Focus and Windows environment without Mainframe JCL emulation.

@echo OFF
rem  * *******************************************************************
rem  *               CUSE2AE1.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2017 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Read EBCDIC Customer Master, write ASCII Customer Master.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * The job will read an EBCDIC-encoded Customer Master File and write
rem  * write to a new ASCII-encoded Customer Master File.
rem  *
rem  *    ************
rem  *    * CUSE2AE1 *
rem  *    ********cmd*
rem  *         *
rem  *         *
rem  *    ************
rem  *    * Env1PROD *
rem  *    ********cmd*
rem  *         *
rem  *         *
rem  *    ************
rem  *    * SimoNOTE *
rem  *    ********cmd*
rem  *         *
rem  *         *
rem  *    ************
rem  *    *   RUN    *****************************
rem  *    ********rts*                           *
rem  *         *           ************     ************     ************
rem  *         *           * CUS512KE ******* CusE2AIO ******* CUS512KA *
rem  *         *           *******ksds*     ********cbl*     *******ksds*
rem  *         *                                 *
rem  *         *                            ************
rem  *         *                            * CusE2AR1 *
rem  *         *                            ********cbl*
rem  *    ************
rem  *    *   EOJ    *
rem  *    ************
rem  *
rem  * *******************************************************************
rem  * Step 1, Set Environment Variables
rem  *         Delete any previously created ASCII-encoded file...
rem  *
     call ..\Env1BASE
     set CmdName=CUSE2AE1
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%, User is %USERNAME%"
     call SimoNOTE "Identify JobStep Step-1, Housekeeping tasks"
     set CUS512KE=%BaseLib1%\DATA\Ebc1\CUS512KE.DAT
     set CUS512KA=%BaseLib1%\DATA\Wrk1\CUS512KA.DAT
     if exist %CUS512KA% del %CUS512KA%
rem  *
rem  * *******************************************************************
rem  * Step 2, Read EBCDIC-encoded KSDS, create a new ASCII-encoded KSDS
rem  *
     call SimoNOTE "Identify JobStep Step-2, Execute EBCDIC to ASCII Conversion"
     run CUSE2AIO
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
:EojAOK
     call SimoNOTE "DataTAKE - %CUS512KE%"
     call SimoNOTE "DataMAKE - %CUS512KA%"
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     echo %DATE% - %TIME% Starting User ABEND Processing...>>%SYSLOG%
     set >>%SYSLOG%
     echo %DATE% - %TIME% Complete User ABEND Processing...>>%SYSLOG%
     goto :End
:End
     call SimoNOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

Table of Contents Previous Section Next Section The COBOL I/O Program

The following (CUSE2AIO.cbl) is the COBOL I/O program that was generated with SimoTime technology. The program was tested using Micro Focus Enterprise Server on Windows/XP. The program were successfully executed in both an EBCDIC and ASCII encoded configuration.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CUSE2AIO.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2011-11-29  Generation Time: 17:02:00:85    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     CUSGETKE INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  OUTPUT    CUSPUTKA INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *                                                               *
      *            Translation Mode is EBCDIC to ASCII                *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT CUSGETKE-FILE  ASSIGN TO       CUSGETKE
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUSGETKE-PKEY-00001-00012
                  FILE STATUS   IS CUSGETKE-STATUS.
           SELECT CUSPUTKA-FILE  ASSIGN TO       CUSPUTKA
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUSPUTKA-PKEY-00001-00012
                  FILE STATUS   IS CUSPUTKA-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  CUSGETKE-FILE
           DATA RECORD    IS CUSGETKE-REC
           .
       01  CUSGETKE-REC.
           05  CUSGETKE-PKEY-00001-00012        PIC X(00012).
           05  CUSGETKE-DATA-00013-00500        PIC X(00500).

       FD  CUSPUTKA-FILE
           DATA RECORD    IS CUSPUTKA-REC
           .
       01  CUSPUTKA-REC.
           05  CUSPUTKA-PKEY-00001-00012        PIC X(00012).
           05  CUSPUTKA-DATA-00013-00500        PIC X(00500).

      *****************************************************************
      * This program was created with the SYSMASK3.TXT file as the    *
      * template for the File I/O. It is intended for use with the    *
      * TransCALL facility that makes a call to a routine that does   *
      * the actual conversion between EBCDIC and ASCII. For more      *
      * information or questions contact SimoTime Technologies.       *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      * The SYSMASK3 provides for the sequential reading of the input *
      * file and the sequential writing of the output file.           *
      *                                                               *
      * This program mask is used with a callable subroutine that     *
      * will do ASCII/EBCDIC Conversion based on a COBOL Copy 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.                                          *
      *                                                               *
      * If the key field is not in sequence then refer to SYSMASK4    *
      * to provide for a random add or update of the indexed file.    *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CUSE2AIO '.
           05  T2 pic X(34) value 'Read EBCDIC/KSDS, Load ASCII/KSDS '.
           05  T3 pic X(10) value ' v10.07.06'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CUSE2AIO '.
           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  CUSGETKE-STATUS.
           05  CUSGETKE-STATUS-L     pic X.
           05  CUSGETKE-STATUS-R     pic X.
       01  CUSGETKE-EOF              pic X       value 'N'.
       01  CUSGETKE-OPEN-FLAG        pic X       value 'C'.

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

       01  CUSGETKE-LRECL            pic 9(5)    value 00512.
       01  CUSPUTKA-LRECL            pic 9(5)    value 00512.

      *****************************************************************
      * 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 '* CUSE2AIO '.
           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 'CUSE2AIO'.

       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   'Read EBCDIC/KSDS, Load ASCII/KSDS '.
           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  CUSGETKE-TOTAL.
           05  CUSGETKE-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for CUSGETKE'.
       01  CUSPUTKA-TOTAL.
           05  CUSPUTKA-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for CUSPUTKA'.

      *****************************************************************
       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 CUSGETKE-OPEN
           perform CUSPUTKA-OPEN

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

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

           move CUSPUTKA-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 CUSPUTKA-CLOSE
           perform CUSGETKE-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *>   TransMODE is E2A...
      *>   TransCALL process...
           move CUSGETKE-REC to CUSPUTKA-REC
           call 'CUSE2AR1'                        using CUSPUTKA-REC
           add 00512 to ZERO giving CUSPUTKA-LRECL
           exit.

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

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       CUSPUTKA-WRITE.
           if  CUSPUTKA-OPEN-FLAG = 'C'
               perform CUSPUTKA-OPEN
           end-if
           write CUSPUTKA-REC
           if  CUSPUTKA-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  CUSPUTKA-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 CUSPUTKA' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUSPUTKA-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       CUSPUTKA-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT CUSPUTKA-FILE
           if  CUSPUTKA-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to CUSPUTKA-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with CUSPUTKA' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUSPUTKA-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       CUSPUTKA-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close CUSPUTKA-FILE
           if  CUSPUTKA-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to CUSPUTKA-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with CUSPUTKA' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUSPUTKA-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 Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2011-11-29  Generation Time: 17:02:00:88    *
      *****************************************************************

Table of Contents Previous Section Next Section The COBOL Conversion Routine

The following (CUSE2AR1.cbl) is a COBOL program that converts a record based on the record layout defined in a COBOL copy file. The program was tested using Micro Focus Enterprise Server on Windows/XP. The program were successfully executed in both an EBCDIC and ASCII encoded configuration.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CUSE2AR1.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This routine was generated by SimoREC1              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *  Generation Date: 2011/11/29  Generation Time: 17:02:01:19    *
      *****************************************************************
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  IX-1  PIC 9(5) VALUE 0.
       01  RM-1  PIC 9(5) VALUE 0.
       01  RO-1  PIC 9(5) VALUE 0.
       01  IX-2  PIC 9(5) VALUE 0.
       01  RM-2  PIC 9(5) VALUE 0.
       01  RO-2  PIC 9(5) VALUE 0.

       COPY ASCEBCB1.
       COPY ASCEBCB2.

      *****************************************************************
       LINKAGE SECTION.
       COPY CUSTCB01.

      *****************************************************************
       PROCEDURE DIVISION using CUST-RECORD.
           inspect CUST-NUMBER              converting E-INFO to A-INFO
           inspect CUST-STATUS              converting E-INFO to A-INFO
           inspect CUST-LAST-NAME           converting E-INFO to A-INFO
           inspect CUST-FIRST-NAME          converting E-INFO to A-INFO
           inspect CUST-MID-NAME            converting E-INFO to A-INFO
           inspect CUST-ADDRESS-1           converting E-INFO to A-INFO
           inspect CUST-ADDRESS-2           converting E-INFO to A-INFO
           inspect CUST-CITY                converting E-INFO to A-INFO
           inspect CUST-STATE               converting E-INFO to A-INFO
           inspect CUST-POSTAL-CODE         converting E-INFO to A-INFO
           inspect CUST-PHONE-HOME          converting E-INFO to A-INFO
           inspect CUST-PHONE-WORK          converting E-INFO to A-INFO
           inspect CUST-PHONE-CELL          converting E-INFO to A-INFO
      *    Packed......... CUST-CREDIT-LIMIT
      *    Group10 CUST-DISCOUNT                     occurs 00003 times
      *    Group  00015
      *    Table Name..... CUST-DISCOUNT-CODE
      *    Binary......... CUST-DISCOUNT-CODE
      *    Table Name..... CUST-DISCOUNT-RATE
           add 0000306 to ZERO giving RM-1
           add 0000015 to ZERO giving RO-1
           perform 00003 times
             inspect CUST-RECORD(RM-1:00005)
                                            converting E-NUMB to A-NUMB
             add RO-1 to RM-1
           end-perform
      *    Table Name..... CUST-DISCOUNT-DATE
           add 1 to ZERO giving IX-1
           perform 00003 times
             inspect CUST-DISCOUNT-DATE(IX-1)
                                            converting E-INFO to A-INFO
             add 1 to IX-1
           end-perform
      *    Group10                                          End-Group10
           inspect CUST-LADATE              converting E-INFO to A-INFO
           inspect CUST-LATIME              converting E-INFO to A-INFO
      *    Decimal........ CUST-TOKEN
           inspect CUST-RECORD(365:3)       converting E-NUMB to A-NUMB
      *    Filler......... A Non-Unique Reference to a Data Item
           inspect CUST-RECORD(368:145)     converting E-INFO to A-INFO
           GOBACK.
      *****************************************************************
      *           This routine was generated by SimoREC1              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *  Generation Date: 2011/11/29  Generation Time: 17:02:01:19    *
      *****************************************************************

Table of Contents Previous Section Next Section Summary

The purpose of this program is to provide an example of how to convert an EBCDIC-encoded Indexed file to an ASCII-encoded Indexed file and maintain mainframe numeric integrity. This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives.

The documentation and software were developed and tested on systems that are configured for a SimoTime environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SimoTime Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SimoTime Services or Technologies please send an e-mail to: helpdesk@simotime.com or call 415 883-6565. We appreciate hearing from you.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

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

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

Table of Contents Previous Section Next Section Downloads and Links

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

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

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

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

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

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

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.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

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

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Comments or Feedback

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

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.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions or need assistance with converting non-relational data structures simply give us a call at 415 883-6565 or check the web site at http://www.simotime.com


Return-to-Top
EBCDIC to ASCII Conversion, Customer Master File with Packed and Binary Data
Copyright © 1987-2017
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com