Hex-Dump using COBOL
Input is a VSAM Data Set
  Table of Contents  v-16.01.01 - simhex01.htm 
  Introduction
  Sample Output
  Program Description
  CMD for Hex Dump Execution
  JCL for Hex Dump Execution
  The COBOL Source Members
  The Test Program
  Hexadecimal Table, a Copy File
  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 sample program is written entirely in COBOL and will run as an MVS batch job on an IBM mainframe or as a project with Micro Focus Mainframe Express (MFE) running on a PC with Windows.

This example illustrates the following functions.

1 Describe how to read a VSAM, KSDS Data Set (Keyed Sequential Data Set).
2 Describe how to translate each character within a record to it's two-byte hexadecimal equivalent and display the information.
3 Describe how to display the hexadecimal values on the screen and write the hexadecimal values to a log file.
4 Provide an example of mainframe JCL to run the job on the mainframe or the PC using MFE.
  How to Produce a Hex-Dump of Records in a VSAM Data Set

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

Table of Contents Previous Section Next Section Sample Output

The 1st line is a header that shows the position of each byte within the record. The 2nd line (or Blue line) shows the possible EBCDIC translation for print or display. The 3rd and 4th lines show the hexadecimal dump information with the left-most nibble above the right-most nibble. The 5th line (or Red line) shows the possible ASCII translation for print or display.

The following shows the sample output from a mainframe, EBCDIC encoded data set.

....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
000100 Anderson            Adrian    111 Peachtree Plaza      Atlanta         GA
FFFFFF4C9889A99444444444444C898894444FFF4D8888A9884D98A8444444CA989A8444444444CC
00010001545926500000000000014991500001110751383955073191000000133153100000000071
......@........@@@@@@@@@@@@......@@@@...@.........@.....@@@@@@.......@@@@@@@@@..

The following shows the sample output from a PC, ASCII encoded data file.

....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
........>....?>................/>........&./.......&%/:/........%/>./...........
33333324666776622222222222246766622223332566667766256676222222476667622222222244
00010001E4523FE00000000000014291E0000111005138425500C1A100000014C1E4100000000071
000100 Anderson            Adrian    111 Peachtree Plaza      Atlanta         GA

Table of Contents Previous Section Next Section Program Description

The following diagram is an overview of the processing logic for the HEX-Dump demonstration program.

             
Entry Point
ZOS
Entry Point
Windows
   
   
SIMHEXJ1
jcl
SIMHEXE1
cmd
Start the Hex-Dump example
   
   
IEFBR14
Utility
IF Exist
statement
Delete previously created right-adjust output file
   
   
 
 
   
   
 
 
   
   
VKSD0080
ksds
 
 
SIMHEXC1
cbl
 
 
QSAMHEXW
rseq
Read a VSAM data set and create a QSAM file with HEX Dump information.
   
EOJ
End-Of-Job
 
Overview of Hex-Dump Example for a VSAM Data Set (KSDS)

The main program (SIMHEXC1) will read a VSAM data set and produce and 80-byte, fixed record length QSAM file. The contents of this file will be the HEX Dump information for the VSAM file. The source code for the JCL and the COBOL program are provided and may be modified to fit your environment.

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using the Mainframe and Micro Focus Enterprise Server/Studio (or Micro Focus Mainframe Express). The  light-red  boxes are unique to the SIMOTIME Technologies using a Linux, UNIX or Windows System and COBOL Technologies such as Micro Focus. The  light-yellow  boxes are SIMOTIME Technologies, Third-party Technologies, decision points or program transitions in the processing logic or program generations. The  light-blue  boxes identify the input/output data structures such as Documents, Spreadsheets, Data Files, VSAM Data Sets or Relational Tables. The  light-gray  boxes identify a system function or information item.

Table of Contents Previous Section Next Section CMD for Hex Dump Execution

The following (SIMHEXE1.cmd) is a sample of a Windows Command file needed to run this program as a batch job.

@echo OFF
rem  * *******************************************************************
rem  *               SIMHEXE1.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 an indexed file and write a file of HEX-Dump info.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This is a sample program that shows proper coding for hexadecimal
rem  * values. This program reads an 80-byte, EBCDIC, KSDS, VSAM data
rem  * set. It displays hexadecimal dump information to the console. The
rem  * hexadecimal dump information is also written to a QSAM file.
rem  *
rem  * This set of programs will run on a mainframe under MVS or on a
rem  * Personal Computer with Windows and Micro Focus Net Express.
rem  *
rem  *    ************
rem  *    * SimHexE1 *
rem  *    ********cmd*
rem  *         *
rem  *         *
rem  *    ************     ************     ************
rem  *    * SimoEXEC ******* SIMOLOGS ******* CONSOLE  *
rem  *    ********cbl*  *  ********cbl*  *  ************
rem  *         *        *                *
rem  *         *        *                *  ************
rem  *         *        *                ****  SYSLOG  *
rem  *         *        *                   ********txt*
rem  *         *        *
rem  *         *        **************************
rem  *         *                                 *
rem  *         *           ************     ************     ************
rem  *         *           * VKSD0080 ******* SimHexC1 ******* QSAMHEXW *
rem  *         *           ********idx*     ********cbl*     ********txt*
rem  *         *
rem  *    ************
rem  *    *   EOJ    *
rem  *    ************
rem  *
rem  * *******************************************************************
rem  * Step   1   Delete any previously created file...
rem  *
     set CmdName=SIMHEXE1
     call ..\ENV1BASE
rem  *
     call SimoNOTE "*******************************************************%CmdName%.cmd"
     call SimoNOTE "Starting JobName %CmdName%, User is %USERNAME%"
:DeleteQSAM
     call SimoNOTE "Identify JobStep DeleteQSAM"
     set VKSD0080=%BaseLib1%\DATA\Asc1\SIMOTIME.DATA.CUST0080.DAT
     set QSAMHEXW=%BaseLib1%\DATA\Wrk1\QSAMHEXB.DAT
     if exist %QSAMHEXW% del %QSAMHEXW%
rem  *
rem  * *******************************************************************
rem  * Step   2   Edit input, create a new output file...
rem  *
:ExecuteHexDump Routine
     call SimoNOTE "Identify JobStep ExecuteHexDumpRoutine"
     run SimoEXEC EXEC SIMHEXC1 PARM=B
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
     if not exist %QSAMHEXW% set JobStatus=0020
     if not "%JobStatus%" == "0000" goto :EojNOK
:EojAOK
     call SimoNOTE "DataTake, ASCII/KSDS Input File %VKSD0080%"
     call SimoNOTE "DataMake, A HexDump Output File %QSAMHEXW%"
     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 JCL for Hex Dump Execution

The following (SIMHEXJ1.jcl) is a sample of the mainframe JCL needed to execute this sample program as part of a batch job

//SIMHEXJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       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   - Do a HEX dump to a QSAM file of a VSAM Data Set.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* This is a sample program that shows proper coding for hexadecimal
//* values. This program reads an 80-byte, KSDS, VSAM data set.
//* It displays hexadecimal dump information to the console. The
//* hexadecimal dump information is also written to a QSAM file.
//*
//* The DD statement for SYSOUT is required by this example. The
//* COBOL program may be compiled using the SYSOUT directive and
//* without the DD statement for SYSOUT an RTS173 or RTS227 may occur.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//*                      ************
//*                      * SIMHEXJ1 *
//*                      ********jcl*
//*                           *
//*                           *
//*                      ************     ************
//*                      * IEFBR14  ******* QSAMHEXW *
//*                      ********utl*     ***delete***
//*                           *
//*                           *
//*     ************     ************     ************
//*     * VKSD0080 ******* SIMHEXC1 ******* QSAMHEXW *
//*     *******ksds*     ********cbl*     *******qsam*
//*                           *
//*                           *
//*                      ************
//*                      *   EOJ    *
//*                      ************
//*
//* *******************************************************************
//* Step   1 of 4  This job step will delete a previously created
//*        hex-dump file.
//*
//DELTHEX1 EXEC PGM=IEFBR14
//QSAMHEXE DD  DSN=SIMOTIME.DATA.QSAMHEXE,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//QSAMHEXB DD  DSN=SIMOTIME.DATA.QSAMHEXB,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//QSAMHEXA DD  DSN=SIMOTIME.DATA.QSAMHEXA,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step   2 of 4  This job step will read the VSAM, KSDS data set and
//*        write the hex-dump information to the QSAM file.
//*        The PARM-E will display the possible EBCDIC characters
//*        on row 1 above the two hex-dump rows.
//*
//EXECHEX2 EXEC PGM=SIMHEXC1,PARM=E
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//QSAMHEXW DD  DSN=SIMOTIME.DATA.QSAMHEXE,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//VKSD0080 DD  DSN=SIMOTIME.DATA.VKSD0080,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//*
//* *******************************************************************
//* Step   3 of 4  This job step will read the VSAM, KSDS data set and
//*        write the hex-dump information to the QSAM file.
//*        The PARM-A will display the possible ASCII characters
//*        on row 3 below the two hex-dump rows.
//*
//EXECHEX3 EXEC PGM=SIMHEXC1,PARM=A
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//QSAMHEXW DD  DSN=SIMOTIME.DATA.QSAMHEXA,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//VKSD0080 DD  DSN=SIMOTIME.DATA.VKSD0080,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//*
//* *******************************************************************
//* Step   4 of 4  This job step will read the VSAM, KSDS data set and
//*        write the hex-dump information to the QSAM file.
//*        The PARM-B will display the possible EBCDIC characters
//*        on row 1 above the two hex-dump rows and the possible
//*        ASCII characters on row 4 below the two hex-dump rows.
//*
//EXECHEX4 EXEC PGM=SIMHEXC1,PARM=B
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//QSAMHEXW DD  DSN=SIMOTIME.DATA.QSAMHEXB,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//VKSD0080 DD  DSN=SIMOTIME.DATA.VKSD0080,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//*

This job may be executed on the mainframe as an MVS batch job. It may also be executed on the PC running the Micro Focus Mainframe Express product. The JOB and DD statements will require modification prior to execution on a mainframe.

Table of Contents Previous Section Next Section The COBOL Source Members

The following items are the COBOL source members used in this suite of programs.

Table of Contents Previous Section Next Section The Test Program

The following (SIMHEXC1.cbl) is a sample of the mainframe COBOL demonstration program.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    SIMHEXC1.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      * Copyright (C) 1987-2017 SimoTime Technologies.                *
      *                                                               *
      * All rights reserved.  Unpublished, all rights reserved under  *
      * copyright law and international treaty.  Use of a copyright   *
      * notice is precautionary only and does not imply publication   *
      * or disclosure.                                                *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any commercial purpose requires a fee to be paid to       *
      * SimoTime Technologies. 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           *
      * Technologies.                                                 *
      *                                                               *
      * Permission to use, copy and modify this software for any      *
      * 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           *
      * Technologies.                                                 *
      *                                                               *
      * SimoTime Technologies makes no warranty or representations    *
      * about the suitability of the software 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                                  *
      *                                                               *
      * SimoTime Technologies                                         *
      * 15 Carnoustie Drive                                           *
      * Novato, CA 94949-5849                                         *
      * 415.883.6565                                                  *
      *                                                               *
      * RESTRICTED RIGHTS LEGEND                                      *
      * Use, duplication, or disclosure by the Government is subject  *
      * to restrictions as set forth in subparagraph (c)(1)(ii) of    *
      * the Rights in Technical Data and Computer Software clause at  *
      * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of          *
      * Commercial  Computer Software - Restricted Rights  at 48      *
      * CFR 52.227-19, as applicable.  Contact SimoTime Technologies, *
      * 15 Carnoustie Drive, Novato, CA 94949-5849.                   *
      *                                                               *
      *****************************************************************
      *      This program is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * Source Member: SIMHEXC1.CBL
      * Copy Files:    HEXTABLE.CPY
      *****************************************************************
      *
      *>SIMHEXC1 - Execute SIMHEXC1 to read a VSAM, KSDS Data Set.
      *
      *
      * DESCRIPTION
      * -----------
      * This program will will read a KSDS, VSAM file and display a
      * HEX-Dump to the console. It will also write the HEX-Dump
      * information to a sequential, QSAM file.
      *
      *****************************************************************
      *
      * MAINTENANCE
      * -----------
      * 1996/03/15 Simmons, Created program.
      * 1996/03/15 Simmons, No changes to date.
      *
      *****************************************************************
      *
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT   SECTION.
       FILE-CONTROL.
      *
      *****************************************************************
      *
           SELECT VKSD0080-FILE
               ASSIGN       to VKSD0080
               ORGANIZATION is indexed
               ACCESS MODE  is SEQUENTIAL
               RECORD KEY   is VKSD0080-KEY
               FILE STATUS  is VKSD0080-STATUS.
           SELECT QSAMHEXW-FILE
               ASSIGN       to QSAMHEXW
               ORGANIZATION is SEQUENTIAL
               ACCESS MODE  is SEQUENTIAL
               FILE STATUS  is QSAMHEXW-STATUS.

       DATA DIVISION.
       FILE SECTION.
      *
      *****************************************************************
      *
       FD  VKSD0080-FILE.

       01  VKSD0080-RECORD.
           02  VKSD0080-KEY       pic X(6).
           02  VKSD0080-DATA      pic X(74).
      *
      *****************************************************************
      *
       FD  QSAMHEXW-FILE.
       01  QSAMHEXW-RECORD.
           02  QSAMHEXW-KEY       pic X(6).
           02  QSAMHEXW-DATA      pic X(74).

       WORKING-STORAGE SECTION.
      *****************************************************************
      *    Data-structure for Title and Copyright...
      *    ------------------------------------------------------------
       01  SIM-TITLE.
           05  T1 pic X(11) value '* SIMHEXC1 '.
           05  T2 pic X(34) value 'HEXadecimal Dump of VSAM Data Set '.
           05  T3 pic X(10) value ' v07.10.15'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* SIMHEXC1 '.
           05  C2 pic X(20) value 'Copyright 1987-2017 '.
           05  C3 pic X(28) value '   SimoTime Technologies    '.
           05  C4 pic X(20) value ' All Rights Reserved'.

       01  SIM-THANKS-01.
           05  C1 pic X(11) value '* SIMHEXC1 '.
           05  C2 pic X(32) value 'Thank you for using this program'.
           05  C3 pic X(32) value ' provided from SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* SIMHEXC1 '.
           05  C2 pic X(32) value 'Please send all inquires or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

       01  VKSD0080-STATUS.
           05  VKSD0080-STAT1      pic X.
           05  VKSD0080-STAT2      pic X.

       01  QSAMHEXW-STATUS.
           05  QSAMHEXW-STAT1      pic X.
           05  QSAMHEXW-STAT2      pic X.

      *****************************************************************
      * The following buffers are used to create a four-byte numeric  *
      * file status code that may be displayed.                       *
      *****************************************************************
       01  IO-STATUS.
           05  IO-STAT1            pic X.
           05  IO-STAT2            pic X.
       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.
       01  IO-STATUS-04.
           05  IO-STATUS-0401      pic 9     value 0.
           05  IO-STATUS-0403      pic 999   value 0.

       01  END-OF-FILE             pic X(3)  value 'NO '.

       01  IO-STATUS-MESSAGE.
           05  filler              pic X(15) value 'File Status is '.
           05  IO-STATUS-DISPLAY   pic X(4)  value 'nnnn'.

      *****************************************************************
      *    Buffer used for posting messages to the console.
      *    ------------------------------------------------------------
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* SIMHEXC1 '.
           05  MESSAGE-TEXT        pic X(68).

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

       01  HEX-HEADER.
           05  filler  pic X(20)   value '....+....1....+....2'.
           05  filler  pic X(20)   value '....+....3....+....4'.
           05  filler  pic X(20)   value '....+....5....+....6'.
           05  filler  pic X(20)   value '....+....7....+....8'.

       01  SOURCE-01               PIC X(80).
       01  RESULT-01               PIC X(80).
       01  RESULT-02               PIC X(80).
       01  RESULT-03               PIC X(80).
       01  RESULT-04               PIC X(80).
       01  PTR-01                  PIC 9(4)            VALUE 0.
       01  IDX-01                  PIC S9(4)   COMP    VALUE 0.
       01  HEX-HW                  REDEFINES IDX-01.
           05  HEX-HW-HI           PIC X.
           05  HEX-HW-LO           PIC X.
       01  WORK-05                 PIC X(5)            VALUE SPACES.
       01  DISPLAY-MODE            PIC X               VALUE 'E'.

       COPY HEXTABLE.

      *****************************************************************
       LINKAGE SECTION.
       01  PARM-BUFFER.
           05  PARM-LENGTH         pic S9(4)   comp.
           05  PARM-DATA           pic X(256).

      *****************************************************************
       PROCEDURE DIVISION using PARM-BUFFER.

           perform Z-POST-COPYRIGHT.

      *    The PARM=A will display the possible ASCII characters
      *    on row 4 below the two hex-dump rows.

      *    The PARM=B will display the possible EBCDIC characters
      *    on row 1 above the two hex-dump rows and the possible
      *    ASCII characters on row 4 below the two hex-dump rows.

      *    The PARM=E will display the possible EBCDIC characters
      *    on row 1 above the two hex-dump rows.
           if  PARM-LENGTH > 0
               move PARM-DATA(1:1) to DISPLAY-MODE
           end-if

           perform VKSD0080-OPEN.
           perform QSAMHEXW-OPEN.

           perform until END-OF-FILE = 'YES'
               if  END-OF-FILE = 'NO '
                   perform VKSD0080-GET-NEXT
                   if  END-OF-FILE = 'NO '
                       move VKSD0080-RECORD to SOURCE-01
                       perform BUILD-HEX-DUMP-INFO
                       move    HEX-HEADER to   QSAMHEXW-RECORD
                       display QSAMHEXW-RECORD
                       perform QSAMHEXW-WRITE
                       if  DISPLAY-MODE = 'E'
                       or  DISPLAY-MODE = 'B'
                           move    RESULT-03  to   QSAMHEXW-RECORD
                           display QSAMHEXW-RECORD
                           perform QSAMHEXW-WRITE
                       end-if
                       move    RESULT-01  to   QSAMHEXW-RECORD
                       display QSAMHEXW-RECORD
                       perform QSAMHEXW-WRITE
                       move    RESULT-02  to   QSAMHEXW-RECORD
                       display QSAMHEXW-RECORD
                       perform QSAMHEXW-WRITE
                       if  DISPLAY-MODE = 'A'
                       or  DISPLAY-MODE = 'B'
                           move    RESULT-04  to   QSAMHEXW-RECORD
                           display QSAMHEXW-RECORD
                           perform QSAMHEXW-WRITE
                       end-if
                   end-if
               end-if
           end-perform.

           perform VKSD0080-CLOSE.
           perform QSAMHEXW-CLOSE.

           move 'NORMAL-END-OF-JOB' to MESSAGE-TEXT
           perform Z-POST-MESSAGE

           perform Z-THANK-YOU.

           GOBACK.

      *****************************************************************
      * The following routines are in alphabetical sequence.          *
      *****************************************************************
       BUILD-HEX-DUMP-INFO.
           move all SPACES to RESULT-01
           subtract PTR-01 from PTR-01
           perform 80 times
               add 1 to PTR-01
               subtract IDX-01 from IDX-01
               move SOURCE-01(PTR-01:1) to HEX-HW-LO
               add 1 to IDX-01
               move TAB-X1(IDX-01) to WORK-05
               move WORK-05(1:1) to RESULT-01(PTR-01:1)
               move WORK-05(2:1) to RESULT-02(PTR-01:1)
               move WORK-05(3:1) to RESULT-03(PTR-01:1)
               move WORK-05(4:1) to RESULT-04(PTR-01:1)
           end-perform
           exit.

      *****************************************************************
      * I/O ROUTINES TO WRITE THE QSAM FILE FOR HEX-DUMP INFO...      *
      *****************************************************************
       QSAMHEXW-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close QSAMHEXW-FILE
           if  QSAMHEXW-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'QSAMHEXW-FAILURE-CLOSE...' to MESSAGE-TEXT
               perform Z-POST-MESSAGE
               move VKSD0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       QSAMHEXW-WRITE.
           write QSAMHEXW-RECORD.
           if  QSAMHEXW-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  VKSD0080-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 'YES' to END-OF-FILE
               else
                   move 'QSAMHEXW-FAILURE-WRITE...'
                     to MESSAGE-TEXT
                   perform Z-POST-MESSAGE
                   move VKSD0080-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if.
           exit.
      *---------------------------------------------------------------*
       QSAMHEXW-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open output QSAMHEXW-FILE
           if  QSAMHEXW-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'QSAMHEXW-FAILURE-OPEN...'
                 to MESSAGE-TEXT
               perform Z-POST-MESSAGE
               move VKSD0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O ROUTINES TO READ THE KSDS, VSAM DATA SET...               *
      *****************************************************************
       VKSD0080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close VKSD0080-FILE
           if  VKSD0080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'VKSD0080-FAILURE-CLOSE...'
                 to MESSAGE-TEXT
               perform Z-POST-MESSAGE
               move VKSD0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       VKSD0080-GET-NEXT.
           read VKSD0080-FILE.
           if  VKSD0080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  VKSD0080-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 'YES' to END-OF-FILE
               else
                   move 'VKSD0080-FAILURE-GET...'
                     to MESSAGE-TEXT
                   perform Z-POST-MESSAGE
                   move VKSD0080-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if.
           exit.
      *---------------------------------------------------------------*
       VKSD0080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input VKSD0080-FILE
           if  VKSD0080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'VKSD0080-FAILURE-OPEN...'
                 to MESSAGE-TEXT
               perform Z-POST-MESSAGE
               move VKSD0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * The following Z-Routines perform administrative tasks         *
      * 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-POST-MESSAGE
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-POST-MESSAGE
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
      * Convert the two-byte file status code to a four digit value.  *
      * If the full two byte file status is numeric it will be        *
      * converted to 00nn. If the 1st byte is a numeric nine (9)      *
      * the second byte will be treated as a binary number and will   *
      * be converted to 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
           else
               move '0000' to IO-STATUS-04
               move IO-STATUS to IO-STATUS-04(3:2)
           end-if
           move IO-STATUS-04 to IO-STATUS-DISPLAY
           move IO-STATUS-MESSAGE to MESSAGE-TEXT
           perform Z-POST-MESSAGE
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.

      *****************************************************************
       Z-POST-MESSAGE.
           display MESSAGE-BUFFER
           move SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           display SIM-THANKS-01
           display SIM-THANKS-02
           exit.
      *****************************************************************
      *      This example is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

Table of Contents Previous Section Next Section Hexadecimal Table, a Copy File

The following (HEXTABLE.cpy) is the COBOL copy file of hexadecimal values and possible EBCDIC and ASCII print characters.

      *****************************************************************
      *                HEXTABLE is a COBOL Copy File                  *
      *            Table for Hexadecimal Dump and Display.            *
      *         Copyright (C) 1987-2018 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *****************************************************************
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      *                                                               *
      * The following table contains 256, 5-byte elements.            *
      *                                                               *
      * The format of the table elements is as follows                *
      * Byte  Function                                                *
      *  1-2  Two-byte hexadecimal print value                        *
      *    3  Print character for EBCDIC                              *
      *    4  Print character for ASCII                               *
      *    5  0 - non-printable                                       *
      *       1 - printable for EBCDIC                                *
      *       2 - printable for ASCII                                 *
      *       3 - printable for Both                                  *
      *                                                               *
      * Notice the technique used for an ASCII apostrophe (X'27')     *
      * and an EBCDIC apostrphe (X'7D'). The value content is         *
      * enclosed in double quotes to allow for the definition of      *
      * an apostrophe (or single quote) within the field.             *
      * Please Note: This feature requires the COBOL/390 dialect.     *
      *****************************************************************
      *
       01  TABLE-OF-DATA.
           05  HEX-00  PIC X(5)    VALUE '00..0'.
           05  HEX-01  PIC X(5)    VALUE '01..0'.
           05  HEX-02  PIC X(5)    VALUE '02..0'.
           05  HEX-03  PIC X(5)    VALUE '03..0'.
           05  HEX-04  PIC X(5)    VALUE '04..0'.
           05  HEX-05  PIC X(5)    VALUE '05..0'.
           05  HEX-06  PIC X(5)    VALUE '06..0'.
           05  HEX-07  PIC X(5)    VALUE '07..0'.
           05  HEX-08  PIC X(5)    VALUE '08..0'.
           05  HEX-09  PIC X(5)    VALUE '09..0'.
           05  HEX-0A  PIC X(5)    VALUE '0A..0'.
           05  HEX-0B  PIC X(5)    VALUE '0B..0'.
           05  HEX-0C  PIC X(5)    VALUE '0C..0'.
           05  HEX-0D  PIC X(5)    VALUE '0D..0'.
           05  HEX-0E  PIC X(5)    VALUE '0E..0'.
           05  HEX-0F  PIC X(5)    VALUE '0F..0'.

           05  HEX-10  PIC X(5)    VALUE '10..0'.
           05  HEX-11  PIC X(5)    VALUE '11..0'.
           05  HEX-12  PIC X(5)    VALUE '12..0'.
           05  HEX-13  PIC X(5)    VALUE '13..0'.
           05  HEX-14  PIC X(5)    VALUE '14..0'.
           05  HEX-15  PIC X(5)    VALUE '15..0'.
           05  HEX-16  PIC X(5)    VALUE '16..0'.
           05  HEX-17  PIC X(5)    VALUE '17..0'.
           05  HEX-18  PIC X(5)    VALUE '18..0'.
           05  HEX-19  PIC X(5)    VALUE '19..0'.
           05  HEX-1A  PIC X(5)    VALUE '1A..0'.
           05  HEX-1B  PIC X(5)    VALUE '1B..0'.
           05  HEX-1C  PIC X(5)    VALUE '1C..0'.
           05  HEX-1D  PIC X(5)    VALUE '1D..0'.
           05  HEX-1E  PIC X(5)    VALUE '1E..0'.
           05  HEX-1F  PIC X(5)    VALUE '1F..0'.

           05  HEX-20  PIC X(5)    VALUE '20. 2'.
           05  HEX-21  PIC X(5)    VALUE '21.!2'.
           05  HEX-22  PIC X(5)    VALUE '22."2'.
           05  HEX-23  PIC X(5)    VALUE '23.#2'.
           05  HEX-24  PIC X(5)    VALUE '24.$2'.
           05  HEX-25  PIC X(5)    VALUE '25.%2'.
           05  HEX-26  PIC X(5)    VALUE '26.&2'.
           05  HEX-27  PIC X(5)    VALUE "27.'2".
           05  HEX-28  PIC X(5)    VALUE '28.(2'.
           05  HEX-29  PIC X(5)    VALUE '29.)2'.
           05  HEX-2A  PIC X(5)    VALUE '2A.*2'.
           05  HEX-2B  PIC X(5)    VALUE '2B.+2'.
           05  HEX-2C  PIC X(5)    VALUE '2C.,2'.
           05  HEX-2D  PIC X(5)    VALUE '2D.-2'.
           05  HEX-2E  PIC X(5)    VALUE '2E..2'.
           05  HEX-2F  PIC X(5)    VALUE '2F./2'.

           05  HEX-30  PIC X(5)    VALUE '30.02'.
           05  HEX-31  PIC X(5)    VALUE '31.12'.
           05  HEX-32  PIC X(5)    VALUE '32.22'.
           05  HEX-33  PIC X(5)    VALUE '33.32'.
           05  HEX-34  PIC X(5)    VALUE '34.42'.
           05  HEX-35  PIC X(5)    VALUE '35.52'.
           05  HEX-36  PIC X(5)    VALUE '36.62'.
           05  HEX-37  PIC X(5)    VALUE '37.72'.
           05  HEX-38  PIC X(5)    VALUE '38.82'.
           05  HEX-39  PIC X(5)    VALUE '39.92'.
           05  HEX-3A  PIC X(5)    VALUE '3A.:2'.
           05  HEX-3B  PIC X(5)    VALUE '3B.;2'.
           05  HEX-3C  PIC X(5)    VALUE '3C.<2'.
           05  HEX-3D  PIC X(5)    VALUE '3D.=2'.
           05  HEX-3E  PIC X(5)    VALUE '3E.>2'.
           05  HEX-3F  PIC X(5)    VALUE '3F.?2'.

           05  HEX-40  PIC X(5)    VALUE '40 @3'.
           05  HEX-41  PIC X(5)    VALUE '41.A2'.
           05  HEX-42  PIC X(5)    VALUE '42.B2'.
           05  HEX-43  PIC X(5)    VALUE '43.C2'.
           05  HEX-44  PIC X(5)    VALUE '44.D2'.
           05  HEX-45  PIC X(5)    VALUE '45.E2'.
           05  HEX-46  PIC X(5)    VALUE '46.F2'.
           05  HEX-47  PIC X(5)    VALUE '47.G2'.
           05  HEX-48  PIC X(5)    VALUE '48.H2'.
           05  HEX-49  PIC X(5)    VALUE '49.I2'.
           05  HEX-4A  PIC X(5)    VALUE '4A.J2'.
           05  HEX-4B  PIC X(5)    VALUE '4B.K3'.
           05  HEX-4C  PIC X(5)    VALUE '4C<L3'.
           05  HEX-4D  PIC X(5)    VALUE '4D(M3'.
           05  HEX-4E  PIC X(5)    VALUE '4E+N3'.
           05  HEX-4F  PIC X(5)    VALUE '4F|O3'.

           05  HEX-50  PIC X(5)    VALUE '50&P3'.
           05  HEX-51  PIC X(5)    VALUE '51.Q2'.
           05  HEX-52  PIC X(5)    VALUE '52.R2'.
           05  HEX-53  PIC X(5)    VALUE '53.S2'.
           05  HEX-54  PIC X(5)    VALUE '54.T2'.
           05  HEX-55  PIC X(5)    VALUE '55.U2'.
           05  HEX-56  PIC X(5)    VALUE '56.V2'.
           05  HEX-57  PIC X(5)    VALUE '57.W2'.
           05  HEX-58  PIC X(5)    VALUE '58.X2'.
           05  HEX-59  PIC X(5)    VALUE '59.Y2'.
           05  HEX-5A  PIC X(5)    VALUE '5A!Z3'.
           05  HEX-5B  PIC X(5)    VALUE '5B$[3'.
           05  HEX-5C  PIC X(5)    VALUE '5C*\3'.
           05  HEX-5D  PIC X(5)    VALUE '5D)]3'.
           05  HEX-5E  PIC X(5)    VALUE '5E;^3'.
           05  HEX-5F  PIC X(5)    VALUE '5F._2'.

           05  HEX-60  PIC X(5)    VALUE '60-`3'.
           05  HEX-61  PIC X(5)    VALUE '61/a3'.
           05  HEX-62  PIC X(5)    VALUE '62.b2'.
           05  HEX-63  PIC X(5)    VALUE '63.c2'.
           05  HEX-64  PIC X(5)    VALUE '64.d2'.
           05  HEX-65  PIC X(5)    VALUE '65.e2'.
           05  HEX-66  PIC X(5)    VALUE '66.f2'.
           05  HEX-67  PIC X(5)    VALUE '67.g2'.
           05  HEX-68  PIC X(5)    VALUE '68.h2'.
           05  HEX-69  PIC X(5)    VALUE '69.i2'.
           05  HEX-6A  PIC X(5)    VALUE '6A|j3'.
           05  HEX-6B  PIC X(5)    VALUE '6B,k3'.
           05  HEX-6C  PIC X(5)    VALUE '6C%l3'.
           05  HEX-6D  PIC X(5)    VALUE '6D_m3'.
           05  HEX-6E  PIC X(5)    VALUE '6E>n3'.
           05  HEX-6F  PIC X(5)    VALUE '6F?o3'.

           05  HEX-70  PIC X(5)    VALUE '70.p2'.
           05  HEX-71  PIC X(5)    VALUE '71.q2'.
           05  HEX-72  PIC X(5)    VALUE '72.r2'.
           05  HEX-73  PIC X(5)    VALUE '73.s2'.
           05  HEX-74  PIC X(5)    VALUE '74.t2'.
           05  HEX-75  PIC X(5)    VALUE '75.u2'.
           05  HEX-76  PIC X(5)    VALUE '76.v2'.
           05  HEX-77  PIC X(5)    VALUE '77.w2'.
           05  HEX-78  PIC X(5)    VALUE '78.x2'.
           05  HEX-79  PIC X(5)    VALUE '79`y3'.
           05  HEX-7A  PIC X(5)    VALUE '7A:z3'.
           05  HEX-7B  PIC X(5)    VALUE '7B#{3'.
           05  HEX-7C  PIC X(5)    VALUE '7C@.3'.
           05  HEX-7D  PIC X(5)    VALUE "7D'}3".
           05  HEX-7E  PIC X(5)    VALUE '7E=~3'.
           05  HEX-7F  PIC X(5)    VALUE '7F".1'.

           05  HEX-80  PIC X(5)    VALUE '80..0'.
           05  HEX-81  PIC X(5)    VALUE '81a.1'.
           05  HEX-82  PIC X(5)    VALUE '82b.1'.
           05  HEX-83  PIC X(5)    VALUE '83c.1'.
           05  HEX-84  PIC X(5)    VALUE '84d.1'.
           05  HEX-85  PIC X(5)    VALUE '85e.1'.
           05  HEX-86  PIC X(5)    VALUE '86f.1'.
           05  HEX-87  PIC X(5)    VALUE '87g.1'.
           05  HEX-88  PIC X(5)    VALUE '88h.1'.
           05  HEX-89  PIC X(5)    VALUE '89i.1'.
           05  HEX-8A  PIC X(5)    VALUE '8A..0'.
           05  HEX-8B  PIC X(5)    VALUE '8B..0'.
           05  HEX-8C  PIC X(5)    VALUE '8C..0'.
           05  HEX-8D  PIC X(5)    VALUE '8D..0'.
           05  HEX-8E  PIC X(5)    VALUE '8E..0'.
           05  HEX-8F  PIC X(5)    VALUE '8F+.1'.

           05  HEX-90  PIC X(5)    VALUE '90..0'.
           05  HEX-91  PIC X(5)    VALUE '91j.1'.
           05  HEX-92  PIC X(5)    VALUE '92k.1'.
           05  HEX-93  PIC X(5)    VALUE '93l.1'.
           05  HEX-94  PIC X(5)    VALUE '94m.1'.
           05  HEX-95  PIC X(5)    VALUE '95n.1'.
           05  HEX-96  PIC X(5)    VALUE '96o.1'.
           05  HEX-97  PIC X(5)    VALUE '97p.1'.
           05  HEX-98  PIC X(5)    VALUE '98q.1'.
           05  HEX-99  PIC X(5)    VALUE '99r.1'.
           05  HEX-9A  PIC X(5)    VALUE '9A..0'.
           05  HEX-9B  PIC X(5)    VALUE '9B}.1'.
           05  HEX-9C  PIC X(5)    VALUE '9C..0'.
           05  HEX-9D  PIC X(5)    VALUE '9D..0'.
           05  HEX-9E  PIC X(5)    VALUE '9E..0'.
           05  HEX-9F  PIC X(5)    VALUE '9F..0'.

           05  HEX-A0  PIC X(5)    VALUE 'A0..0'.
           05  HEX-A1  PIC X(5)    VALUE 'A1..0'.
           05  HEX-A2  PIC X(5)    VALUE 'A2s.1'.
           05  HEX-A3  PIC X(5)    VALUE 'A3t.1'.
           05  HEX-A4  PIC X(5)    VALUE 'A4u.1'.
           05  HEX-A5  PIC X(5)    VALUE 'A5v.1'.
           05  HEX-A6  PIC X(5)    VALUE 'A6w.1'.
           05  HEX-A7  PIC X(5)    VALUE 'A7x.1'.
           05  HEX-A8  PIC X(5)    VALUE 'A8y.1'.
           05  HEX-A9  PIC X(5)    VALUE 'A9z.1'.
           05  HEX-AA  PIC X(5)    VALUE 'AA..0'.
           05  HEX-AB  PIC X(5)    VALUE 'AB..0'.
           05  HEX-AC  PIC X(5)    VALUE 'AC..0'.
           05  HEX-AD  PIC X(5)    VALUE 'AD..0'.
           05  HEX-AE  PIC X(5)    VALUE 'AE..0'.
           05  HEX-AF  PIC X(5)    VALUE 'AF..0'.

           05  HEX-B0  PIC X(5)    VALUE 'B0..0'.
           05  HEX-B1  PIC X(5)    VALUE 'B1..0'.
           05  HEX-B2  PIC X(5)    VALUE 'B2..0'.
           05  HEX-B3  PIC X(5)    VALUE 'B3..0'.
           05  HEX-B4  PIC X(5)    VALUE 'B4..0'.
           05  HEX-B5  PIC X(5)    VALUE 'B5..0'.
           05  HEX-B6  PIC X(5)    VALUE 'B6..0'.
           05  HEX-B7  PIC X(5)    VALUE 'B7..0'.
           05  HEX-B8  PIC X(5)    VALUE 'B8..0'.
           05  HEX-B9  PIC X(5)    VALUE 'B9..0'.
           05  HEX-BA  PIC X(5)    VALUE 'BA[.1'.
           05  HEX-BB  PIC X(5)    VALUE 'BB].1'.
           05  HEX-BC  PIC X(5)    VALUE 'BC..0'.
           05  HEX-BD  PIC X(5)    VALUE 'BD..0'.
           05  HEX-BE  PIC X(5)    VALUE 'BE..0'.
           05  HEX-BF  PIC X(5)    VALUE 'BF..0'.

           05  HEX-C0  PIC X(5)    VALUE 'C0{.1'.
           05  HEX-C1  PIC X(5)    VALUE 'C1A.1'.
           05  HEX-C2  PIC X(5)    VALUE 'C2B.1'.
           05  HEX-C3  PIC X(5)    VALUE 'C3C.1'.
           05  HEX-C4  PIC X(5)    VALUE 'C4D.1'.
           05  HEX-C5  PIC X(5)    VALUE 'C5E.1'.
           05  HEX-C6  PIC X(5)    VALUE 'C6F.1'.
           05  HEX-C7  PIC X(5)    VALUE 'C7G.1'.
           05  HEX-C8  PIC X(5)    VALUE 'C8H.1'.
           05  HEX-C9  PIC X(5)    VALUE 'C9I.1'.
           05  HEX-CA  PIC X(5)    VALUE 'CA..0'.
           05  HEX-CB  PIC X(5)    VALUE 'CB..0'.
           05  HEX-CC  PIC X(5)    VALUE 'CC..0'.
           05  HEX-CD  PIC X(5)    VALUE 'CD..0'.
           05  HEX-CE  PIC X(5)    VALUE 'CE..0'.
           05  HEX-CF  PIC X(5)    VALUE 'CF..0'.

           05  HEX-D0  PIC X(5)    VALUE 'D0}.1'.
           05  HEX-D1  PIC X(5)    VALUE 'D1J.1'.
           05  HEX-D2  PIC X(5)    VALUE 'D2K.1'.
           05  HEX-D3  PIC X(5)    VALUE 'D3L.1'.
           05  HEX-D4  PIC X(5)    VALUE 'D4M.1'.
           05  HEX-D5  PIC X(5)    VALUE 'D5N.1'.
           05  HEX-D6  PIC X(5)    VALUE 'D6O.1'.
           05  HEX-D7  PIC X(5)    VALUE 'D7P.1'.
           05  HEX-D8  PIC X(5)    VALUE 'D8Q.1'.
           05  HEX-D9  PIC X(5)    VALUE 'D9R.1'.
           05  HEX-DA  PIC X(5)    VALUE 'DA..0'.
           05  HEX-DB  PIC X(5)    VALUE 'DB..0'.
           05  HEX-DC  PIC X(5)    VALUE 'DC..0'.
           05  HEX-DD  PIC X(5)    VALUE 'DD..0'.
           05  HEX-DE  PIC X(5)    VALUE 'DE..0'.
           05  HEX-DF  PIC X(5)    VALUE 'DF..0'.

           05  HEX-E0  PIC X(5)    VALUE 'E0..0'.
           05  HEX-E1  PIC X(5)    VALUE 'E1..0'.
           05  HEX-E2  PIC X(5)    VALUE 'E2S.1'.
           05  HEX-E3  PIC X(5)    VALUE 'E3T.1'.
           05  HEX-E4  PIC X(5)    VALUE 'E4U.1'.
           05  HEX-E5  PIC X(5)    VALUE 'E5V.1'.
           05  HEX-E6  PIC X(5)    VALUE 'E6W.1'.
           05  HEX-E7  PIC X(5)    VALUE 'E7X.1'.
           05  HEX-E8  PIC X(5)    VALUE 'E8Y.1'.
           05  HEX-E9  PIC X(5)    VALUE 'E9Z.1'.
           05  HEX-EA  PIC X(5)    VALUE 'EA..0'.
           05  HEX-EB  PIC X(5)    VALUE 'EB..0'.
           05  HEX-EC  PIC X(5)    VALUE 'EC..0'.
           05  HEX-ED  PIC X(5)    VALUE 'ED..0'.
           05  HEX-EE  PIC X(5)    VALUE 'EE..0'.
           05  HEX-EF  PIC X(5)    VALUE 'EF..0'.

           05  HEX-F0  PIC X(5)    VALUE 'F00.1'.
           05  HEX-F1  PIC X(5)    VALUE 'F11.1'.
           05  HEX-F2  PIC X(5)    VALUE 'F22.1'.
           05  HEX-F3  PIC X(5)    VALUE 'F33.1'.
           05  HEX-F4  PIC X(5)    VALUE 'F44.1'.
           05  HEX-F5  PIC X(5)    VALUE 'F55.1'.
           05  HEX-F6  PIC X(5)    VALUE 'F66.1'.
           05  HEX-F7  PIC X(5)    VALUE 'F77.1'.
           05  HEX-F8  PIC X(5)    VALUE 'F88.1'.
           05  HEX-F9  PIC X(5)    VALUE 'F99.1'.
           05  HEX-FA  PIC X(5)    VALUE 'FA..0'.
           05  HEX-FB  PIC X(5)    VALUE 'FB..0'.
           05  HEX-FC  PIC X(5)    VALUE 'FC..0'.
           05  HEX-FD  PIC X(5)    VALUE 'FD..0'.
           05  HEX-FE  PIC X(5)    VALUE 'FE..0'.
           05  HEX-FF  PIC X(5)    VALUE 'FF..0'.

       01  TABLE-OF-PRINT          REDEFINES TABLE-OF-DATA.
           05  TAB-X1  PIC X(5)    OCCURS 256 TIMES.
      *
      ***  HEXTABLE - End-of-Copy File - - - - - - - - - - - HEXTABLE *
      *****************************************************************
      *

Table of Contents Previous Section Next Section Summary

The purpose of this program is to provide examples for accessing a VSAM data set and creating a QSAM file. It also provides an example of the COBOL/2 capability to use hexadecimal characters. 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 VSAM, KSDS Access using a Single COBOL Program that reads a VSAM data set and displays information to SYSOUT. The programs to create the test files are included in this suite of programs. The COBOL program is written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

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 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
Hex-Dump using COBOL, Input is a VSAM Data Set
Copyright © 1987-2018
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com