The Numbers Connection
Managing the Numeric Formats
  Table of Contents  v-16.01.01 - indexnum.htm 
  Introduction
  Overview of Numeric Formats
  Binary Format
  Packed Decimal Format
  Zoned Decimal Format
  Edited Numeric Format
  The Micro Focus Environment
  Compiler Directives
  EBCDIC and ASCII Encoding
  Developer & Microsoft Visual Studio
  Mainframe Subsystem Support
  Managing Numeric Fields
  Internal Numeric Structures
  Right-Adjust and Zero-Fill
  Commonly Used Formats and Sizes
  Testing or Scanning
  Printing and Editing
  Leading Spaces and Zeroes
  Managing Numeric Content
  Validate Numeric Integrity
  COMP, COMP-3 & COMP-5 Formats
  Numeric Field Analysis, HEX-Dump
  Packed Numeric Field with Spaces
  Zoned-Decimal, Non-Numeric Values
  Converting Numeric Formats
  Typical Convert with Hex-Dump
  Numeric Conversion using COBOL
  Packed & Binary to Text Strings
  CSV & Fixed-Field-Length Formats
  Numbers to Words or Digits to Text
  Zoned-Decimal with High-Values
  Validation & Summary Totals
  Record Counts and Summary Totals
  Packed-Decimal Fields
  Zoned-Decimal Fields
  Possibilities and Considerations
  S0C7 or RTS-163
  Numeric Conversion Techniques
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview

Table of Contents Previous Section Next Section Introduction

The Numbers Connection provides links to other documents that demonstrate and describe the techniques and processes for managing the various numeric formats used on an IBM Mainframe or the Micro Focus COBOL environments.


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-2017
SimoTime Technologies
All Rights Reserved

Table of Contents Previous Section Next Section Overview of Numeric Formats

This section provides an overview of the most commonly used numeric formats with links for additional detailed information and white papers.

Table of Contents Previous Section Next Section Binary Format

This document describes the binary format. This numeric field format is coded in COBOL as "USAGE IS COMPUTATIONAL" and is usually coded in its abbreviated form of COMP. This may also be coded with the keyword BINARY.

For additional detail refer to the Binary Field Format documentation available on the SimoTime web site.

Table of Contents Previous Section Next Section Packed Decimal Format

This document describes the packed-decimal format. This numeric field format is coded in COBOL as "USAGE IS COMPUTATIONAL-3" and is usually coded in its abbreviated form of COMP-3.

For additional detail refer to the Packed-Decimal Field Format documentation available on the SimoTime web site.

Table of Contents Previous Section Next Section Zoned Decimal Format

This document describes the zoned-decimal format. This numeric field type is coded in COBOL as "USAGE IS DISPLAY" and is the default format if the USAGE clause is missing.

For additional detail refer to the Zoned-Decimal Field Format documentation available on the SimoTime web site.

Table of Contents Previous Section Next Section Edited Numeric Format

This document describes the edited numeric format. This is coded in COBOL using an "edit mask" in the picture clause. An example would be PIC ZZZ.99+.

For additional detail refer to the Edited-Numeric Field Format documentation available on the SimoTime web site.

Table of Contents Previous Section Next Section The Micro Focus Environment

Management (i.e. processing, storage and retrieval) of the various numeric formats has been and continues to be a challenge on the mainframe. When transferring data files that contain the various numeric formats from the Mainframe to a Windows or UNIX platform the challenges are transferred along with the files.

Table of Contents Previous Section Next Section Compiler Directives

Micro Focus (on the Windows, Linux and UNIX platforms) offers a number of COBOL compiler directives to help deal with the challenges of managing the various numeric formats.

The sequence in which the directives are specified is also important since some directives will set other directives. For example, the DIALECT directive that specifies a mainframe dialect will set CHARSET(EBCDIC). If the desired encoding is ASCII then the CHARSET(ASCII) directive must follow the DIALECT directive.

For additional detail refer to the Compiler Directives for Micro Focus documentation available on the SimoTime web site.

Table of Contents Previous Section Next Section EBCDIC and ASCII Encoding

When converting data files from a Mainframe EBCDIC-encoded format to a Micro Focus ASCII-encoded file format the packed (or COMP-3) and binary (or COMP) fields do not need to be converted because they are identical in either encoding scheme. The unsigned, zoned decimal is a simple conversion of the digits between EBCDIC and ASCII. The signed, zoned decimal requires special conversion for the units (or signed) position. This is explained in more detail in a separate document.

For additional detail refer to the Zoned Decimal Format section within this document

