Embedded HEX Bytes
Source Code Scanning
  Table of Contents  v-16.01.01 - utlhex01.htm 
  Introduction
  Flowchart of Process
  Sample Input and Output
  System Requirements
  Features and Usage
  Convert from EBCDIC to ASCII
  Determine if a Byte is Embedded Hex
  Define the Hex-Dump Insertion
  Replacement Byte & One-Byte Convert
  Possibilities and Considerations
  COBOL/2 and OSVS COBOL
  Mainframe Assembler Source
  Identify & Convert, Logic Failure
  The CMD File for Windows
  Scan & Identify Embedded Hex-Bytes
  Scan & Identify, One-Byte Convert
  Scan & Identify, Sample Job
  Summary
  Software Agreement and Disclaimer
  Purchases, 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 set of programs (three COBOL programs) will scan an EBCDIC encoded, record sequential file of 80-byte fixed length records and has the ability to replace the non-display or non-printable characters with a space character and document the change. This utility is referred to as the Hexadecimal Scanner (or HS80). HS80 will scan data strings of 80 bytes in length. HS80 is typically used to scan mainframe source members that have been downloaded to a Windows system that is running a Micro Focus environment. The source members that will be scanned should be downloaded in BINARY mode to retain their eighty (80) byte fixed record length with EBCDIC encoded content.

This set of sample programs will help identify mainframe COBOL or Assembler source members that contain embedded hexadecimal (or HEX) characters. The EBCDIC format provides for 256, single-byte characters from X'00' to X'FF'. A subset of the character set for EBCDIC or ASCII encoded formats is not printable or displayable to a screen. Source members should only contain characters that are printable or displayable. All other characters are referred to as embedded hexadecimal (or HEX or binary) characters. The non-printable or hex characters are typically used as control characters and should be considered as "bit-sensitive" binary values.

Before we look at solving the problem lets review how the problem was created. Prior to the mid-1980's it was necessary to use an editor with hex capability to key in hexadecimal values. Once a source member contained hexadecimal values it had to be carefully monitored because many editors would only display a space since the hex value could not be displayed. In addition, the compiler listing would display spaces and the embedded hex characters were hidden from view. A programmer could make a change that had nothing to do with the hex values and inadvertently change the hex value to a space when the member was saved. The program would then fail in a completely unexpected manner and the resulting debugging effort could take a significant amount of time. In other words this was (and still is) an accident waiting to happen on the mainframe.

Code generators were another area where hexadecimal characters were introduced into source members. This was especially true of copy files that generated tables. These programs required extra effort to understand and maintain.

During the mid-1980's IBM introduced COBOL/2 and it provided COBOL programmers with a method for defining data fields containing hexadecimal values. The following statement is an example of using the Hex coding capability provided in the mainframe COBOL/2 dialect to define a field (HEX-1F) containing an X'1F'.

       01  HEX-1F     PIC X         VALUE X'1F'.

When source members are ported to a Windows or UNIX platform the translation from EBCDIC to ASCII introduces a whole new set of problems. In many cases the hexadecimal characters were incorrectly converted. Certain characters will be accepted into an ASCII/Text file and will either display a space or graphics character. Other characters such as X'0A', X'0D' and X'1A' function as control characters such as Line Feed, Carriage Return and End-of-File will most likely cause problems in opening, reading or displaying the contents of the file. The X'1A' or End-of-File can result in lost data when attempting to copy the file or opening and closing with a text editor.

