The Numbers Connection Managing the Numeric Formats |
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-2025
SimoTime Technologies and Services
All Rights Reserved
This section provides an overview of the most commonly used numeric formats with links for additional detailed information and white papers.
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.
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.
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.
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.
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.
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.
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
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 (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.
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.
This section provides links to sample programs that process, convert, print or export numeric data items that are stored in a variety of formats.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This document will describe and demonstrate how to process data strings containing numeric values. The processing techniques will create, convert and view in a Hex Dump format. The numeric formats include Zoned Decimal (USAGE IS DISPLAY), Packed Decimal (USAGE IS COMP-3) and Binary (USAGE IS COMP). These numeric formats are commonly used on IBM Mainframe Systems or application programs that were created using the COBOL programming language.
For additional detail refer to the documentation for the Structure & Conversion of Numeric Values that is available on the SimoTime web site.
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.
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.
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.
This group of test programs describes how to extract (or convert) numeric 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.
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.
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.
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.
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.
The following will discribe and demonsttrate how to use and combine the basic and advanced functions of the data conversion technologies and implementation techniques.
This is the Run Book for the TCNBRS01 Test Case. This test case will describe and demonstrate the process of converting an EBCDIC-encoded, Record Sequential file to an ASCII/Text file. The convert process includes file format, record content and field format conversion. This test case will describe and demonstrate how to identify and convert text strings between EBCDIC and ASCII and how to identify, expand and convert numeric values that are formatted as Signed-Zoned-Decimal, Packed-Decimal or Binary.
This is the System Information Manual for the TCNBRS01 Test Case. This test case will convert the file format, record content and record structure of an EBCDIC-encoded file that was created and transferred from an IBM Mainframe System to a format and structure that may be easily imported and accessed from within an ASCII-oriented relational data base or a spread sheet using Excel or LibreOffice Calc.
This section provides information for regression testing and the validation of the content of numeric fields.
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.
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.
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.
This section provides information about additional Considerations and some coding techniques that may be used when processing numeric fields.
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.
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.
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 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.
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.
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.
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 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 icon.
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.
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.
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.
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.
Explore a test case that will share and process files across a network of systems that include IBM Mainframes, Linux or Windows. The test data contains text strings and numeric values that are stored in packed-decimal (or COMP-3) format. The record structure and generated HTML document for this file are based on a User-Supplied COBOL copyfile.
The text data strings will be converted between ASCII and EBCDIC. The numeric strings will be converted between packed-decimal and zoned-decimal (or alphanumeric) formats.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
Explore the CICS Connection for more examples of mainframe CICS coding techniques and sample code.
Explore the JCL Connection for more examples of JCL functionality with programming techniques and sample code.
Explore the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.
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.
Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.
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 (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.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
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.
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-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |