Packed Decimal Numbers
COBOL Definition and Structural Analysis
  Table of Contents  v-24.01.01 - nvfmtspd.htm 
  Introduction
  What it Does
  How to Use
  Signed-Decimal Numeric Values
  Signed-Mixed Numeric Values
  Signed-Whole Numeric Values
  Unsign-Decimal Numeric Values
  Unsign-Mixed Numeric Values
  Unsign-Whole Numeric Values
  Ancillary Functions
  Peek at Record Content
  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

The purpose of this document is to provide information about a Quality Assurance Test Case that focuses on SIMOTIME Technologies that manage data files with record structures that contain alphameric Text Strings that are stored using EBCDIC or ASCII encoding and Numeric Values that are stored in a Packed-Decimal format.

This document will focus on a discussion of numeric fields (or data strings that contain numeric values) that are defined as using a "PACKED-DECIMAL" format (also referred to as packed data or a packed numeric field). The Packed-Decimal numeric format is supported by the COBOL programming language. This numeric format has been used for many years on IBM Mainframe Systems. It is supported on Linux, UNIX or Windows (LUW) Systems using COBOL technologies from Micro Focus or GnuCOBOL.

This document will reference a SIMOTIME Test Case to describe and demonstrate the techniques of defining, storing and processing numeric values that use a Packed-Decimal format. Within the scope of this document the following terms may be used instead of the longer definition.

1. Decimal Numeric Values, contains digits after a decimal separator. The numeric values will be greater than a minus one (-1) and less than a plus one (+1).
2. Mixed Numeric Values, contains digits before and after the decimal separator. For this test case the number of digits before and after the decimal separator is limited to 18 digits.
3. Whole Numeric Values, contains digits without a decimal separator or decimal positions. The numeric values will be equal to, greater than or less than zero.

 

Note: A decimal separator may be referred to as a decimal point or a decimal symbol. The position of the decimal separator may be defined (provided in the data definition specification or program) or explicit (embedded in the numeric data string).


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 What it Does

The test case will process files that contain record structures that contain field definitions for text strings and numeric values. The text strings may be EBCDIC or ASCII encoded. The numeric values will use a Packed-Decimal format when storing the data to a record sequential file.

1. Signed Numeric Values for Packed Decimal format.
1.1. Decimal Numeric Values, contains digits after a decimal separator. The numeric values will be greater than a minus one (-1) and less than a plus one (+1).
1.1.1. Record Structure for Decimal Numeric Format is the same for EBCDIC or ASCII encoding schemas. For this test case the records are stored in a record sequential file.
1.1.2. Record Content is different for the EBCDIC or ASCII encoded text strings within the record structure. The numeric format and integrity is maintained for the signed, packed-decimal numeric data.
1.1.2.1. Record Content for EBCDIC encoding schema.
1.1.2.2. Record Content for ASCII encoding schema.
1.2. Mixed Numeric Values, contains digits before and after the decimal separator. For this test case the number of digits before and after the decimal separator is limited to 18 digits.
1.2.1. Record Structure for Mixed Numeric Format is the same for EBCDIC or ASCII encoding schemas. For this test case the records are stored in a record sequential file.
1.2.2. Record Content is different for the EBCDIC or ASCII encoded text strings within the record structure. The numeric format and integrity is maintained for the signed, packed-decimal numeric data.
1.2.2.1. Record Content for EBCDIC encoding schema.
1.2.2.2. Record Content for ASCII encoding schema.
1.3. Whole Numeric Values, contains digits without a decimal separator or decimal positions. The numeric values will be equal to, greater than or less than zero.
1.3.1. Record Structure for Whole Numeric Format is the same for EBCDIC or ASCII encoding schemas. For this test case the records are stored in a record sequential file.
1.3.2. Record Content is different for the EBCDIC or ASCII encoded text strings within the record structure. The numeric format and integrity is maintained for the signed, packed-decimal numeric data.
1.3.2.1. Record Content for EBCDIC encoding schema.
1.3.2.2. Record Content for ASCII encoding schema.
2. Unsign Numeric Values for Packed Decimal format.
2.1. Decimal Numeric Values, contains digits after a decimal separator. The numeric values will be equal to zero (0) and less than a plus one (+1).
2.1.1. Record Structure for Decimal Numeric Format is the same for EBCDIC or ASCII encoding schemas. For this test case the records are stored in a record sequential file.
2.1.2. Record Content is different for the EBCDIC or ASCII encoded text strings within the record structure. The numeric format and integrity is maintained for the unsigned, packed-decimal numeric data.
2.1.2.1. Record Content for EBCDIC encoding schema.
2.1.2.2. Record Content for ASCII encoding schema.
2.2. Mixed Numeric Values, contains digits before and after the decimal separator. For this test case the number of digits before and after the decimal separator is limited to 18 digits.
2.2.1. Record Structure for Mixed Numeric Format is the same for EBCDIC or ASCII encoding schemas. For this test case the records are stored in a record sequential file.
2.2.2. Record Content is different for the EBCDIC or ASCII encoded text strings within the record structure. The numeric format and integrity is maintained for the signed, packed-decimal numeric data.
2.2.2.1. Record Content for EBCDIC encoding schema.
2.2.2.2. Record Content for ASCII encoding schema.
2.3. Whole Numeric Values, contains digits without a decimal separator or decimal positions. The numeric values will be equal to, greater than or less than zero.
2.3.1. Record Structure for Whole Numeric Format is the same for EBCDIC or ASCII encoding schemas. For this test case the records are stored in a record sequential file.
2.3.2. Record Content is different for the EBCDIC or ASCII encoded text strings within the record structure. The numeric format and integrity is maintained for the signed, packed-decimal numeric data.
2.3.2.1. Record Content for EBCDIC encoding schema.
2.3.2.2. Record Content for ASCII encoding schema.

 

Table of Contents Previous Section Next Section How to Use

The test case will use job scripts to perform the functional testing. The job scripts are arranged in two primary groups for Signed and Unsigned Numeric values. Each primary group will contain three secondary groups that will describe and demonstrate numeric values that contain Decimal, Mixed or Whole numeric values. Each of the six (6) groups will contain a minumum of five (5) functional tests for a total of thirty (30).

Note: For this test case the batch job scripts for a Windows System will use Microsoft Command Files (.CMD).

Table of Contents Previous Section Next Section Signed-Decimal Numeric Values

The following links provide additional information about the individual Batch Job Scripts that perform the functional testing.

1. Signed Numeric Values for Signed, Packed-Decimal format. The numeric content will be a decimal number containing digits to the right of a decimal separator.
1.1. PSDE2AW1.cmd - Convert EBC to ASC and maintain numeric formatting
1.2. PSDA2EW1.cmd - Convert ASC to EBC and maintain numeric formatting
1.3. PSDHXDW3.cmd - Review File Content (Hex Dump for Human review)
1.4. PSDEXTW1.cmd - Export Record Sequential ASC to Line Sequential CSV
1.5. PSDIMPW2.cmd - Import Line Sequential CSV to Record Sequential ASC

 

Table of Contents Previous Section Next Section Signed-Mixed Numeric Values

The following links provide additional information about the individual Batch Job Scripts that perform the functional testing.

1. Signed Numeric Values for Signed, Packed-Decimal format. The numeric content will be a mixed number containing digits to the left and right of a decimal separator.
1.1. PSME2AW1.cmd - Convert EBC to ASC and maintain numeric formatting
1.2. PSMA2EW1.cmd - Convert ASC to EBC and maintain numeric formatting
1.3. PSMHXDW3.cmd - Review File Content (Hex Dump for Human review)
1.4. PSMEXTW1.cmd - Export Record Sequential ASC to Line Sequential CSV
1.5. PSMIMPW2.cmd - Import Line Sequential CSV to Record Sequential ASC

 

Table of Contents Previous Section Next Section Signed-Whole Numeric Values

The following links provide additional information about the individual Batch Job Scripts that perform the functional testing.

1. Signed Numeric Values Signed, for Packed-Decimal format. The numeric content will be a whole number without a decimal separator.
1.1. PSWE2AW1.cmd - Convert EBC to ASC and maintain numeric formatting
1.2. PSWA2EW1.cmd - Convert ASC to EBC and maintain numeric formatting
1.3. PSWHXDW3.cmd - Review File Content (Hex Dump for Human review)
1.4. PSWEXTW1.cmd - Export Record Sequential ASC to Line Sequential CSV
1.5. PSWIMPW2.cmd - Import Line Sequential CSV to Record Sequential ASC

 

Table of Contents Previous Section Next Section Unsign-Decimal Numeric Values

The following links provide additional information about the individual Batch Job Scripts that perform the functional testing.

1. Unsigned Numeric Values for Unsigned, Packed-Decimal format. The numeric content will be a decimal number containing digits to the right of a decimal separator.
1.1. PUDE2AW1.cmd - Convert EBC to ASC and maintain numeric formatting
1.2. PUDA2EW1.cmd - Convert ASC to EBC and maintain numeric formatting
1.3. PUDHXDW3.cmd - Review File Content (Hex Dump for Human review)
1.4. PUDEXTW1.cmd - Export Record Sequential ASC to Line Sequential CSV
1.5. PUDIMPW2.cmd - Import Line Sequential CSV to Record Sequential ASC

 

Table of Contents Previous Section Next Section Unsign-Mixed Numeric Values

The following links provide additional information about the individual Batch Job Scripts that perform the functional testing.

1. Unsigned Numeric Values for Unsigned, Packed-Decimal format. The numeric content will be a mixed number containing digits to the left and right of a decimal separator.
1.1. PUME2AW1.cmd - Convert EBC to ASC and maintain numeric formatting
1.2. PUMA2EW1.cmd - Convert ASC to EBC and maintain numeric formatting
1.3. PUMHXDW3.cmd - Review File Content (Hex Dump for Human review)
1.4. PUMEXTW1.cmd - Export Record Sequential ASC to Line Sequential CSV
1.5. PUMIMPW2.cmd - Import Line Sequential CSV to Record Sequential ASC

 

Table of Contents Previous Section Next Section Unsign-Whole Numeric Values

The following links provide additional information about the individual Batch Job Scripts that perform the functional testing.

1. Unsigned Numeric Values for Unsigned, Packed-Decimal format. The numeric content will be a whole number without a decimal separator.
1.1. PUWE2AW1.cmd - Convert EBC to ASC and maintain numeric formatting
1.2. PUWA2EW1.cmd - Convert ASC to EBC and maintain numeric formatting
1.3. PUWHXDW3.cmd - Review File Content (Hex Dump for Human review)
1.4. PUWEXTW1.cmd - Export Record Sequential ASC to Line Sequential CSV
1.5. PUWIMPW2.cmd - Import Line Sequential CSV to Record Sequential ASC

 

Table of Contents Previous Section Next Section Ancillary Functions

WIP
The test case will use job scripts to perform the functional testing. The job scripts are arranged in two primary groups for Signed and Unsigned Numeric values. Each primary group will contain three secondary groups that will describe and demonstrate numeric values that contain Decimal, Mixed or Whole numeric values. Each of the six (6) groups will contain a minumum of five (5) functional tests for a total of thirty (30).

Table of Contents Previous Section Next Section Peek at Record Content

The following links provide additional information about the individual Batch Job Scripts that perform the functional testing.

1. Human-Oriented (text string) and HEX PEEK view of each field in a record. The numeric content may be a value with digits to the left and right of a decimal separator.
1.1. PSDPEKW3.cmd - WIP
1.2. PSMPEKW3.cmd - The input file contains records containing text strings and numeric values stored in a Signed, Packed-Decimal format. The size and decimal positions of the numeric values will vary.
1.2.1. Review the Results
1.3. PSWPEKW3.cmd - Review File Content (Hex Dump for Human review)
1.4. PUDPEKW3.cmd - Export Record Sequential ASC to Line Sequential CSV
1.5. PUMPEKW3.cmd - Import Line Sequential CSV to Record Sequential ASC
1.6. PUWPEKW3.cmd - Import Line Sequential CSV to Record Sequential ASC

 

Table of Contents Previous Section Next Section Summary

The purpose of this document is to provide information about a Quality Assurance Test Case that focuses on SIMOTIME Technologies that manage data files with numeric values stored in a packed-decimal format. Also, this document may be used as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

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

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

Table of Contents Previous Section Next Section 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.

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

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

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

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

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

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.

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
Packed Decimal Numbers, Definition and Structure
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com