EBCDIC to ASCII Conversion
When technology complements business   Customer Master File
Copyright © 1987-2008  SimoTime Enterprises, LLC  All Rights Reserved http://www.simotime.com

 
Introduction Version 06.11.01
  JCL Member for a Mainframe-Oriented Environment
  CMD File for the Micro Focus & Windows Environment
  The COBOL I/O Program
  The COBOL Conversion Routine
  Summary
 
  Software Agreement and Disclaimer
  Downloads and Links to Similar Pages
  Glossary of Terms
  Comments or Suggestions
  About SimoTime

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

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.

JCL Member for a Mainframe-Oriented Environment
(Next) (Previous) (Table-of-Contents)

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
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2007 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 Enterprises
//* 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*
//*                          *
//*                          *
//*    ************     ************     ************
//*    * CUSTEBC1 *-----* CUSE2AC1 *-----* CUSTASC1 *
//*    *******ksds*     ********cbl*     *******ksds*
//*                          *
//*                          *
//*                     ************
//*                     *   EOJ    *
//*                     ************
//*
//* *******************************************************************
//* Step   1   This is a single step job.
//*
//CUCRTS01 EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
 DEFINE    CLUSTER  (NAME(SIMOTIME.DATA.CUSTASC1)             -
                    TRACKS(45,15)                             -
                    INDEXED)                                  -
           DATA     (NAME(SIMOTIME.DATA.CUSTASC1.DAT)         -
                    KEYS(12,0)                                -
                    RECORDSIZE(512,512)                       -
                    FREESPACE(10,15)                          -
                    CISZ(8192))                               -
           INDEX    (NAME(SIMOTIME.DATA.CUSTASC1.IDX))
//* *******************************************************************
//* Step   2   This is a single step job.
//*
//CUSE2AS1 EXEC PGM=CUSE2AC1
//STEPLIB  DD  DISP=SHR,DSN=SIMOTIME.DEMO.LOADLIB1
//CUSTEBC1 DD  DISP=SHR,DSN=SIMOTIME.DATA.CUSTMAST
//CUSTASC1 DD  DISP=SHR,DSN=SIMOTIME.DATA.CUSTASC1
//*

CMD File for the Micro Focus & Windows Environment
(Next) (Previous) (Table-of-Contents)

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  *                   This program is provided by:                    *
rem  *                    SimoTime Enterprises, LLC                      *
rem  *           (C) Copyright 1987-2008 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 Enterprises
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  *         *           * CUSTEBC1 ******* CusE2AC1 ******* CUSTASC1 *
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 Env1PROD
     set CmdName=CUSE2AE1
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%, User is %USERNAME%"
     call SimoNOTE "Identify JobStep Step-1, Housekeeping tasks"
     set CustEBC1=%BaseLib1%\DataLibA\Ebc1\CUSTMAST.DAT
     set CustASC1=%BaseLib1%\DataLibA\Wrk1\CUSTASC1.DAT
     if exist %CustASC1% del %CustASC1%
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 CUSE2AC1
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
:EojAOK
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     echo %DATE% - %TIME% Starting User ABEND Processing...>>%SYSLOG%
     set >>%SYSLOG%
     echo %DATE% - %TIME% Complete User ABEND Processing...>>%SYSLOG%
     goto :End
:End
     call SimoNOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

The COBOL I/O Program
(Next) (Previous) (Table-of-Contents)