Over the years much of the source code containing embedded hexadecimal characters has been replaced using the capability provided in the Hex coding capability provided in the IBM Mainframe COBOL/2 dialect (introduced in the mid-1980's). However, code with embedded hexadecimal characters still exists and assistance may be needed to help identify the source members and records within the source members. The primary purpose of this set of programs is to scan a list of COBOL source members and identify the records containing embedded hexadecimal values. This suite of programs runs on a Windows System using Micro Focus Net Express, version 3.1 or later. The mainframe source members must be downloaded to the Windows System in their original fixed, 80-byte, EBCDIC format.


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

Table of Contents Previous Section Next Section Flowchart of Process

The following flowchart logic flow between the programs and job scripts.

             
UTLHEXE1
cmd
Installation Verification Program
   
   
 
 
 
 
   
   
   
MEMLIST1
lseq
 
 
UTLHEXC1
cobol
Process Member List
   
   
   
if EOJ
 
 
 
 
   
   
   
No
Yes
   
CODEEBC1
EBC-rseq
 
 
UTLHEXC2
cobol
 
 
CODEASC1
ASC-lseq
   
Scan Source Member, Post HEX content, See Note-1…
   
   
   
   
UTLHEXC3
cobol
   
   
SYSLOG
lseq
   
Write to Log File
   
   
   
   
   
   
Loop Back
 
 
   
   
   
   
DISPLAY
   
Display to Screen
   
   
 
 
 
 
   
   
EOJ
End-of-Job
 
Note-1: The UTLHEXC2 program identifies the embedded hexadecimal characters and does the file format conversion from Record Sequential to Line Sequential and the record content conversion from EBCDIC to ASCII in a single pass of the EBCDIC-encoded source member.
Identify Embedded hex characters in Source Code

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using an IBM Mainframe System or Micro Focus Enterprise Developer. 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, Partitioned Data Set Members (PDSM's) or Relational Tables. The  light-gray  boxes identify a system function or an informational item.

Table of Contents Previous Section Next Section Sample Input and Output

The Hex-Scan programs read EBCDIC-encoded files of eighty-byte (80), fixed length records of mainframe source code. ASCII-encoded output files with variable length records (i.e. ASCII/Text) are produced. If an embedded hex character is encountered then four (4) statements are inserted into the output file.

The following is an example of the statements that are written to the ASCII-encoded output file created by the source scan programs. This output is only created when an embedded hex character is encountered.

      * The following 01 has non-visible, embedded hex character.
      *                                    1
      *                                    F

       01  HEX-1F-WRONG    pic X    value '?'.
4444444FF44CCE6FC6EDDDC44449884E4444A89A8471744444444444444444444444444444444444
000000001008570110696570000793070000513450DFDB0000000000000000000000000000000000
                                           *
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8

Table of Contents Previous Section Next Section System Requirements

The programs in this application are written in COBOL and are intended to be compiled and linked to run on a PC platform with Windows. The following is required.

Item Description
1 The programs have been tested and are supported using Windows/XP, Windows/7 and Windows Server. The programs are not supported for previous versions of Windows.
2 Version 5.1 or later of Net Express is provided by Micro Focus. The programs will not work on previous versions of Net Express.
3 The software package provided for the "Mainframe System Model" contains commonly used programs, script files and table definitions. This suite of programs use some of the table definitions for the EBCDIC/ASCII conversion and the dump translation. Contact SimoTime for additional information.
  Operating System and Other Software Requirements

The first COBOL program contains Micro Focus dialect and will not compile on the mainframe. The second and third programs may be compiled and executed on the mainframe but will only process a single source member at a time.

Table of Contents Previous Section Next Section Features and Usage

This section will describe the features included in the hexadecimal scan programs.

Table of Contents Previous Section Next Section Convert from EBCDIC to ASCII

Each character within the individual records will be converted from its EBCDIC encoded format to an ASCII encoded format with the exception of the embedded hexadecimal characters. The embedded hexadecimal characters are converted based on the HSACTION environment variable.

Table of Contents Previous Section Next Section Determine if a Byte is Embedded Hex

The hexadecimal scan program uses a table that is defined in a copy file to determine if a character is printable.

Table of Contents Previous Section Next Section Define the Hex-Dump Insertion

The hexadecimal scan process has the ability to dump a record showing the actual values of the embedded hexadecimal characters. This is done by inserting three records after the record with the embedded hex characters. The first inserted line shows the value of the zone or leftmost nibble of each byte in the record. The second inserted line shows the value of the decimal or rightmost nibble of each byte in the record. The third line has an asterisk in the positions that have been recognized as embedded hexadecimal.

Since the dump information is a text line inserted into the source code it will cause a compile error. To prevent a compile error it is possible to make a comment line out of the dump lines. This is done by using the HSNOTICE environment variable.

set HSNOTICE=DUMPCMT(*,07) 

In the preceding example the DUMPCMT identifies the variable as a specification for defining a comment. The asterisk is the character to be inserted and the "07" is the position to insert the character. This example will work when scanning COBOL source code. For mainframe Assembler (HLASM) the asterisk would need to be inserted in position 1.

Table of Contents Previous Section Next Section Replacement Byte & One-Byte Convert

The hexadecimal scan process has the ability to replace an embedded hexadecimal character with a displayable or printable character. The replacement character is defined by using the HSACTION environment variable.

set HSACTION=REPLACEGT1(!) 

The preceding set statement with the REPLACEGT1 keyword will cause the hex scan program to replace embedded hex characters with the "!" character. However, the one-byte text strings defined by a PIC X will be changed to the x'xx' format as the "VALUE" definition. The default action is to leave the embedded hex unchanged.

set HSACTION=REPLACEALL(^) 

The preceding set statement will cause the hex scan program to replace all embedded hex characters with the "^" character. The default action is to leave the embedded hex unchanged.

set HSACTION=NONE 

The preceding set statement shows the default action.

Table of Contents Previous Section Next Section Possibilities and Considerations

This set of programs is primarily intended for use with COBOL source members. It will also scan other mainframe source members that are downloaded to the PC in EBCDIC, fixed, 80-byte format. It has been used to scan JCL, Assembler, copy files and Assembler macro files.

The source members need to be downloaded from the mainframe to the PC in their original EBCDIC, fixed, 80-byte format. If FTP is used for the download then use the "BINARY" format. Do not use the "ASCII" format.

Since the name of the downloaded EBCDIC member is the same as the ASCII member to be created it will be necessary to have an input and an output directory.

An easy way to create the member list file (MEMLIST1) is to use the following command line statement.

C:\>dir c:\mydir\*.ext /on /a-d /b >memlist1.txt.

Table of Contents Previous Section Next Section COBOL/2 and OSVS COBOL

If the COBOL programs contain OSVS dialect and are compiled on the mainframe using the OSVS COBOL compiler the programs will need to be upgraded to COBOL/2 or later. The OSVS COBOL dialect does not support the hexadecimal coding syntax (i.e. X’xx'). The hexadecimal coding syntax was introduced by IBM in the mid-1980's with the announcement of the IBM COBOL/2 compiler.

Table of Contents Previous Section Next Section Mainframe Assembler Source

If the source code is mainframe assembler the utility will catch the problem but the solution will require a specialized skill to fix. An individual with mainframe assembler programming expertise will be required.

Table of Contents Previous Section Next Section Identify & Convert, Logic Failure

The first step in the process is to correctly identify hexadecimal values in source code. This is not a foolproof technical solution. For example, some hexadecimal items may coincidently have a valid conversion to ASCII and would not be recognized as an embedded hex character or binary string.

For example, lets take a look at a sample binary string containing four bytes of hex information as follows 00.C1.F0.FF. The x'00' (the 1st byte) will be recognized as hex value. The x'C1' and x'F0' (the 2nd an 3rd bytes) will be recognized as valid EBCDIC characters of "A" and "0" that could be converted to x'41' and x'30' which are the ASCII-encoded representation for "A" and "0". The x'FF' (the 4th byte) may or may not be recognized as a hex value depending on the code page and/or translation table. For example, the upper-case "Y" with an umlaut has an EBCDIC value of x'FF' value that would may translate to an ASCII value of x'9F' if an international code page or translation table is used. The decision as to how to convert this data string must be made by an individual that has knowledge of what the program expects.

The second step begins once the embedded hexadecimal values have been identified. The source members containing the embedded hexadecimal values should be corrected in their EBCDIC-encoded format prior to converting to ASCII. This can easily be done on the mainframe. Another alternative is to download to a Windows platform and use the Micro Focus Data File Editor to view and correct the embedded hex coding. The Data File Editor has the ability to view and change hexadecimal values within a record within a file. Please note, the source members must be downloaded in the original EBCDIC-encoded format. This can be done using the BINARY mode of FTP or the Micro Focus Mainframe Access program.

The third step in the process is to convert the source members from their EBCDIC-encoded formats to an ASCII-encoded format. This can be done on the mainframe, during the download process or on the client or server machine.

Table of Contents Previous Section Next Section The CMD File for Windows

This section describes the command files provided in this suite of programs. The first two command files are used as Installation Verification Programs when executing in an environment that uses the SimoTime Enterprise Architecture and Technologies. The third command file is provided as a model for use in a Windows and Micro Focus environment as a stand alone utility program.

Table of Contents Previous Section Next Section Scan & Identify Embedded Hex-Bytes

The UTLHEXW1.cmd file is primarily intended as an Installation Verification Program (IVP). It also serves as an example of how to run the Hexadecimal Scan Program and map the Windows file names to the program file names. This command file is used when executing in an environment that uses the SimoTime Enterprise Architecture and Technologies.

@echo OFF
rem  * *******************************************************************
rem  *               UTLHEXW1.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  *********************************************************************
rem  *
rem  * Text   - Scan COBOL source code for embedded hex characters
rem  * Author - SimoTime Technologies
rem  * Date   - January 01, 1997
rem  *
rem  * This command uses members that are provided in the SimoTime
rem  * Enterprise Technologies. For more information send an e-mail to
rem  * the helpdesk@simotime.com
rem  *
rem  * This job will read multiple EBCDIC-encoded COBOL source members
rem  * based on a user-defined list of members and create new ASCII/Text
rem  * source members. This job uses the following behavior settings.
rem  * set HSACTION=REPLACEALL(!)
rem  * set HSNOTICE=DUMPCMT(*,07)
rem  *
rem  * INPUT   - The source member format must be the original 80-byte,
rem  * fixed record length, sequential file with EBCDIC-encoding.
rem  *
rem  * OUTPUT  - The source member format will be ASCII/Text. When a
rem  * statement with embedded hex is identified it will be preceded
rem  * with comment statements that show the hex-dump content of the
rem  * statement.
rem  *
rem  * PREPARE - The following environment variables are used.
rem  * BASELIBR  Defines the base library that contains the data files
rem  *           and directories.
rem  * SYSOUT    Defines a file for information messages from scanning
rem  *           program.
rem  * SYSLOG    Defines a file for information messages from scanning
rem  *           program (primarily for specialized functions).
rem  * DATAEBC1  Defines the directory for the input source code.
rem  * DATAASC1  Defines the directory for the output source code.
rem  * MEMLIST1  Defines the drive/directory/filename.ext for the file
rem  *           that contains a list of the source members.
rem  * HSACTION  Defines what action to take and how to optionally
rem  *           modify the statement that contains embedded hex
rem  *           characters.
rem  * HSNOTICE  Defines how to notify the user that a statement
rem  *           contains embedded hex characters.
rem  *
rem  ******************************************************************
rem  * Step 1  Set System Environment Variables...
rem  ******************************************************************
rem  *
     set CmdName=UTLHEXW1
     call ..\Env1Base
     set SYSLOG=%BaseLib1%\LOGS\SYSLOG_HS80LOGS.TXT
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%"
rem  *
rem  ******************************************************************
rem  * Step 2  Set DataEbc1 and DataAsc1 drive:\directory values
rem  ******************************************************************
rem  * The following two set statements define...
rem  *  1. The drive and directory containing the EBCDIC Source Code.
rem  *  2. The drive and directory to contain the ASCII Source Code.
     set DataEbc1=%BaseLib1%\DATA\CblEbc
     set DataAsc1=%BaseLib1%\DATA\CblAsc
rem  *
rem  ******************************************************************
rem  * Step 3  Set MEMLIST for the member-list file...
rem  ******************************************************************
rem  * The following set statement defines the file containing a list
rem  * of source members that will be scanned.
     set MEMLIST1=%BaseLib1%\DATA\Txt1\HS80.MEMBER.LIST.txt
     set HSACTION=REPLACEALL(!)
     set HSNOTICE=DUMPCMT(*,07)
rem  *
rem  ******************************************************************
rem  * Step 4  Create a Member List and Execute the Scan Program...
rem  ******************************************************************
rem  * The dir statement will create a member list prior to executing
rem  * the scanner program.
     dir /on /b %DATAEBC1%\*.cbl>%MEMLIST1%
     run UTLHEXC1
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
rem  *
rem  ******************************************************************
rem  * Step 5  End-Of-Job...
rem  ******************************************************************
rem  * Perform the normal or abnormal job termination.
:EojAOK
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:End
     call SimoNOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

Table of Contents Previous Section Next Section Scan & Identify, One-Byte Convert

The UTLHEXW2.cmd file is primarily intended as an Installation Verification Program (IVP). It also serves as an example of how to run the Hexadecimal Scan Program and identify source statements that have embedded hexadecimal characters. Also, this example shows how to enable the function that will convert one-byte fields that are defined as PIC X. This command file is used when executing in an environment that uses the SimoTime Enterprise Architecture and Technologies.

@echo OFF
rem  * *******************************************************************
rem  *               UTLHEXW2.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  *********************************************************************
rem  *
rem  * Text   - Scan COBOL source code for embedded hex characters
rem  * Author - SimoTime Technologies
rem  * Date   - January 01, 1997
rem  *
rem  * This command uses members that are provided in the SimoTime
rem  * Enterprise Technologies. For more information send an e-mail to
rem  * the helpdesk@simotime.com
rem  *
rem  * This job will read multiple EBCDIC-encoded COBOL source members
rem  * based on a user-defined list of members and create new ASCII/Text
rem  * source members. This job uses the following behavior settings.
rem  * set HSACTION=REPLACEGT1(!)
rem  * set HSNOTICE=DUMPCMT(*,07)
rem  *
rem  * INPUT   - The source member format must be the original 80-byte,
rem  * fixed record length, sequential file with EBCDIC-encoding.
rem  *
rem  * OUTPUT  - The source member format will be ASCII/Text. When a
rem  * statement with embedded hex is identified it will be preceded
rem  * with comment statements that show the hex-dump content of the
rem  * statement.
rem  *
rem  * PREPARE - The following environment variables are used.
rem  * BASELIBR  Defines the base library that contains the data files
rem  *           and directories.
rem  * SYSOUT    Defines a file for information messages from scanning
rem  *           program.
rem  * SYSLOG    Defines a file for information messages from scanning
rem  *           program (primarily for specialized functions).
rem  * DATAEBC1  Defines the directory for the input source code.
rem  * DATAASC1  Defines the directory for the output source code.
rem  * MEMLIST1  Defines the drive/directory/filename.ext for the file
rem  *           that contains a list of the source members.
rem  * HSACTION  Defines what action to take and how to optionally
rem  *           modify the statement that contains embedded hex
rem  *           characters.
rem  * HSNOTICE  Defines how to notify the user that a statement
rem  *           contains embedded hex characters.
rem  *
rem  ******************************************************************
rem  * Step 1  Set System Environment Variables...
rem  ******************************************************************
rem  *
     set CmdName=UTLHEXW2
     call ..\Env1Base
     set SYSLOG=%BaseLib1%\LOGS\SYSLOG_HS80LOGS.TXT
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%"
rem  *
rem  ******************************************************************
rem  * Step 2  Set DataEbc1 and DataAsc1 drive:\directory values
rem  ******************************************************************
rem  * The following two set statements define...
rem  *  1. The drive and directory containing the EBCDIC Source Code.
rem  *  2. The drive and directory to contain the ASCII Source Code.
     set DataEbc1=%BaseLib1%\DATA\CblEbc
     set DataAsc1=%BaseLib1%\DATA\CblAsc
rem  *
rem  ******************************************************************
rem  * Step 3  Set MEMLIST for the member-list file...
rem  ******************************************************************
rem  * The following set statement defines the file containing a list
rem  * of source members that will be scanned.
     set MEMLIST1=%BaseLib1%\DATA\Txt1\HS80.MEMBER.LIST.txt
     set HSACTION=REPLACEGT1(!)
     set HSNOTICE=DUMPCMT(*,07)
rem  *
rem  ******************************************************************
rem  * Step 4  Create a Member List and Execute the Scan Program...
rem  ******************************************************************
rem  * The dir statement will create a member list prior to executing
rem  * the scanner program.
     dir /on /b %DATAEBC1%\*.cbl>%MEMLIST1%
     run UTLHEXC1
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
rem  *
rem  ******************************************************************
rem  * Step 5  End-Of-Job...
rem  ******************************************************************
rem  * Perform the normal or abnormal job termination.
:EojAOK
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:End
     call SimoNOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

Table of Contents Previous Section Next Section Scan & Identify, Sample Job

The UTLHEXW3.cmd file is primarily intended as an Installation Verification Program (IVP). It also serves as an example of how to run the Hexadecimal Scan Program and identify source statements that have embedded hexadecimal characters. Also, this example shows how to enable the function that will convert one-byte fields that are defined as PIC X. This command file is provided as a model for use in a Windows and Micro Focus environment as a stand alone utility program.

@echo OFF
rem  * *******************************************************************
rem  *               UTLHEXE3.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  *********************************************************************
rem  *
rem  * Text   - Scan COBOL source code for embedded hex characters
rem  * Author - SimoTime Technologies
rem  * Date   - January 01, 1997
rem  *
rem  * This job will read multiple EBCDIC-encoded COBOL source members
rem  * based on a user-defined list of members and create new ASCII/Text
rem  * source members. This job uses the following behavior settings.
rem  * set HSACTION=REPLACEGT1(!)
rem  * set HSNOTICE=DUMPCMT(*,07)
rem  *
rem  * INPUT   - The source member format must be the original 80-byte,
rem  * fixed record length, sequential file with EBCDIC-encoding.
rem  *
rem  * OUTPUT  - The source member format will be ASCII/Text. When a
rem  * statement with embedded hex is identified it will be preceded
rem  * with comment statements that show the hex-dump content of the
rem  * statement.
rem  *
rem  * PREPARE - The following environment variables are used.
rem  * BASELIB1  Defines the base library that contains the data files
rem  *           and directories.
rem  * SYSOUT    Defines a file for information messages from scanning
rem  *           program.
rem  * SYSLOG    Defines a file for information messages from scanning
rem  *           program (primarily for specialized functions).
rem  * DATAEBC1  Defines the directory for the input source code.
rem  * DATAASC1  Defines the directory for the output source code.
rem  * MEMLIST1  Defines the drive/directory/filename.ext for the file
rem  *           that contains a list of the source members.
rem  * HSACTION  Defines what action to take and how to optionally
rem  *           modify the statement that contains embedded hex
rem  *           characters.
rem  * HSNOTICE  Defines how to notify the user that a statement
rem  *           contains embedded hex characters.
rem  *
rem  ******************************************************************
rem  * Step 1  Set System Environment Variables...
rem  ******************************************************************
rem  *
     set CmdName=UTLHEXE3
     call ..\Env1Base
     set SYSLOG=%BaseLib1%\LOGS\SYSLOG_HS80LOGS.TXT
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%"
rem  *
rem  ******************************************************************
rem  * Step 2  Set drive:\directory values for EBCDIC/ASCII directories
rem  ******************************************************************
rem  * The following two set statements define...
rem  *  1. The drive and directory containing the EBCDIC Source Code.
rem  *  2. The drive and directory to contain the ASCII Source Code.
     set DATAEBC1=%BASELIB1%\DATA\CblEbc
     set DATAASC1=%BASELIB1%\DATA\CblAsc
rem  *
rem  ******************************************************************
rem  * Step 3  Set MEMLIST1 for the member-list file, set variables
rem  *         to determine program behavior.
rem  ******************************************************************
rem  * The following set statement defines the file containing a list
rem  * of source members that will be scanned.
     set MEMLIST1=%BASELIB1%\DATA\Txt1\HS80.MEMBER.LIST.txt
     set HSACTION=REPLACEGT1(!)
     set HSNOTICE=DUMPCMT(*,07)
rem  *
rem  ******************************************************************
rem  * Step 4  Create a Member List and Execute the Scan Program...
rem  ******************************************************************
rem  * The dir statement will create a member list prior to executing
rem  * the scanner program.
     dir /on /b %DATAEBC1%\*.cbl>%MEMLIST1%
     run UTLHEXC1
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
rem  *
rem  ******************************************************************
rem  * Step 5  End-Of-Job...
rem  ******************************************************************
rem  * Perform the normal or abnormal job termination.
:EojAOK
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:End
     call SimoNOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

Table of Contents Previous Section Next Section Summary

This set of sample programs will help identify mainframe COBOL or Assembler source members that contain embedded hexadecimal (or HEX) 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 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 contact us using the information in the  Contact or Feedback  section of this document.

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 Purchases, Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first sub-section requires an internet connection, the second sub-section references locally available documents.

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

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.

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 that are used 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.

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

An evaluation copy of this suite of programs and documentation are available for download. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

The Generally Available version of this Software may be purchased online and is delivered electronically. The Product ID is UTLHEX01V1 and a software order is usually processed and made available for download within three (3) business days.

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 maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

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 simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
Embedded HEX Characters, Source Code Scanning
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com