![]() |
Hex-Dump a Record/File SimoHEX4 - The COBOL Source Code http://www.simotime.com |
| When technology complements business | Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
This document provides a listing of the COBOL source code for viewing. Additional information about this program may be obtained by sending an e-mail to: helpdesk@simotime.com
The SimoHEX4 routine (or callable program) will convert a text string to its hexadecimal value with a display or logging capability. It will also translate the possible printable characters for both ASCII and EBCDIC.
The following is an example of the hexadecimal dump information provided by the sample programs.This information may be displayed to the screen or written to a log file.
*** 2004/11/18 20:59:58:41 Starting - Data File Content Comparison by SimoTime Enterprises, LLC *** 2004/11/18 20:59:58:43 1ST, 000000001(00001:00094) *** 2004/11/18 20:59:58:44 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9.... *** 2004/11/18 20:59:58:44 .......................@...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@............@@@@@@@@@@@@...2....i. *** 2004/11/18 20:59:58:45 FFFFFFFFFFFFC8AA988AA994C8944444444444444444444444444444444400000000C8884444444444440003900068 *** 2004/11/18 20:59:58:45 0000000000014923992436903170000000000000000000000000000000000000000051380000000000000002C0009C *** 2004/11/18 20:59:58:46 000000000001Distributor Cap ........Each .......... *** 2004/11/18 20:59:58:46 2ND, 000000001(00001:00094) *** 2004/11/18 20:59:58:46 ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9.... *** 2004/11/18 20:59:58:47 .......................@...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...#........@@@@@@@@@@@@...2....i. *** 2004/11/18 20:59:58:48 FFFFFFFFFFFFC8AA988AA994C8944444444444444444444444444444444400020000C8884444444444440003900068 *** 2004/11/18 20:59:58:48 0000000000014923992436903170000000000000000000000000000000000003000A51380000000000000002C0009C *** 2004/11/18 20:59:58:49 000000000001Distributor Cap ........Each .......... *** 2004/11/18 20:59:58:49 ===============================================================#===#========================== *** 2004/11/18 20:59:58:49 *
In the preceding example the RED lines show the possible ASCII-Text translation and the BLUE lines show the possible EBCDIC-Text translation. The GREEN lines are the hexadecimal dump information.
The coding to do the actual call to display and/or log the hex dump information is as follows.
*****************************************************************
* The coding required to do the call to the Hex-Dump program.
* ------------------------------------------------------------
CALL 'SIMOHEX4' USING SIMOHEX4-PASS-AREA
A copy file is provided to define the pass area to be used when calling SimoDUMP. The following statement is required in the WORKING STORAGE section of the calling program.
WORKING STORAGE.
...
...
COPY PASSHEX4.
...
You may view an example of a COBOL program that uses SimoDUMP at http://www.simotime.com/cblhbx01.htm.
The following is the COBOL Source Code.
IDENTIFICATION DIVISION.
PROGRAM-ID. SIMOHEX4.
AUTHOR. SIMOTIME ENTERPRISES.
*****************************************************************
* Copyright (C) 1987-2009 SimoTime Enterprises, LLC. *
* *
* 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 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 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 *
* 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 *
* *
* SimoTime Enterprises *
* 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 Enterprises, *
* 15 Carnoustie Drive, Novato, CA 94949-5849. *
* *
*****************************************************************
* This program is provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
* *
*****************************************************************
*
*****************************************************************
* Source Member: SIMOHEX4.CBL
* Copy Files: HEXTABLE.CPY
* PASSHEX4.CPY
*****************************************************************
*
* PASSHEX4 - Create Hexadecimal Dump information.
*
*
* DESCRIPTION
* -----------
* This program will will scan the source buffer and create
* HEX-Dump information plus ASCII and EBCDIC display info.
*
* ************ ************
* * TXTHEXJ1 * * TXTHEXE1 *
* ********jcl* ********cmd*
* * *
* * *
* ************ ************
* * IEFBR14 * * SIMOEXEC *
* ********utl* ********cbl*
* * *
* *************************
* *
* *
* ************ ************ ************
* * TEXT0512 *-----* TXTHEXC1 *-----* QSAMHEXW *
* *******crlf* ********cbl* *******crlf*
* *
* * ************
* *------call-* SIMOHEX4 *
* * ********cbl*
* *
* ************
* * EOJ *
* ************
*
*****************************************************************
*
* MAINTENANCE
* -----------
* 1996/03/15 Simmons, Created program.
* 1996/03/15 Simmons, No changes to date.
*
*****************************************************************
DATA DIVISION.
WORKING-STORAGE SECTION.
01 FIVE-BYTES pic X(5).
01 IDX-1 pic 9(3) BINARY.
01 IDX-1R REDEFINES IDX-1.
05 IDX-1R-01 pic X.
05 IDX-1R-02 pic X.
01 IDX-2 pic 9(3) BINARY.
COPY HEXTABLE.
*****************************************************************
LINKAGE SECTION.
COPY PASSHEX4.
*****************************************************************
PROCEDURE DIVISION using PASSHEX4-PASS-AREA.
add 8 to ZERO giving PASSHEX4-RESULT
if PASSHEX4-LENGTH not NUMERIC
add 128 to ZERO giving PASSHEX4-LENGTH
end-if
if PASSHEX4-LENGTH > 1024
add 128 to ZERO giving PASSHEX4-LENGTH
end-if
if PASSHEX4-REQUEST = 'DUMP'
perform DUMP-PROCESSING
else
add 16 to ZERO giving PASSHEX4-RESULT
end-if
GOBACK.
*****************************************************************
* The following routines are in alphabetical sequence. *
*****************************************************************
DUMP-PROCESSING.
move all SPACES to PASSHEX4-DUMP-INFO
perform varying IDX-2 from 1 by 1
until IDX-2 > PASSHEX4-LENGTH
add 1 to ZERO giving IDX-1
move PASSHEX4-SOURCE(IDX-2:1) to IDX-1R-02
add 1 to IDX-1
move TAB-X1(IDX-1) to FIVE-BYTES
move FIVE-BYTES(1:1) to PASSHEX4-UPPER(IDX-2:1)
move FIVE-BYTES(2:1) to PASSHEX4-LOWER(IDX-2:1)
move FIVE-BYTES(3:1) to PASSHEX4-EBCDIC(IDX-2:1)
move FIVE-BYTES(4:1) to PASSHEX4-ASCII(IDX-2:1)
end-perform
exit.
*****************************************************************
* This example is provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
The purpose of this document is to provide a COBOL Source member for viewing.
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.
You may view an example of a COBOL program that uses SimoDUMP at http://www.simotime.com/cblhbx01.htm.
You may view the complete list of SimoTime callable Modules or Driver Programs at http://www.simotime.com/simomods.htm.
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. SimoZAPScan 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.
This document provides a quick summary of the File Status Key for VSAM data sets and QSAM files.
Check out The SimoTime Library for a wide range of topics for Programmers, Project Managers and Software Developers.
To review all the information available on this site start at The SimoTime Home Page .
Check out The SimoTime Glossary for a list of terms and definitions used in the documents provided by SimoTime.
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.
Founded in 1987, SimoTime Enterprises is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
| Return-to-Top |
| Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |