COBOL Numbers
Commonly Used Numeric Formats
  Table of Contents  v-24.01.01 - nbrtyp01.htm 
  Introduction
  Programming Objectives
  Programming Requirements
  Programming Overview
  Programming Output
  Review Bits, Bytes, Nibbles & Sizes
  Common Numeric Formats
  Field Sizes - Digits, Packed & Binary
  EBCDIC & ASCII, Big & Little Endian
  Hexadecimal Dump Format
  Data Convert, Additional Insight
  Hexadecimal-Dump Function
  Job Scripts
  CMD, Micro Focus COBOL
  JCL, Mainframe or Micro Focus Server
  Bash Script, Linux and GnuCOBOL
  COBOL Test Program
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This suite of example programs will describe the format and size of some of the commonly used numeric fields of the COBOL programming language. This example also illustrates how to redefine a numeric field and how to display the actual hexadecimal content of a numeric field.

The program has been tested as part of a batch job using a JCL Member on an IBM Mainframe System with Enterprise COBOL, a Command File on a Windows System with Micro Focus COBOL and a Bash Script on a Linux System with GnuCOBOL.

In the wonderful world of programming there are many ways to solve a problem. This suite of programs is provided as a COBOL example of one of the possible solutions to the challenge of determining the physical structure, length and arithmetic value of a numeric field.


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 Programming Objectives

This example illustrates the following functions.

1 Describe the commonly used Numeric field formats available in COBOL.
2 Describe the internal structure of the Numeric fields.
3 Provide a quick overview of the EBCDIC and ASCII environments.
4 Describe the difference in specified number of digits and actual field size.
5 Show how to dump the actual hexadecimal value of a numeric field.
6 Provide an example of mainframe JCL to run the job on Windows using Micro Focus Mainframe Express (MFE) .
7 Provide an example of a Window's CMD file to run the job on Windows using Micro Focus Net Express.
8 Provide an example of a Bash Script to run the job on a Linux (Ubuntu) System using GnuCOBOL.
9 Maintain a single set of COBOL source code that will run on an IBM Mainframe System, a Windows System, a Linux System and a UNIX System.
  Common Numeric Types, Objectives for this Document and Sample Programs

Table of Contents Previous Section Next Section Programming Requirements

This suite of example programs will run on the following platforms.

1 Executes on an IBM Mainframe running MVS or OS/390. The COBOL programs comply with ANSI/85 and run with COBOL/2, COBOL for MVS and COBOL for OS/390.
2 Executes on Windows/XP, Windows/7 and Windows/Server using Micro Focus Server.
3 Executes on Windows/XP, Windows/7 and Windows/Server using Micro Focus COBOL and the CMD file provided.
4 Executes on Linux (Ubuntu) System using GnuCOBOL and the Bash Script file provided.
5 May be ported to run on additional platforms that have support for COBOL.
  Operating System and Supporting Software Requirements

Table of Contents Previous Section Next Section Programming Overview

The following is a flowchart of the job for executing the programs that show the usage of numeric field types.

             
Entry Point
ZOS
Entry Point
Linux
Entry Point
Windows
   
   
   
NBRTYPJ1
jcl
nbrtyps1
sh
NBRTYPE1
cmd
Batch Job Scripts
   
   
 
 
   
   
 
 
   
   
NBRTYPC1
cbl
COBOL Program, refer to Note-1
   
SIMODUMP
cbl
 
 
SYSOUT
rseq
Hex-Dump routine, refer to Note-2
   
SIMOLOGS
cbl
 
 
SYSLOG
rseq
Write to Log, Refer to Note-3
 
Note-1: This member is the primary COBOL program that calls the Hexadecimal Dump routine.
Note-2: The SIMODUMP member is a COBOL Hexadecimal Dump routine that displays the dump information on the screen. The dump information is only displayed if the SIMODUMP-SYSOUT field contains SHOW or BOTH.
Note-3: The SIMOLOGS member is a COBOL Write-to-Log routine that writes the dump information to a log file. This routine is only called if the SIMODUMP-REQUEST field contains FILE or BOTH.
Commonly used Numeric Types

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 Programming Output

The following is a sample of the Dump information produced on a Windows System running Micro Focus Studio configured for ASCII. The sample COBOL program is compiled with a mainframe dialect using an ASCII character set (i.e. ASCII encoded).