The following (CUSE2AC1.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.    CUSE2AC1.
       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: 2007-02-22  Generation Time: 00:18:34:01    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     CUSTEBC1 INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *  OUTPUT    CUSTASC1 INDEXED       VARIABLE   00512    00001   *
      *                                              00512    00012   *
      *                                                               *
      *                Translation Mode is UNKNOWN                    *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT CUSTEBC1-FILE  ASSIGN TO       CUSTEBC1
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUSTEBC1-KEY-01
                  FILE STATUS   IS CUSTEBC1-STATUS.
           SELECT CUSTASC1-FILE  ASSIGN TO       CUSTASC1
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUSTASC1-KEY-01
                  FILE STATUS   IS CUSTASC1-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  CUSTEBC1-FILE
           DATA RECORD    IS CUSTEBC1-REC
           .
       01  CUSTEBC1-REC.
           05  CUSTEBC1-KEY-01  PIC X(00012).
           05  CUSTEBC1-DATA-01 PIC X(00500).

       FD  CUSTASC1-FILE
           DATA RECORD    IS CUSTASC1-REC
           .
       01  CUSTASC1-REC.
           05  CUSTASC1-KEY-01  PIC X(00012).
           05  CUSTASC1-DATA-01 PIC X(00500).

      *****************************************************************
      * This program was created using 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.                                          *
      *                                                               *
      * 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 '* CUSE2AC1 '.
           05  T2 pic X(34) value 'Data Migration and Conversion     '.
           05  T3 pic X(10) value 'v06.01.01 '.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CUSE2AC1 '.
           05  C2 pic X(20) value 'Created by SimoZAPS,'.
           05  C3 pic X(20) value '  a utility package '.
           05  C4 pic X(28) value 'of SimoTime Enterprises, LLC'.

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

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

       01  CUSTEBC1-LRECL    pic 9(5)    value 00512.
       01  CUSTASC1-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 '* CUSE2AC1 '.
           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 'CUSE2AC1'.

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

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


      *****************************************************************
       PROCEDURE DIVISION.
           perform Z-POST-COPYRIGHT
           perform CUSTEBC1-OPEN
           perform CUSTASC1-OPEN

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

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

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

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

           perform CUSTASC1-CLOSE
           perform CUSTEBC1-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *>   TransCALL process...
           move CUSTEBC1-REC to CUSTASC1-REC
           call 'CUSE2AR1'                        using CUSTASC1-REC
           add 00512 to ZERO giving CUSTASC1-LRECL
           exit.

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

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

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

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 ENTERPRISES.
      *****************************************************************
      *           This routine was generated by SimoREC1              *
      *             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: 2007/02/16  Generation Time: 21:37:08:03    *
      *****************************************************************
       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
      *    Table   CUST-DISCOUNT-CODE
      *    Binary  CUST-DISCOUNT-CODE
      *    Table   CUST-DISCOUNT-RATE
           add 0000306 to ZERO giving RM-1
           add 0000000 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   CUST-DISCOUNT-DATE
           perform varying IX-1 from 1 by 1 until IX-1 > 00003
             inspect CUST-DISCOUNT-DATE(IX-1)
                                            converting E-INFO to A-INFO
           end-perform
           inspect CUST-LADATE              converting E-INFO to A-INFO
           inspect CUST-LATIME              converting E-INFO to A-INFO
           inspect CUST-TOKEN               converting E-INFO to A-INFO
      *    Filler  A Non-Unique Reference to a Data Item
           inspect CUST-RECORD(368:145)     converting E-INFO to A-INFO
           GOBACK.

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

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.

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

Permission to use, copy, modify and distribute this software for any commercial purpose requires a fee to be paid to Simotime Enterprises. Once the fee is received by SimoTime the latest version of the software 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.

Permission to use, copy, modify and distribute this software for a non-commercial purpose and without fee is hereby granted, 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 for any purpose. It is provided "AS IS" without any express 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.

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

This suite of programs is part of the File Maintenance package for the Customer Master File. You may download this at http://www.simotime.com/sim4dzip.htm#cumast01 or view the complete list of SimoTime Examples at http://www.simotime.com/sim4dzip.htm .

Note: You must be attached to the Internet to download a Z-Pack or view the list.

The SimoZAPS Utility Program has the capability of generating a COBOL program that will do the conversion of sequential and VSAM (KSDS) files between EBCDIC and ASCII. SimoZAPS can also read a sequential file in EBCDIC format and create an ASCII/CRLF file or VSAM KSDS file in ASCII format. The conversion tables may be viewed or modified to meet unique requirements. The Hexcess/2 function provides the capability of viewing, finding or patching the contents of a file in hexadecimal.

This item will provide a link to  an ASCII or EBCDIC translation table. A column for decimal, hexadecimal and binary is also included.

Check out  The VSAM - QSAM Connection  for more examples of mainframe VSAM and QSAM accessing techniques and sample code.

This document provides a quick summary of the  File Status Key  for VSAM data sets and QSAM files.

To review all the information available on this site start at  The SimoTime Home Page .

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 or Suggestions
(Next) (Previous) (Table-of-Contents)

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

We appreciate your comments and feedback.

About SimoTime Enterprises, LLC
(Next) (Previous) (Table-of-Contents)

Founded in 1987, SimoTime Enterprises is a privately owned, Limited Liability Corporation located in Novato, California. 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 complimentary 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
Copyright © 1987-2008 SimoTime Enterprises, LLC  All Rights Reserved
When technology complements business
http://www.simotime.com
Version 06.11.01