Table of Contents Previous Section Next Section Developer & Microsoft Visual Studio

Micro Focus Enterprise Developer provides a program development and support environment for COBOL-oriented applications that uses the Microsoft Visual Studio Integrated Development Environment (IDE).

Explore The Micro Focus Web Site for more information about products and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Mainframe Subsystem Support

Micro Focus Studio provides a Mainframe Subsystem Support (MSS) configuration option that provides a user with the capability of moving an application that is currently running in a JES/2 or CICS environment on a mainframe to a Windows, Linux or UNIX system.

Explore The Enterprise System Model for additional information about defining, creating and managing the Environments, Processes, Functions and Data that are needed (required) to expand the platform flexibility and allow a business application currently running on a mainframe system to run on a Windows, UNIX or Linux system using Micro Focus Server Enterprise Edition.

Table of Contents Previous Section Next Section Managing Numeric Fields

This section provides links to sample programs that process, convert, print or export numeric data items that are stored in a variety of formats.

Table of Contents Previous Section Next Section Internal Numeric Structures

This suite of example programs will describe the various numeric formats and their internal structures. The examples will also show how numeric fields may be converted from one format to another in preparation for printing, displaying or exporting to a non-mainframe or non-COBOL environment. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Right-Adjust and Zero-Fill

This suite of programs provides an example of a routine that will Right-Adjust a text string within a field and fill the left-most or high-order bytes with zeroes. The resulting field is also tested for numeric values and a return code (RA12-RESPOND) is set to zero (0) if numeric and eight (8) if not numeric. Two COBOL programs are provided. The first program is a demonstration program that reads a file containing "RIGHTADJ-info" records and calls the second COBOL program that actually does the right-adjust, zero-fill processing. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Commonly Used Formats and Sizes

This suite of example programs will describe the use, 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 COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Testing or Scanning

This program suite provides an example of how a COBOL program can test a numeric field for a numeric value or scan a numeric field using reference modification. An example of doing an arithmetic compare of two numeric values of different numeric formats and size is included. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Printing and Editing

This suite of example programs will describe how to prepare various numeric fields (i.e. packed or COMP-3, binary or COMP and signed, zoned decimal or USAGE IS DISPLAY) for printing. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Leading Spaces and Zeroes

This suite of example programs (COBOL, JCL and CMD files) will describe the process to compile and execute a COBOL program that is downloaded from a mainframe. The challenge with this program is that it is expected to process the various numeric items in the same manner as the mainframe. For example, a zoned-decimal field that contains leading spaces should not cause an ABEND (i.e. 163 error on Micro Focus) but should treat the leading spaces as zeroes and complete the arithmetic calculation. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Managing Numeric Content

This section provides links to sample programs that access and process numeric data items that are stored in a variety of formats that are supported by the COBOL programming language.

Table of Contents Previous Section Next Section Validate Numeric Integrity

This suite of programs and documentation will describe and demonstrate how to do regression testing or user acceptance testing of non-relational data structures that contain numeric values that are stored in a variety of different formats. The techniques used may be used to validate a complete and successful transfer of data files between systems.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section COMP, COMP-3 & COMP-5 Formats

This suite of programs provides an example of how to convert between the various numeric formats used with COBOL and on an IBM Mainframe System. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Field Analysis, HEX-Dump

This program is used to show techniques for analyzing, testing and viewing the content of numeric fields. It will show the actual hex-dump content of the fields. The COBOL programs are written using the COBOL/2 dialect but also work with Enterprise COBOL.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Packed Numeric Field with Spaces

This document (with sample programs) describes the anomalies of working with packed numeric fields that contain spaces. The suite of programs will build test data and discuss techniques for managing packed numeric fields and displaying a field in a hexadecimal dump format.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Zoned-Decimal, Non-Numeric Values

This document will use examples to show how to manage a situation where non-numeric values are placed in a field that is defined as Zoned-Decimal. This document will describe and demonstrate how to avoid the S0C7 or RTS163 error and obtain the desired business result.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Converting Numeric Formats

This section provides links to sample programs that process, convert, print or export a variety of numeric data items that are stored in a variety of formats.

Table of Contents Previous Section Next Section Typical Convert with Hex-Dump

This document (with sample programs) describes and demonstrates some of the challenges of moving data files between a Mainframe System and a Windows System. A data file with records containing text strings and numeric fields (Binary, Packed-Decimal and Zoned Decimal) will be converted between EBCDIC and ASCII while maintaining mainframe numeric integrity. The sample programs will show techniques for displaying a record in a hexadecimal dump format. The COBOL programs are generated using SimoTime Technologies and may be compiled and executed on a Mainframe System with ZOS or a Windows System with Micro Focus Enterprise Developer.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Conversion using COBOL

This document (with sample programs) describes the internal format of the COMP, COMP-3 and COMP-5 numeric fields. The sample program will show techniques for displaying a field in a hexadecimal dump format. The COBOL programs are written using the Micro Focus dialect.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Packed & Binary to Text Strings

This suite of test programs describes how to extract data from an ASCII-encoded, record sequential file. The numeric fields will be expanded (Packed or Binary) into text strings with an explicit decimal point and a separate sign character. The trailing spaces within the original text fields will be truncated. A new record will be constructed with the fields being concatenated and separated by a comma. The newly constructed records will be written to a sequential file.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section CSV & Fixed-Field-Length Formats

This suite of programs provides an example of how to convert variable-length, display-oriented numeric values separated by a delimiter character (Comma-Separated-Value) into data strings of a fixed field length format. The fixed field length may be signed or unsigned values in a display, packed or binary format. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numbers to Words or Digits to Text

This suite of programs provides an example of how a COBOL program calls a COBOL routine to create a 150-character text data string from a 12-digit numeric field. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Zoned-Decimal with High-Values

This document will use examples to show how to manage a situation where non-numeric values (such as high-values or X'FF') are intentionally placed in a field that is defined as Zoned-Decimal and then properly managed to obtain the desired business result.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Note:  This situation typically requires an extra effort when converting between EBCDIC and ASCII encoding schemas.

Table of Contents Previous Section Next Section Validation & Summary Totals

This section provides information for regression testing and the validation of the content of numeric fields.

Table of Contents Previous Section Next Section Record Counts and Summary Totals

This suite of programs and documentation will describe and demonstrate an approach for reading a file, calculating record counts and producing summary totals for a set of pre-defined numeric fields. The approach uses two COBOL programs that were generated using SimoTime technology. The programs are generated on a Windows System with Micro Focus COBOL and may be compiled and executed on an IBM Mainframe or a Linux, UNIX or Windows System with Micro Focus COBOL.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Packed-Decimal Fields

This suite of programs and documentation will describe and demonstrate how to Calculate a Record Count and Accumulate Summary Totals by reading a Record Sequential Data File. Each record contains numeric fields with a packed-decimal (COMP-3) format. The count and totals will be posted to the SYSOUT device. The programs were generated using SimoTime Technologies.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Zoned-Decimal Fields

This suite of programs and documentation will describe and demonstrate how to Calculate a Record Count and Accumulate Summary Totals by reading a Record Sequential Data File. Each record contains numeric fields with a zoned-decimal (USAGE IS DISPLAY) format. The count and totals will be posted to the SYSOUT device. The programs were generated using SimoTime Technologies.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Possibilities and Considerations

This section provides information about additional Considerations and some coding techniques that may be used when processing numeric fields.

Table of Contents Previous Section Next Section S0C7 or RTS-163

On the mainframe a program check interrupt 7 (or S0C7 that is often referred to as a Sock-Seven error) occurs when attempting to process a numeric field when the field contains non-numeric characters. In the Micro Focus environment an RTS-163 (Run Time System) error occurs. In both cases the program is abnormally terminated (ABEND's).

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Conversion Techniques

With COBOL it is very simple to convert between the various numeric formats. Simply use the Working Storage definitions of the fields and move from one format to the other. The conversion will take place during the move process.

The following links provide additional detail about converting between numeric formats when the number of decimal positions are different or rounding is required.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Summary

The Numbers Connection provides links to other documents that demonstrate and describe the techniques and processes for managing the various numeric formats used on an IBM Mainframe or the Micro Focus COBOL environments.

This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives.

The documentation and software were developed and tested on systems that are configured for a SimoTime environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SimoTime Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SimoTime Services or Technologies please send an e-mail to: helpdesk@simotime.com or call 415 883-6565. We appreciate hearing from you.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

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

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

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

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

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

Link to Internet   Link to Server   Explore 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 COBOL Connection for more examples of COBOL programming techniques and sample code.

Link to Internet   Link to Server   Explore the CICS Connection for more examples of mainframe CICS coding techniques and sample code.

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 non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.

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

Link to Internet   Link to Server   Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Comments or Feedback

This document was created and is copyrighted and maintained by SimoTime Technologies.

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

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
The Numbers Connection, Managing the Numeric Formats
Copyright © 1987-2017
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com