* Task0001 *
* Task0001 ********************************************************************
* Task0001 UNSIGNED-123 PIC 9(5)
* Task0001 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 33xxxxxx xxxxxxxx xxxxxxxx ................ 00123...........
* Task0001 Complete... Length = 0005
* Task0002 *
* Task0002 ********************************************************************
* Task0002 PLUS-123 PIC S9(5)
* Task0002 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 33xxxxxx xxxxxxxx xxxxxxxx ................ 00123...........
* Task0002 Complete... Length = 0005
* Task0002 *
* Task0002 MINUS-123 PIC S9(5)
* Task0002 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 73xxxxxx xxxxxxxx xxxxxxxx ................ 0012s...........
* Task0002 Complete... Length = 0005
* Task0003 *
* Task0003 ********************************************************************
* Task0003 PLUS-123-PACKED PIC S9(5) COMP-3
* Task0003 Starting... Length = 0003
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 00123Cxx xxxxxxxx xxxxxxxx xxxxxxxx ................ ..<.............
* Task0003 Complete... Length = 0003
* Task0003 *
* Task0003 MINUS-123-PACKED PIC S9(5) COMP-3
* Task0003 Starting... Length = 0003
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 00123Dxx xxxxxxxx xxxxxxxx xxxxxxxx ................ ..=.............
* Task0003 Complete... Length = 0003
* Task0004 *
* Task0004 ********************************************************************
* Task0004 PLUS-123-BINARY PIC S9(5) BINARY
* Task0004 Starting... Length = 0004
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 0000007B xxxxxxxx xxxxxxxx xxxxxxxx ...#............ ...{............
* Task0004 Complete... Length = 0004
* Task0004 *
* Task0004 MINUS-123-BINARY PIC S9(5) BINARY
* Task0004 Starting... Length = 0004
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 FFFFFF85 xxxxxxxx xxxxxxxx xxxxxxxx ...e............ ................
* Task0004 Complete... Length = 0004
* Task0005 *
* Task0005 ********************************************************************
* Task0005 PLUS-123-SL PIC S9(5) SIGN LEADING
* Task0005 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 33xxxxxx xxxxxxxx xxxxxxxx ................ 00123...........
* Task0005 Complete... Length = 0005
* Task0005 *
* Task0005 MINUS-123-SL PIC S9(5) SIGN LEADING
* Task0005 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 70303132 33xxxxxx xxxxxxxx xxxxxxxx ................ p0123...........
* Task0005 Complete... Length = 0005
* Task0006 *
* Task0006 ********************************************************************
* Task0006 PLUS-123-ST PIC S9(5) SIGN TRAILING
* Task0006 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 33xxxxxx xxxxxxxx xxxxxxxx ................ 00123...........
* Task0006 Complete... Length = 0005
* Task0006 *
* Task0006 MINUS-123-ST PIC S9(5) SIGN TRAILING
* Task0006 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 73xxxxxx xxxxxxxx xxxxxxxx ................ 0012s...........
* Task0006 Complete... Length = 0005
* Task0007 *
* Task0007 ********************************************************************
* Task0007 PLUS-123-SLS PIC S9(5) SIGN LEADING SEPARATE
* Task0007 Starting... Length = 0006
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 2B303031 3233xxxx xxxxxxxx xxxxxxxx ................ +00123..........
* Task0007 Complete... Length = 0006
* Task0007 *
* Task0007 MINUS-123-SLS PIC S9(5) SIGN LEADING SEPARATE
* Task0007 Starting... Length = 0006
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 2D303031 3233xxxx xxxxxxxx xxxxxxxx ................ -00123..........
* Task0007 Complete... Length = 0006
* Task0008 *
* Task0008 ********************************************************************
* Task0008 PLUS-123-STS PIC S9(5) SIGN TRAILING SEPARATE
* Task0008 Starting... Length = 0006
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 332Bxxxx xxxxxxxx xxxxxxxx ................ 00123+..........
* Task0008 Complete... Length = 0006
* Task0008 *
* Task0008 MINUS-123-STS PIC S9(5) SIGN TRAILING SEPARATE
* Task0008 Starting... Length = 0006
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 332Dxxxx xxxxxxxx xxxxxxxx ................ 00123-..........
* Task0008 Complete... Length = 0006
* Task0009 *
* Task0009 ********************************************************************
* Task0009 Digits=001 Packed=001 Binary=002  NBR-01 Field Sizes for PIC 9
* Task0009 Digits=002 Packed=002 Binary=002  NBR-02 Field Sizes for PIC 99
* Task0009 Digits=003 Packed=002 Binary=002  NBR-03 Field Sizes for PIC 999
* Task0009 Digits=004 Packed=003 Binary=002  NBR-04 Field Sizes for PIC 9(4)
* Task0009 Digits=005 Packed=003 Binary=004  NBR-05 Field Sizes for PIC 9(5)
* Task0009 Digits=006 Packed=004 Binary=004  NBR-06 Field Sizes for PIC 9(6)
* Task0009 Digits=007 Packed=004 Binary=004  NBR-07 Field Sizes for PIC 9(7)
* Task0009 Digits=008 Packed=005 Binary=004  NBR-08 Field Sizes for PIC 9(8)
* Task0009 Digits=009 Packed=005 Binary=004  NBR-09 Field Sizes for PIC 9(9)
* Task0009 Digits=010 Packed=006 Binary=008  NBR-10 Field Sizes for PIC 9(10)
* Task0009 Digits=011 Packed=006 Binary=008  NBR-11 Field Sizes for PIC 9(11)
* Task0009 Digits=012 Packed=007 Binary=008  NBR-12 Field Sizes for PIC 9(12)
* Task0009 Digits=013 Packed=007 Binary=008  NBR-13 Field Sizes for PIC 9(13)
* Task0009 Digits=014 Packed=008 Binary=008  NBR-14 Field Sizes for PIC 9(14)
* Task0009 Digits=015 Packed=008 Binary=008  NBR-15 Field Sizes for PIC 9(15)
* Task0009 Digits=016 Packed=009 Binary=008  NBR-16 Field Sizes for PIC 9(16)
* Task0009 Digits=017 Packed=009 Binary=008  NBR-17 Field Sizes for PIC 9(17)
* Task0009 Digits=018 Packed=010 Binary=008  NBR-18 Field Sizes for PIC 9(18)
* Task0009 ********************************************************************

Table of Contents Previous Section Next Section Review Bits, Bytes, Nibbles & Sizes

A bit is the smallest unit of information processed by a computer. A bit may be switched OFF (a ZERO value) or ON (a ONE value). When eight bits are grouped together it is called a byte. A byte may be used to represent letters of the alphabet, numbers and other special characters. For example, the bit arrangement within a byte for the letter "A" would be 11000001. The bit arrangement for the text string "AB12" would be 11000001110000101111000111110010. This is difficult for people to read. To make this a bit easier (sorry, no pun intended) to read the bits are usually arranged in groups of four bits (sometimes called nibbles) separated by a space or comma. For example, the bit arrangement (or binary notation) for "AB12" would be 1100,0001,1100,0010,1111,0001,1111,0010. Binary notation is still not that easy to understand and hexadecimal code became very popular. Since a nibble (four-bits) can only represent 16 different values a single number or letter is used to represent each hexadecimal value (bit arrangement within a nibble).

Binary Value Hexadecimal Value Decimal Value
0000 0 0
0001 1 1
0010 2 2
0011 3 3
0100 4 4
0101 5 5
0110 6 6
0111 7 7
1000 8 8
1001 9 9
1010 A 10
1011 B 11
1100 C 12
1101 D 13
1110 E 14
1111 F 15

Using the preceding table we can now represent the Binary value of 11000001110000101111000111110010 as C1C2F1F2. The following table may be easier to read.

1100 0001
C   1
1100 0010
C   2
1111 0001
F   1
1111 0010
F   2
A B 1 2

Note: A table of the full 256 character set including Binary, Hexadecimal, Decimal and the EBCDIC and ASCII displayable characters is available in the SimoTime Library.  

Table of Contents Previous Section Next Section Common Numeric Formats

The three most common mainframe numeric encoding formats are Zoned-Decimal, Packed-Decimal and Binary. The following shows how the numeric fields would be defined in a COBOL WORKING-STORAGE SECTION.

Numeric Field Type Coding Syntax Normally Coded (Minimum)
Binary
(alternate coding technique)
USAGE IS COMPUTATIONAL
USAGE IS BINARY
COMP
BINARY
Packed Decimal USAGE IS COMPUTATIONAL-3 COMP-3
Zoned Decimal USAGE IS DISPLAY Left blank, this is the default

The following is an example of actual COBOL source code.

      *    The following two lines show the syntax for a binary field,
      *    1st line is full syntax, 2nd line is normally coded syntax.
       01  NUMERIC-BINARY-FULL  PIC S9(5)V99 USAGE IS COMPUTATIONAL.
       01  NUMERIC-BINARY-NORM  PIC S9(5)V99 COMP.
      *    The following two lines show the syntax for a packed field,
      *    1st line is full syntax, 2nd line is normally coded syntax.
       01  NUMERIC-PACKED-FULL  PIC S9(5)V99 USAGE IS COMPUTATIONAL-3.
       01  NUMERIC-PACKED-NORM  PIC S9(5)V99 COMP-3.
      *    The following two lines show the syntax for a zoned field,
      *    1st line is full syntax, 2nd line is normally coded syntax.
       01  NUMERIC-ZONED-FULL   PIC S9(5)V99 USAGE IS DISPLAY.
       01  NUMERIC-ZONED-NORM   PIC S9(5)V99.

Table of Contents Previous Section Next Section Field Sizes - Digits, Packed & Binary

The following is the output of TASK009 when the COBOL program is compiled using a mainframe dialect with the IBMCOMP and NOTRUNC compiler directives. In this example (Task0009) notice the lengths for the BINARY fields, They are 2, 4 or 8 bytes.

* Task0009 *
* Task0009 ********************************************************************
* Task0009 Digits=001 Packed=001 Binary=002  NBR-01 Field Sizes for PIC 9
* Task0009 Digits=002 Packed=002 Binary=002  NBR-02 Field Sizes for PIC 99
* Task0009 Digits=003 Packed=002 Binary=002  NBR-03 Field Sizes for PIC 999
* Task0009 Digits=004 Packed=003 Binary=002  NBR-04 Field Sizes for PIC 9(4)
* Task0009 Digits=005 Packed=003 Binary=004  NBR-05 Field Sizes for PIC 9(5)
* Task0009 Digits=006 Packed=004 Binary=004  NBR-06 Field Sizes for PIC 9(6)
* Task0009 Digits=007 Packed=004 Binary=004  NBR-07 Field Sizes for PIC 9(7)
* Task0009 Digits=008 Packed=005 Binary=004  NBR-08 Field Sizes for PIC 9(8)
* Task0009 Digits=009 Packed=005 Binary=004  NBR-09 Field Sizes for PIC 9(9)
* Task0009 Digits=010 Packed=006 Binary=008  NBR-10 Field Sizes for PIC 9(10)
* Task0009 Digits=011 Packed=006 Binary=008  NBR-11 Field Sizes for PIC 9(11)
* Task0009 Digits=012 Packed=007 Binary=008  NBR-12 Field Sizes for PIC 9(12)
* Task0009 Digits=013 Packed=007 Binary=008  NBR-13 Field Sizes for PIC 9(13)
* Task0009 Digits=014 Packed=008 Binary=008  NBR-14 Field Sizes for PIC 9(14)
* Task0009 Digits=015 Packed=008 Binary=008  NBR-15 Field Sizes for PIC 9(15)
* Task0009 Digits=016 Packed=009 Binary=008  NBR-16 Field Sizes for PIC 9(16)
* Task0009 Digits=017 Packed=009 Binary=008  NBR-17 Field Sizes for PIC 9(17)
* Task0009 Digits=018 Packed=010 Binary=008  NBR-18 Field Sizes for PIC 9(18)
* Task0009 ********************************************************************

The following is the output of TASK009 when the COBOL program is compiled using a non-mainframe dialect. In this example (Task0009) notice the lengths for the BINARY fields, They are 1, 2, 3, 4, 5, 6, 7 or 8 bytes.

* Task0009 *
* Task0009 ********************************************************************
* Task0009 Digits=001 Packed=001 Binary=001  NBR-01 Field Sizes for PIC 9
* Task0009 Digits=002 Packed=002 Binary=001  NBR-02 Field Sizes for PIC 99
* Task0009 Digits=003 Packed=002 Binary=002  NBR-03 Field Sizes for PIC 999
* Task0009 Digits=004 Packed=003 Binary=002  NBR-04 Field Sizes for PIC 9(4)
* Task0009 Digits=005 Packed=003 Binary=003  NBR-05 Field Sizes for PIC 9(5)
* Task0009 Digits=006 Packed=004 Binary=003  NBR-06 Field Sizes for PIC 9(6)
* Task0009 Digits=007 Packed=004 Binary=003  NBR-07 Field Sizes for PIC 9(7)
* Task0009 Digits=008 Packed=005 Binary=004  NBR-08 Field Sizes for PIC 9(8)
* Task0009 Digits=009 Packed=005 Binary=004  NBR-09 Field Sizes for PIC 9(9)
* Task0009 Digits=010 Packed=006 Binary=005  NBR-10 Field Sizes for PIC 9(10)
* Task0009 Digits=011 Packed=006 Binary=005  NBR-11 Field Sizes for PIC 9(11)
* Task0009 Digits=012 Packed=007 Binary=005  NBR-12 Field Sizes for PIC 9(12)
* Task0009 Digits=013 Packed=007 Binary=006  NBR-13 Field Sizes for PIC 9(13)
* Task0009 Digits=014 Packed=008 Binary=006  NBR-14 Field Sizes for PIC 9(14)
* Task0009 Digits=015 Packed=008 Binary=007  NBR-15 Field Sizes for PIC 9(15)
* Task0009 Digits=016 Packed=009 Binary=007  NBR-16 Field Sizes for PIC 9(16)
* Task0009 Digits=017 Packed=009 Binary=008  NBR-17 Field Sizes for PIC 9(17)
* Task0009 Digits=018 Packed=010 Binary=008  NBR-18 Field Sizes for PIC 9(18)
* Task0009 ********************************************************************

Table of Contents Previous Section Next Section EBCDIC & ASCII, Big & Little Endian

The following shows the picture (PIC) clause, how the item is displayed using the DISPLAY verb, the field as it is stored in memory for an EBCDIC environment, the field as it would be stored in memory for an ASCII environment

Picture Clause DISPLAY Memory Content (EBCDIC) Memory Content (ASCII)
PIC 9(5) 00123 F0F0F1F2F3 3030313233
PIC S9(5) plus 00123 F0F0F1F2C3 3303013233
PIC S9(5) minus 00123- F0F0F1F2D3 3030313273
PIC S9(5) COMP-3 plus 00123 00123C 00123C
PIC S9(5) COMP-3 minus 00123- 00123D 00123D
PIC S9(5) COMP plus 00123 0000007B 00007B
PIC S9(5) COMP minus 00123- FFFFFF85 FFFF85

In addition to the ASCII and EBCDIC differences it is important to note the hardware differences for binary numbers. Most COBOL compilers hide this level of processing. However, it occasionally shows up as a problem.

Big Endian - within a multi-byte numeric representation the most significant byte has the lowest address. Processors such as the IBM 370 family, the PDP-10, the Motorola microprocessor family, and most of the various RISC architectures are big-endian.

Little Endian - within a sixteen or thirty-two bit word the bytes at lower addresses have lower significance. Processors such as the PDP-11 and VAX family of computers, the Intel microprocessors, and much of the communications and networking hardware are little-endian.

Table of Contents Previous Section Next Section Hexadecimal Dump Format

The following is an example of the Dump information produced on an IBM Mainframe or Micro Focus Mainframe Express on the PC that works with EBCDIC. The hexadecimal information is (highlighted in green) The possible translated, displayable EBCDIC characters are (highlighted in blue). The possible translated, displayable ASCII characters are.(highlighted in red).

* Dump0001 *
* Dump0001 ********************************************************************
* Dump0001 Dump UNSIGNED-123 PIC 9(5)
* Dump0001 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 F0F0F1F2 F3xxxxxx xxxxxxxx xxxxxxxx 00123........... ................
* Dump0001 Complete... Length = 0005

If the sample program is executed in the PC, ASCII environment the following would be displayed and written to the log file.

* Dump0001 *
* Dump0001 ********************************************************************
* Dump0001 Dump UNSIGNED-123 PIC 9(5)
* Dump0001 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 33xxxxxx xxxxxxxx xxxxxxxx ................ 00123...........
* Dump0001 Complete... Length = 0005

The preceding dump information (Dump0001) is for a simple, unsigned numeric field that is defined with a PICTURE 9(5) VALUE 123. In the next example (Dump0002) we will take a look at a simple, signed numeric field that is defined with a PICTURE S9(5) VALUE 123. The first part of the following is for the mainframe, EBCDIC environment.

* Dump0002 *
* Dump0002 ********************************************************************
* Dump0002 PLUS-123 PIC S9(5)
* Dump0002 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 F0F0F1F2 C3xxxxxx xxxxxxxx xxxxxxxx 0012C........... ................
* Dump0002 Complete... Length = 0005
* Dump0002 *
* Dump0002 MINUS-123 PIC S9(5)
* Dump0002 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 F0F0F1F2 D3xxxxxx xxxxxxxx xxxxxxxx 0012L........... ................
* Dump0002 Complete... Length = 0005

If the sample program is executed in the PC, ASCII environment the following would be displayed and written to the log file.

* Dump0002 ********************************************************************
* Dump0002 PLUS-123 PIC S9(5)
* Dump0002 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 33xxxxxx xxxxxxxx xxxxxxxx ................ 00123...........
* Dump0002 Complete... Length = 0005
* Dump0002 *
* Dump0002 MINUS-123 PIC S9(5)
* Dump0002 Starting... Length = 0005
*  Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
*   1-016 30303132 73xxxxxx xxxxxxxx xxxxxxxx ................ 0012s...........
* Dump0002 Complete... Length = 0005

In the preceding example for a signed numeric field (Dump0002) notice the high-order nibble in the units position is used for the sign and the low-order nibble is used for the digit value.

Table of Contents Previous Section Next Section Data Convert, Additional Insight

The following links will provide additional information about Data File Conversion between ASCII and EBCDIC or Mainframe Numeric encoding and Windows or UNIX numeric Encoding.

Explore an Overview of File Conversion Process with detailed examples.

Explore File Conversion at the Record Level or positions within a record.

Explore File Conversion at the Field Level based on Field Name and Field Type as defined in a COBOL copy file.

Table of Contents Previous Section Next Section Hexadecimal-Dump Function

This suite of programs includes three (3) job scripts that execute the test program. The various numeric formats are presented in a hexadecimal dump format so the programmer can see the actual physical structure of the numeric string as it exist in memory.

Table of Contents Previous Section Next Section Job Scripts

A job script may be defined as a text file containing job setup information followed by job steps that identify programs to be executed along with parameters unique to the job step. A job script may be created using a text editor. The naming of a job script is determined by the Operating System. A simple job script may contain a single job step that performs a single function. A typical job script will contain multiple job steps executed in a predefined sequence. The status of each job step may be tested at the end of each job step.

Table of Contents Previous Section Next Section CMD, Micro Focus COBOL

The following (NBRTYPE1.cmd) is a sample of the Windows CMD needed to run this job.

@echo OFF
rem  * *******************************************************************
rem  *               NBRTYPE1.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    - COBOL and Commonly User Numeric Formats
rem  * Author  - SimoTime Technologies
rem  * Date    - November 11, 2003
rem  * Version - 03.12.15
rem  *
rem  * This set of programs illustrates the use of some of the commonly
rem  * used numeric formats. It will show actual hex-dump content of
rem  * the fields along with the field length for the display format
rem  * (actual digits), the packed format (COMP-3) and the binary (COMP)
rem  * formats.
rem  *
rem  * The COBOL programs are compiled with the ASSIGN(EXTERNAL)
rem  * directive. This provides for external file mapping of file names.
rem  *
rem  * When running with Net Express the IBMCOMP an NOTRUNC directives
rem  * will be required to maintain compatability with the mainframe
rem  * format and field sizes for binary fields.
rem  *
rem  * This technique provides for the use of a single COBOL source
rem  * program that will run on OS/390, Windows or Unix.
rem  *
rem  * This set of programs will run on a Personal Computer with Windows
rem  * and Micro Focus Net Express.
rem  *
rem  *   ************
rem  *   * NBRTYPE1 *
rem  *   ********cmd*
rem  *        *
rem  *        *
rem  *   ************     ************     ************
rem  *   *   RUN    ******* NBRTYPC1 ******* SIMODUMP *
rem  *   ************     ********gnt*  *  ********dll*
rem  *        *                                 *
rem  *        *                            ************     ************
rem  *        *                            * SIMOLOGS ******* CONSOLE  *
rem  *        *                            ********dll*  *  ************
rem  *        *                                          *
rem  *        *                                          *  ************
rem  *        *                                          ****  SYSLOG  *
rem  *        *                                             *******data*
rem  *        *
rem  *   ************
rem  *   *   EOJ    *
rem  *   ************
rem  *
rem  * *******************************************************************
rem  * Step   1 of 2  Set the global environment variables...
rem  *
     set CmdName=NBRTYPE1
     call ..\Env1BASE
rem  *
     call SimoNOTE "*******************************************************%CmdName%.CMD"
     call SimoNOTE "Starting JobName %CmdName%.CMD"
rem  *
rem  * *******************************************************************
rem  * Step 1 of 1, Execute the Number Format Analysis Program...
rem  *
     run NbrTypC1
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
:EojAOK
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:End
     call SimoNOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section JCL, Mainframe or Micro Focus Server

The following is the JCL member (NBRTYPJ1.jcl) required to run this sample job on an IBM Mainframe with ZOS or a Windows, UNIX or Linux System with Micro Focus Server.

//NBRTYPJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2019 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - COBOL and Commonly User Numeric Formats
//* Author  - SimoTime Technologies
//* Date    - November 11, 2003
//* Version - 03.12.15
//*
//* This set of programs illustrates the use of some of the commonly
//* used numeric formats. It will show actual hex-dump content of
//* the fields along with the field length for the display format
//* (actual digits), the packed format (COMP-3) and the binary (COMP)
//* formats.
//*
//* The COBOL programs are compiled with the ASSIGN(EXTERNAL)
//* directive. This provides for external file mapping of file names.
//*
//* When running with Net Express the IBMCOMP an NOTRUNC directives
//* will be required to maintain compatability with the mainframe
//* format and field sizes for binary fields.
//*
//* This technique provides for the use of a single COBOL source
//* program that will run on OS/390, Windows or Unix.
//*
//* This set of programs will run on a Personal Computer with Windows
//* and Micro Focus Mainframe Express or a Mainframe with OS/390.
//*
//* *******************************************************************
//* Step   1 of 2  This job step will delete a previously created
//*        hex-dump file.
//*
//JOBSETUP EXEC PGM=IEFBR14
//SYSLOG   DD  DSN=SIMOTIME.DATA.SYSLOGT1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=V,LRECL=1055,DSORG=PS)
//*
//* *******************************************************************
//* Step   2 of 2  Execute the program.
//*
//NBRTYPX1 EXEC PGM=NBRTYPC1,PARM='SYSOUT(BOTH)'
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//*            The following DD statement is for the logging file.
//SYSLOG   DD  DSN=SIMOTIME.DATA.SYSLOGT1,DISP=(NEW,CATLG,CATLG),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=V,LRECL=1055,DSORG=PS)
//*            The following DD statement is SYSOUT and is used when
//*            the COBOL program does a Display.
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section Bash Script, Linux and GnuCOBOL

The following is the Bash Shell Script (nbrtyps1.sh) that is required to run as a job on a Linux or UNIX System. For this test case the COBOL programs were compiled and executed on a Linux (Ubuntu) System using GnuCOBOL.

#!/bin/bash
   JOBNAME=nbrtyps1
#  * *******************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2018 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  * *******************************************************************
#  *
#  * Text    - Numeric Types used by Mainframe System and COBOL
#  * Author  - SimoTime Technologies
#  * Date    - November 11, 2003
#  * Version - 06.07.16
#  *
#  * This set of programs illustrates the use of some of the commonly
#  * used numeric formats. It will show actual hex-dump content of
#  * the fields along with the field length for the display format
#  * (actual digits), the packed format (COMP-3) and the binary (COMP)
#  * formats.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.txt);
   do
#      # * The following statement will replace all occurences
#      # * of DL_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//DL_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of BASHUSER_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/DL_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "#  $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "************************************************************$JOBNAME"
   simonote.sh "# Starting Job Name $JOBNAME"
   simonote.sh "# SIMOSYS1........... $BASESYS1"
   simonote.sh "# SIMONOTE........... $SIMONOTE"
   simonote.sh "# COB_LIBS........... $COB_LIBS"
   simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
#  *
#  * ********************************************************************
#  * Step 2 of 3, Run the program.
#  *
   export USERLOG=$BASESYS1/SIMOSAM1/DEVL/LOGS/SYSOUT_USERPROG_NBRTYPC1.txt
   simonote.sh "# DATAMAKE is $USERLOG"
   cobcrun NBRTYPC1 | tee $USERLOG
   rc=$?
   if [ $rc != 0 ]
   then
      simonote.sh "# ABENDING $name - Return Code is $rc"
      JOBSTATUS=$rc
   else
      ((AOK_Count++))
   fi
#  *
#  * ********************************************************************
#  * Step 3 of 3, End of Job Processing.
#  *
     if [ "$JOBSTATUS" = "0" ]
     then
        simonote.sh "# DATAMAKE is $USERLOG"
        simonote.sh "# Finished Job Name $JOBNAME"
     else
        simonote.sh "# ABENDING Job Name $JOBNAME"
     fi


Table of Contents Previous Section Next Section COBOL Test Program

This program (NBRTYPC1.cbl) was written to test and scan a numeric field for numeric values or digits.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    NBRTYPC1.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      * Copyright (C) 1987-2019 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 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.                                                 *
      *                                                               *
      * 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.                                                 *
      *                                                               *
      * 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: NBRTYPC1.CBL
      *****************************************************************
      *
      * NBRTYPC1 - Numeric formats for COBOL.
      *
      *
      * DESCRIPTION
      * -----------
      * This set of programs is used to show the various numeric
      * format used by the COBOL Program Language.
      *
      * This program illustrates the use of some of the commonly
      * used numeric formats. It will show actual hex-dump content of
      * the fields along with the field length for the display format
      * (actual digits), the packed format (COMP-3) and the binary
      * (COMP)
      * formats.
      *
      * The COBOL programs are compiled with the ASSIGN(EXTERNAL)
      * directive. This provides for external file mapping of file
      * names.
      *
      * When running with Net Express the IBMCOMP an NOTRUNC directives
      * will be required to maintain compatability with the mainframe
      * format and field sizes for binary fields.
      *
      * This technique provides for the use of a single COBOL source
      * program that will run on OS/390, Windows or Unix.
      *
      * This program will run on a Personal Computer with Windows
      * and Micro Focus Net Express or Mainframe Express.
      *
      * This program will also run on an IBM Mainframe.
      *
      *****************************************************************
      *
      * MAINTENANCE
      * -----------
      * 1996/03/15 Simmons, Created program.
      * 1996/03/15 Simmons, No changes to date.
      *
      *****************************************************************
      *
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
      *****************************************************************
      *    Data-structure for Title and Copyright...
      *    ------------------------------------------------------------
       01  SIM-TITLE.
           05  T1 pic X(11) value '* NBRTYPC1 '.
           05  T2 pic X(34) value 'Numeric Field Formats for COBOL   '.
           05  T3 pic X(10) value ' v11.12.19'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* NBRTYPC1 '.
           05  C2 pic X(20) value 'Copyright 1987-2019 '.
           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 '* NBRTYPC1 '.
           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 '* NBRTYPC1 '.
           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'.

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

      *****************************************************************
      *    Coding techniques for various numeric formats...
      *    ------------------------------------------------------------
      *    The following shows the full syntax for ZONED-DECIMAL
       01  ZONE-DECIMAL-UNSIGN     pic 9(5)  USAGE IS DISPLAY.
      *    However, it is usually coded as follows.
       01  ZONE-DECIMAL-UNSIGN-2   PIC 9(5).
      *    For Working Storage fields a value clause may be added to
      *    minimize or avoid the occurence of a "S0C7" or an error
      *    message of "Invalid value in numeric field" followed
      *    by a program ABEND. The value clause will cause the field
      *    to contain all ZEROES when the program is loaded. If the
      *    value clause is not used as follows the numeric field may
      *    contain spaces.
       01  ZONE-DECIMAL-UNSIGN-2   PIC 9(5) VALUE 0.

      *    ------------------------------------------------------------
      *    The following is the full syntax for PACKED-DECIMAL.
       01  PACK-DECIMAL-UNSIGN     pic 9(5)  USAGE IS COMPUTATIONAL-3.
      *    However, it is usually coded as follows. The VALUE clause
      *    is optional and will initialize the field to ZEROES when
      *    the program is started.
       01  PACK-DECIMAL-UNSIGN-2   pic 9(5)  COMP-3 VALUE 0.

      *    ------------------------------------------------------------
      *    The following is the full syntax for BINARY or COMP field.
       01  BINARY-UNSIGN           pic 9(5)  USAGE IS COMPUTATIONAL.
      *
      *    However, it is usually coded as follows. The VALUE clause
      *    is optional and will initialize the field to ZEROES when
      *    the program is started.
       01  BINARY-UNSIGN-2         pic 9(5)  COMP VALUE 0.

      *****************************************************************
      *    Various numeric formats used by COBOL...
      *    ------------------------------------------------------------
       01  UNSIGNED-123            pic 9(5)            value 123.
       01  UNSIGNED-123-X          REDEFINES   UNSIGNED-123
                                   pic X(5).

       01  PLUS-123                pic S9(5)           value +123.
       01  PLUS-123-X              REDEFINES   PLUS-123
                                   pic X(5).
       01  PLUS-123-PACKED         pic S9(5)   COMP-3  value +123.
       01  PLUS-123-PACKED-X       REDEFINES   PLUS-123-PACKED
                                   pic X(3).
       01  PLUS-123-BINARY         pic S9(5)   BINARY  value +123.
       01  PLUS-123-BINARY-X       REDEFINES   PLUS-123-BINARY
                                   pic X(4).

       01  PLUS-123-SL             pic S9(5)           value +123
                                   SIGN LEADING.
       01  PLUS-123-SL-X           REDEFINES   PLUS-123-SL
                                   pic X(5).
       01  PLUS-123-ST             pic S9(5)           value +123
                                   SIGN TRAILING.
       01  PLUS-123-ST-X           REDEFINES   PLUS-123-ST
                                   pic X(5).

       01  PLUS-123-SLS            pic S9(5)           value +123
                                   SIGN LEADING SEPARATE.
       01  PLUS-123-SLS-X          REDEFINES   PLUS-123-SLS
                                   pic X(6).
       01  PLUS-123-STS            pic S9(5)           value +123
                                   SIGN TRAILING SEPARATE.
       01  PLUS-123-STS-X          REDEFINES   PLUS-123-STS
                                   pic X(6).

       01  MINUS-123               pic S9(5)           value -123.
       01  MINUS-123-X             REDEFINES   MINUS-123
                                   pic X(5).
       01  MINUS-123-PACKED        pic S9(5)   COMP-3  value -123.
       01  MINUS-123-PACKED-X      REDEFINES   MINUS-123-PACKED
                                   pic X(3).
       01  MINUS-123-BINARY        pic S9(5)   BINARY  value -123.
       01  MINUS-123-BINARY-X      REDEFINES   MINUS-123-BINARY
                                   pic X(4).

       01  MINUS-123-SL            pic S9(5)           value -123
                                   SIGN LEADING.
       01  MINUS-123-SL-X          REDEFINES   MINUS-123-SL
                                   pic X(5).
       01  MINUS-123-ST            pic S9(5)           value -123
                                   SIGN TRAILING.
       01  MINUS-123-ST-X          REDEFINES   MINUS-123-ST
                                   pic X(5).

       01  MINUS-123-SLS           pic S9(5)           value -123
                                   SIGN LEADING SEPARATE.
       01  MINUS-123-SLS-X         REDEFINES   MINUS-123-SLS
                                   pic X(6).
       01  MINUS-123-STS           pic S9(5)           value -123
                                   SIGN TRAILING SEPARATE.
       01  MINUS-123-STS-X         REDEFINES   MINUS-123-STS
                                   pic X(6).

       01  FIELD-LENGTH            pic 9(3)    value 0.
       01  FIELD-LENGTH-X          REDEFINES   FIELD-LENGTH
                                   pic X(3).
       01  LENGTH-OF-FIELDS.
           05  FILLER              pic X(7)    value 'Digits='.
           05  DIGITS-LENGTH       pic 9(3)    value 0.
           05  FILLER              pic X(8)    value ' Packed='.
           05  PACKED-LENGTH       pic 9(3)    value 0.
           05  FILLER              pic X(8)    value ' Binary='.
           05  BINARY-LENGTH       pic 9(3)    value 0.
           05  FILLER              pic X       value SPACE.
           05  FILLER              pic X       value SPACE.
           05  FIELD-NAME          pic X(32).
           05  FILLER              pic X(2)    value SPACES.

       01  NBR-01-DIGITS pic 9            value 1.
       01  NBR-01-PACKED pic 9     COMP-3 value 1.
       01  NBR-01-BINARY pic 9     COMP   value 1.

       01  NBR-02-DIGITS pic 9(02)        value 12.
       01  NBR-02-PACKED pic 9(02) COMP-3 value 12.
       01  NBR-02-BINARY pic 9(02) COMP   value 12.

       01  NBR-03-DIGITS pic 9(03)        value 123.
       01  NBR-03-PACKED pic 9(03) COMP-3 value 123.
       01  NBR-03-BINARY pic 9(03) COMP   value 123.

       01  NBR-04-DIGITS pic 9(04)        value 1234.
       01  NBR-04-PACKED pic 9(04) COMP-3 value 1234.
       01  NBR-04-BINARY pic 9(04) COMP   value 1234.

       01  NBR-05-DIGITS pic 9(05)        value 12345.
       01  NBR-05-PACKED pic 9(05) COMP-3 value 12345.
       01  NBR-05-BINARY pic 9(05) COMP   value 12345.

       01  NBR-06-DIGITS pic 9(06)        value 123456.
       01  NBR-06-PACKED pic 9(06) COMP-3 value 123456.
       01  NBR-06-BINARY pic 9(06) COMP   value 123456.

       01  NBR-07-DIGITS pic 9(07)        value 1234567.
       01  NBR-07-PACKED pic 9(07) COMP-3 value 1234567.
       01  NBR-07-BINARY pic 9(07) COMP   value 1234567.

       01  NBR-08-DIGITS pic 9(08)        value 12345678.
       01  NBR-08-PACKED pic 9(08) COMP-3 value 12345678.
       01  NBR-08-BINARY pic 9(08) COMP   value 12345678.

       01  NBR-09-DIGITS pic 9(09)        value 123456789.
       01  NBR-09-PACKED pic 9(09) COMP-3 value 123456789.
       01  NBR-09-BINARY pic 9(09) COMP   value 123456789.

       01  NBR-10-DIGITS pic 9(10)        value 1234567890.
       01  NBR-10-PACKED pic 9(10) COMP-3 value 1234567890.
       01  NBR-10-BINARY pic 9(10) COMP   value 1234567890.

       01  NBR-11-DIGITS pic 9(11)        value 12345678901.
       01  NBR-11-PACKED pic 9(11) COMP-3 value 12345678901.
       01  NBR-11-BINARY pic 9(11) COMP   value 12345678901.

       01  NBR-12-DIGITS pic 9(12)        value 123456789012.
       01  NBR-12-PACKED pic 9(12) COMP-3 value 123456789012.
       01  NBR-12-BINARY pic 9(12) COMP   value 123456789012.

       01  NBR-13-DIGITS pic 9(13)        value 1234567890123.
       01  NBR-13-PACKED pic 9(13) COMP-3 value 1234567890123.
       01  NBR-13-BINARY pic 9(13) COMP   value 1234567890123.

       01  NBR-14-DIGITS pic 9(14)        value 12345678901234.
       01  NBR-14-PACKED pic 9(14) COMP-3 value 12345678901234.
       01  NBR-14-BINARY pic 9(14) COMP   value 12345678901234.

       01  NBR-15-DIGITS pic 9(15)        value 123456789012345.
       01  NBR-15-PACKED pic 9(15) COMP-3 value 123456789012345.
       01  NBR-15-BINARY pic 9(15) COMP   value 123456789012345.

       01  NBR-16-DIGITS pic 9(16)        value 1234567890123456.
       01  NBR-16-PACKED pic 9(16) COMP-3 value 1234567890123456.
       01  NBR-16-BINARY pic 9(16) COMP   value 1234567890123456.

       01  NBR-17-DIGITS pic 9(17)        value 12345678901234567.
       01  NBR-17-PACKED pic 9(17) COMP-3 value 12345678901234567.
       01  NBR-17-BINARY pic 9(17) COMP   value 12345678901234567.

       01  NBR-18-DIGITS pic 9(18)        value 123456789012345678.
       01  NBR-18-PACKED pic 9(18) COMP-3 value 123456789012345678.
       01  NBR-18-BINARY pic 9(18) COMP   value 123456789012345678.

       COPY PASSDUMP.

      *****************************************************************
       PROCEDURE DIVISION.
           perform FIRST-TIME-LOGIC

      *    ------------------------------------------------------------
      *    Example-01, Show the Hex format for a SIMPLE, UNSIGNED
      *    NUMERIC field...
           perform EXAMPLE-01

      *    ------------------------------------------------------------
      *    Example-02, Show the Hex format for a SIMPLE, SIGNED
      *    NUMERIC field...
           perform EXAMPLE-02

      *    ------------------------------------------------------------
      *    Example-03, Show the Hex format for a SIGNED, PACKED,
      *    NUMERIC field...
           perform EXAMPLE-03

      *    ------------------------------------------------------------
      *    Example-04, Show the Hex format for a SIGNED, BINARY,
      *    NUMERIC field...
           perform EXAMPLE-04

      *    ------------------------------------------------------------
      *    Example-05, Show the Hex format for a SIGN, LEADING,
      *    NUMERIC field...
           perform EXAMPLE-05

      *    ------------------------------------------------------------
      *    Example-06, Show the Hex format for a SIGN, TRAILING,
      *    NUMERIC field...
           perform EXAMPLE-06

      *    ------------------------------------------------------------
      *    Example-07, Show the Hex format for a SIGN, LEADING,
      *    SEPARATE, NUMERIC field...
           perform EXAMPLE-07

      *    ------------------------------------------------------------
      *    Example-08, Show the Hex format for a SIGN, TRAILING,
      *    SEPARATE, NUMERIC field...
           perform EXAMPLE-08

      *    ------------------------------------------------------------
      *    Example-09, Show the Specfied size and actual field length.
           perform EXAMPLE-09

           GOBACK.

      *****************************************************************
       DUMP-ASTERISK-ROW.
           move 'NOTE' to SIMODUMP-REQUEST
           move all '*' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
       DUMP-ASTERISK-ROW-2X.
           perform DUMP-ASTERISK-SINGLE
           perform DUMP-ASTERISK-ROW
           exit.

      *****************************************************************
       DUMP-ASTERISK-SINGLE.
           move 'NOTE' to SIMODUMP-REQUEST
           move SPACES to SIMODUMP-BUFFER
           move '*'    to SIMODUMP-BUFFER(1:1)
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show the Hex format for a SIMPLE, UNSIGNED, NUMERIC field...
      *****************************************************************
       EXAMPLE-01.
      *    Prepare to show the Number...
           move 'Task0001' to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
           move 'UNSIGNED-123 PIC 9(5)' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the field...
           move 'DUMP'         to SIMODUMP-REQUEST
           add length of UNSIGNED-123 to ZERO giving SIMODUMP-LENGTH
           move SPACES         to SIMODUMP-BUFFER
           move UNSIGNED-123-X to SIMODUMP-BUFFER
           call 'SIMODUMP'  using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show the Hex format for a SIGNED, NUMERIC field...
      *****************************************************************
       EXAMPLE-02.
      *    Prepare to show the Positive Number...
           move 'Task0002'    to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
           move 'PLUS-123 PIC S9(5)' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Positive Number...
           move 'DUMP'        to SIMODUMP-REQUEST
           add  length of PLUS-123 to ZERO giving SIMODUMP-LENGTH
           move SPACES        to SIMODUMP-BUFFER
           move PLUS-123-X    to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Prepare to show the Negative Number...
           perform DUMP-ASTERISK-SINGLE
           move 'MINUS-123 PIC S9(5)' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Negative Number...
           move 'DUMP'        to SIMODUMP-REQUEST
           add  length of MINUS-123 to ZERO giving SIMODUMP-LENGTH
           move SPACES        to SIMODUMP-BUFFER
           move MINUS-123-X   to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show the Hex format for a SIGNED, PACKED, NUMERIC field...
      *****************************************************************
       EXAMPLE-03.
      *    Prepare to show the Positive Number...
           move 'Task0003'    to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
           move 'PLUS-123-PACKED PIC S9(5) COMP-3' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Positive Number...
           move 'DUMP'        to SIMODUMP-REQUEST
           add  length of PLUS-123-PACKED to ZERO
                giving SIMODUMP-LENGTH
           move SPACES        to SIMODUMP-BUFFER
           move PLUS-123-PACKED-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Prepare to show the Negative Number...
           perform DUMP-ASTERISK-SINGLE
           move 'MINUS-123-PACKED PIC S9(5) COMP-3' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Negative Number...
           move 'DUMP'             to SIMODUMP-REQUEST
           add  length of MINUS-123-PACKED to ZERO
                giving SIMODUMP-LENGTH
           move SPACES             to SIMODUMP-BUFFER
           move MINUS-123-PACKED-X to SIMODUMP-BUFFER
           call 'SIMODUMP'      using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show the Hex format for a SIGNED, BINARY, NUMERIC field...
      *****************************************************************
       EXAMPLE-04.
      *    Prepare to show the Positive Number...
           move 'Task0004' to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
           move 'PLUS-123-BINARY PIC S9(5) BINARY' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Positive Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add  length of PLUS-123-BINARY to ZERO
                giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move PLUS-123-BINARY-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Prepare to show the Negative Number...
           perform DUMP-ASTERISK-SINGLE
           move 'MINUS-123-BINARY PIC S9(5) BINARY' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Negative Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add  length of MINUS-123-BINARY to ZERO
                giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move MINUS-123-BINARY-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show the Hex format for a SIGN, LEADING, NUMERIC field...
      *****************************************************************
       EXAMPLE-05.
      *    Prepare to show the Positive Number...
           move 'Task0005' to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
           move 'PLUS-123-SL PIC S9(5) SIGN LEADING' to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Positive Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add  length of PLUS-123-SL to ZERO giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move PLUS-123-SL-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Prepare to show the Negative Number...
           perform DUMP-ASTERISK-SINGLE
           move 'MINUS-123-SL PIC S9(5) SIGN LEADING'
             to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Negative Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add length of MINUS-123-SL to ZERO giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move MINUS-123-SL-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show the Hex format for a SIGN, TRAILING, NUMERIC field...
      *****************************************************************
       EXAMPLE-06.
      *    Prepare to show the Positive Number...
           move 'Task0006' to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
           move 'PLUS-123-ST PIC S9(5) SIGN TRAILING'
             to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Positive Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add  length of PLUS-123-ST to ZERO giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move PLUS-123-ST-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Prepare to show the Negative Number...
           perform DUMP-ASTERISK-SINGLE
           move 'MINUS-123-ST PIC S9(5) SIGN TRAILING'
             to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Negative Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add length of MINUS-123-ST to ZERO giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move MINUS-123-ST-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show Hex format for a SIGN, LEADING, SEPARATE, NUMERIC field...
      *****************************************************************
       EXAMPLE-07.
      *    Prepare to show the Positive Number...
           move 'Task0007' to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
           move 'PLUS-123-SLS PIC S9(5) SIGN LEADING SEPARATE'
             to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Positive Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add  length of PLUS-123-SLS to ZERO giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move PLUS-123-SLS-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Prepare to show the Negative Number...
           perform DUMP-ASTERISK-SINGLE
           move 'MINUS-123-SLS PIC S9(5) SIGN LEADING SEPARATE'
             to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Negative Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add  length of MINUS-123-SLS to ZERO giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move MINUS-123-SLS-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show Hex format for a SIGN, TRAILING, SEPARATE, NUMERIC field.
      *****************************************************************
       EXAMPLE-08.
      *    Prepare to show the Positive Number...
           move 'Task0008' to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
           move 'PLUS-123-STS PIC S9(5) SIGN TRAILING SEPARATE'
             to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Positive Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add length of PLUS-123-STS to ZERO giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move PLUS-123-STS-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Prepare to show the Negative Number...
           perform DUMP-ASTERISK-SINGLE
           move 'MINUS-123-STS PIC S9(5) SIGN TRAILING SEPARATE'
             to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
      *    Show the hexadecimal content of the Negative Number...
           move 'DUMP' to SIMODUMP-REQUEST
           add length of MINUS-123-STS to ZERO giving SIMODUMP-LENGTH
           move SPACES to SIMODUMP-BUFFER
           move MINUS-123-STS-X to SIMODUMP-BUFFER
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           exit.

      *****************************************************************
      * Show the Specfied size and actual field length.
      *****************************************************************
       EXAMPLE-09.
           move 'Task0009' to SIMODUMP-DUMP-ID
           perform DUMP-ASTERISK-ROW-2X
      *
           add length of NBR-01-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-01-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-01-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-01 Field Sizes for PIC 9' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-02-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-02-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-02-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-02 Field Sizes for PIC 99' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-03-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-03-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-03-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-03 Field Sizes for PIC 999' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-04-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-04-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-04-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-04 Field Sizes for PIC 9(4)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-05-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-05-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-05-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-05 Field Sizes for PIC 9(5)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-06-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-06-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-06-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-06 Field Sizes for PIC 9(6)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-07-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-07-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-07-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-07 Field Sizes for PIC 9(7)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-08-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-08-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-08-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-08 Field Sizes for PIC 9(8)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-09-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-09-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-09-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-09 Field Sizes for PIC 9(9)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-10-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-10-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-10-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-10 Field Sizes for PIC 9(10)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-11-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-11-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-11-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-11 Field Sizes for PIC 9(11)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-12-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-12-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-12-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-12 Field Sizes for PIC 9(12)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-13-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-13-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-13-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-13 Field Sizes for PIC 9(13)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-14-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-14-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-14-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-14 Field Sizes for PIC 9(14)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-15-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-15-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-15-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-15 Field Sizes for PIC 9(15)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-16-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-16-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-16-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-16 Field Sizes for PIC 9(16)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-17-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-17-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-17-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-17 Field Sizes for PIC 9(17)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           add length of NBR-18-DIGITS to ZERO giving DIGITS-LENGTH
           add length of NBR-18-PACKED to ZERO giving PACKED-LENGTH
           add length of NBR-18-BINARY to ZERO giving BINARY-LENGTH
           move 'NBR-18 Field Sizes for PIC 9(18)' to FIELD-NAME
           move LENGTH-OF-FIELDS to SIMODUMP-BUFFER
           perform Z-POST-NOTE-AND-CLEAR
      *
           perform DUMP-ASTERISK-ROW
      *
           exit.

      *****************************************************************
       FIRST-TIME-LOGIC.
           perform Z-POST-COPYRIGHT.
           move 'DUMP' to SIMODUMP-REQUEST
           move 'OUT2' to SIMODUMP-OUTPUT
           move 'HIDE' to SIMODUMP-COPYRIGHT
           exit.

      *****************************************************************
      * The following Z-Routines perform administrative tasks         *
      * for this program.                                             *
      *****************************************************************
       Z-POST-CONSOLE-MESSAGE.
           display MESSAGE-BUFFER upon console
           move SPACES to MESSAGE-TEXT
           exit.

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

      *****************************************************************
       Z-POST-NOTE-AND-CLEAR.
           move 'NOTE' to SIMODUMP-REQUEST
           call 'SIMODUMP' using SIMODUMP-PASS-AREA SIMODUMP-BUFFER
           move SPACES to SIMODUMP-BUFFER
           exit.

      *****************************************************************
       Z-THANK-YOU.
           display SIM-THANKS-01 upon console
           display SIM-THANKS-02 upon console
           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 Summary

This suite of example programs will describe the format and size of some of the commonly used numeric fields of the COBOL programming language. This document may be used to assist 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 Downloads and Links

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

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

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

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

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

Link to Internet   Link to Server   Explore the Numbers Connection for additional information about the structure and processing of numeric data items (or numeric fields).

Link to Internet   Link to Server   Explore The Binary or COMP format for numeric data strings. This numeric structure is supported by COBOL and may be explicitly defined with the "USAGE IS COMP" or "USAGE IS BINARY" clause.

Link to Internet   Link to Server   Explore The Edited for Display format for numeric data strings. This numeric structure is supported by COBOL and may be used with an edit-mask to prepare the presentation for readability by human beings.

Link to Internet   Link to Server   Explore The Packed-Decimal or COMP-3 format for numeric data strings. This numeric structure is supported by COBOL and may be explicitly defined with the "USAGE IS COMP-3" clause.

Link to Internet   Link to Server   Explore The Zoned-Decimal format for numeric data strings. This numeric structure is the default numeric for COBOL and may be explicitly defined with the "USAGE IS DISPLAY" clause.

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

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

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes 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.

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 (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

Explore the GnuCOBOL Technologies available from SourceForge. SourceForge is an Open Source community resource dedicated to helping open source projects be as successful as possible. GnuCOBOL (formerly OpenCOBOL) is a COBOL compiler with run time support. The compiler (cobc) translates COBOL source to executable using intermediate C, designated C compiler and linker. This link will require 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 Contact 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
Various Numeric formats for the COBOL Programming Language
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com