Zoned Decimal Format
Non-Numeric Content
  Table of Contents  v-16.01.01 - nbrzd301.htm 
  Introduction
  Execute
  CMD File, Execute Program
  CMD, with Numeric Check
  CMD, without Numeric Check
  JCL Member, Execute Program
  JCL, with Numeric Check
  JCL, without Numeric Check
  Review the Results
  Results, with Numeric Check
  Results, without Numeric Check
  Prepare
  Generate Programs
  Generate with Numeric Check
  Generate without Numeric Check
  Create Test Data
  CMD File, Create Test Data
  JCL Member, Create Test Data
  Technical Details
  USAGE IS DISPLAY Field
  Compiler Options or Directives
  Default Compiler Directives
  Alternate Compiler Directives for NBRZD3R2
  Record Structure for Test File
  Hex-Dump of Test File
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document (with sample programs) describes the anomalies of working with numeric fields that are defined as Zoned-Decimal and contain non-numeric values. For the COBOL programming language these fields would be defined as USAGE IS DISPLAY.

This suite of programs will build test data and discuss techniques for managing zoned-decimal numeric fields and displaying a field in a hexadecimal dump format. Allowing a space character (or any non-numeric value) to exist in a zoned-decimal field should be considered as a bad programming practice. The process that causes this to happen should be identified and corrected.


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

Table of Contents Previous Section Next Section Execute

This suite of programs incudes a group of CMD files and a JCL members to map the file names and execute the programs that accumulate the Summary Totals and Record Counts. The output is posted to the SYSOUT device.

Table of Contents Previous Section Next Section CMD File, Execute Program

The following command files will process a test file that contains records with zoned-decimal fields that contain non-numeric characters. Each job will read the records in the test file and accumulate summary totals for each of the zoned-decimal fields in the record structure. Each job uses a different methodology for handling the non-numeric values in the zoned-decimal fields.

Table of Contents Previous Section Next Section CMD, with Numeric Check

The following (NBRZD3W1.cmd) is a sample of the Windows CMD needed to run this job with Windows or Micro Focus COBOL. The NUMCHK function is set to ENABLE. This setting will test for all non-numeric values in a zoned-numeric field and if true the field will be converted to a zero value prior to adding to the summary total. The test file will not be updated.

@echo OFF
rem  * *******************************************************************
rem  *               NBRZD3W1.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   - Read a file, Calculate record count and numeric totals.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1988
rem  *
rem  The job will read a record sequential file of 80-byte records that
rem  contains numeric fields within the records.
rem  The programs will read the file and calculate summary totals and a
rem  record count for the user-defined numeric fields. The information
rem  will then be posted to the SYSOUT device.
rem  *
rem  *                     ************
rem  *                     * NBRZD3W1 *
rem  *                     ********cmd*
rem  *                          *
rem  *                          *
rem  *    ************     ************     ************
rem  *    * NBRZD3D1 ******* NBRZD3C1 *******  SYSOUT  *
rem  *    *******rseq*     ********cbl*     *******lseq*
rem  *                          *
rem  *                          *
rem  *                     ************
rem  *                     *   EOJ    *
rem  *                     ************
rem  *
rem  * *******************************************************************
rem  * Read a File, Calculate Record Counts and Summary Totals...
rem  *
     set CmdName=NBRZD3W1
     call ..\Env1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
     call SimoNOTE "StepInfo Execute the Program to Calculate Totals"
     set SYSUT1=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.NBRZD3D1.DAT
     set SYSOUT=%BaseLib1%\DATA\SPOOL\SYSOUT_%CmdName%.TXT
     if exist %SYSOUT% erase %SYSOUT%
     call SimoNOTE "DataTake %SYSUT1%"
     call SimoNOTE "DataMake %SYSOUT%"
     run NBRZD3C1
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not %JobStatus% == 0000 goto :EojNok
     if exist %SYSOUT% type %SYSOUT%
     goto :EojAok
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section CMD, without Numeric Check

The following (NBRZD3W2.cmd) is a sample of the Windows CMD needed to run this job with Windows or Micro Focus COBOL. The NUMCHK function to test for non-numeric values in a zoned-numeric field and treat as a zero value is set to DISABLE for this job.

@echo OFF
rem  * *******************************************************************
rem  *               NBRZD3W2.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   - Read a file, Calculate record count and numeric totals.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1988
rem  *
rem  The job will read a record sequential file of 80-byte records that
rem  contains numeric fields within the records.
rem  The programs will read the file and calculate summary totals and a
rem  record count for the user-defined numeric fields. The information
rem  will then be posted to the SYSOUT device.
rem  *
rem  *                     ************
rem  *                     * NBRZD3W2 *
rem  *                     ********cmd*
rem  *                          *
rem  *                          *
rem  *    ************     ************     ************
rem  *    * NBRZD3D1 ******* NBRZD3C2 *******  SYSOUT  *
rem  *    *******rseq*     ********cbl*     *******lseq*
rem  *                          *
rem  *                          *
rem  *                     ************
rem  *                     *   EOJ    *
rem  *                     ************
rem  *
rem  * *******************************************************************
rem  * Read a File, Calculate Record Counts and Summary Totals...
rem  *
     set CmdName=NBRZD3W2
     call ..\Env1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
     call SimoNOTE "StepInfo Execute the Program to Calculate Totals"
     set SYSUT1=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.NBRZD3D1.DAT
     set SYSOUT=%BaseLib1%\DATA\SPOOL\SYSOUT_%CmdName%.TXT
     if exist %SYSOUT% erase %SYSOUT%
     call SimoNOTE "DataTake %SYSUT1%"
     call SimoNOTE "DataMake %SYSOUT%"
     run NBRZD3C2
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not %JobStatus% == 0000 goto :EojNok
     if exist %SYSOUT% type %SYSOUT%
     goto :EojAok
:EojAok
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section JCL Member, Execute Program

The following jobs will process a test file that contains records with packed-decimal field that contain space characters. The records contain packed-decimal fields that have both EBCDIC and ASCII encoded space characters. Each job will read the records in the test file and accumulate summary totals for each of the packed-decimal fields in the record structure. Each job uses a different methodology for handling the spaces in the packed-decimal fields.

Table of Contents Previous Section Next Section JCL, with Numeric Check

The following (NBRZD3J1.jcl) is a sample of the JCL Member needed to run this job with ZOS or Micro Focus Enterprise Server. The function to test for non-numeric in a zoned-numeric field is enabled for this job.

//NBRZD3J1 JOB (SIMOTIME),'ZONED WITH NON NUMERIC',CLASS=1,MSGCLASS=0,
//             NOTIFY=CSIP1
//* *******************************************************************
//*       NBRZD3J1.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member 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   - Read a file, Calculate record count and numeric totals.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* Thisd job will describe and demonstrate how to process
//* zoned-decimal fields that contain non-numeric values.
//*
//* The job will read a record sequential file of 80-byte records that
//* contains numeric fields within the records.
//* The programs will read the file and calculate summary totals and a
//* record count for the user-defined numeric fields. The information
//* will then be posted to the SYSOUT device.
//*
//* Before the field values is added to the summary total a numeric
//* check of the field is performed. If the field contains a
//* non-numeric value then it will be processed as a zero value thus
//* avoiding a S0C7 or RTS163 error.
//*
//* This set of programs may be compiled and executed on a Mainframe
//* System with ZOS or a Linux, UNIX or Windows System with Micro Focus
//* Enterprise Developer.
//*
//*                     ************
//*                     * NBRZD3J1 *
//*                     ********jcl*
//*                          *
//*    ************     ************     ************
//*    *  SYSUT1  *-----* NBRZD3C1 *-----*  SYSOUT  *
//*    ********dat*     ********cbl*     ******spool*
//*                          *   *
//*                          *   *       ************
//*                          *   *-call--* NBRZD3R1 *
//*                          *           ********cbl*
//*                          *
//*                     ************
//*                     *   EOJ    *
//*                     ************
//*
//* *******************************************************************
//* Step 1 of 1, Write Summary Total and record counts to SYSOUT
//*
//VALIDATE EXEC PGM=NBRZD3C1
//SYSUT1   DD  DSN=SIMOTIME.DATA.NBRZD3D1,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//

Table of Contents Previous Section Next Section JCL, without Numeric Check

The following (NBRZD3J2.jcl) is a sample of the JCL Member needed to run this job with ZOS or Micro Focus Enterprise Server. The function to test for non-numeric in a zoned-numeric field is disabled for this job.

//NBRZD3J2 JOB (SIMOTIME),'ZONED WITH NON NUMERIC',CLASS=1,MSGCLASS=0,
//             NOTIFY=CSIP1
//* *******************************************************************
//*       NBRZD3J2.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member 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   - Read a file, Calculate record count and numeric totals.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* Thisd job will describe and demonstrate how to process
//* zoned-decimal fields that contain non-numeric values.
//*
//* The job will read a record sequential file of 80-byte records that
//* contains numeric fields within the records.
//* The programs will read the file and calculate summary totals and a
//* record count for the user-defined numeric fields. The information
//* will then be posted to the SYSOUT device.
//*
//* Micro Focus compiler directives are used to avoid an RTS163 Error.
//*
//* This set of programs may be compiled and executed on a Mainframe
//* System with ZOS or a Linux, UNIX or Windows System with Micro Focus
//* Enterprise Developer.
//*
//*                     ************
//*                     * NBRZD3J2 *
//*                     ********jcl*
//*                          *
//*    ************     ************     ************
//*    *  SYSUT1  *-----* NBRZD3C2 *-----*  SYSOUT  *
//*    ********dat*     ********cbl*     ******spool*
//*                          *   *
//*                          *   *       ************
//*                          *   *-call--* NBRZD3R2 *
//*                          *           ********cbl*
//*                          *
//*                     ************
//*                     *   EOJ    *
//*                     ************
//*
//* *******************************************************************
//* Step 1 of 1, Write Summary Total and record counts to SYSOUT
//*
//VALIDATE EXEC PGM=NBRZD3C2
//SYSUT1   DD  DSN=SIMOTIME.DATA.NBRZD3D1,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//

Table of Contents Previous Section Next Section Review the Results

The output created by the programs are summary totals for each of the zoned-decimal fields in the test data file. At End-of-Job (EOJ) the programs will write the summary totals to the SYSOUT device. For the Micro Focus environment the programs were compiled using the OUTDD directive with SYSOUT specified as a line sequential (or ASCII-Text) file with a record length of 121 bytes. Therefore, the output may be easily viewed using a text editor of choice.

This section will describe the outputs based on the settings of the NUMCHK function provided by SimoTime.

Table of Contents Previous Section Next Section Results, with Numeric Check

The following shows the results when a zoned-decimal field contains non-numeric characters. The test data for the following report contained three (3) records. The records contain zoned-decimal fields that have both EBCDIC and ASCII encoded space characters and other non-numeric values.

The programs that are used to produce the following report simply attempt to use the values in the packed fields to accumulate summary totals. The programs were first compiled with the default compiler options/directives for a mainframe environment. Refer to the Default Compiler Directives section of this document for the Micro Focus Compiler directives. When an attempt was made to process one of the fields that contained non-numeric characters an ABEND or Program Check resulted with an error message that indicated the field contained a non-numeric value (for the ZOS environment this would be a S0C7 error, for Micro Focus it would be an RTS 163 error).

Next, the programs were compiled with compiler options/directives that would prevent the ABEND. Refer to the Alternate Compiler Directives for NBRZD3R2 section of this document for the Micro Focus Compiler directives. When an attempt is made to process one of the zoned-decimal fields that contained non-numeric characters the sign position is corrected and the program check does not occur. However, since an ASCII space (x'20') or an EBCDIC space (x'40') are valid numbers this will result in the summary totals being incorrect.

The following shows a report that was created with HEX20 and HEX40 set to DISABLE. The test file contained three (3) records with both EBCDIC and ASCII spaces in some of the packed-decimal fields. For example, in the 1st record NBRPK3B1-FIELD-01 contains a valid numeric value of 123. In the 2nd and 3rd records NBRPK3B1-FIELD-01 contains ASCII space characters.

Typically, a business user would expect the spaces to be treated as zeroes and the summary total to be 123. However, this is not the case with packed-decimal fields. Using the SIGN-FIXUP directive avoids the S0C7 or RTS 163 error but the ASCII space characters are treated as valid numbers and result in a value of 20202. When reading the three records and accumulating the summary total the result for NBRPK3B1-FIELD-01 is as follows.
123 + 20202 + 20202 = 40,527

* NBRPK3C1 Packed Numeric Field with SPACES   v15.05.18   helpdesk@simotime.com
* NBRPK3C1 A Program to Calculate Totals was generated by SimoTime Technologies
* NBRPK3C1 * Compiled for an ASCII environment...
* NBRPK3C1 * HEX20 parameter is DISABLE
* NBRPK3C1 * HEX40 parameter is DISABLE
* NBRPK3C1 ************************************************************************************************************
* NBRPK3C1 Field Name                                     Summary.Total                HEX40     HEX20    NUMCHK TYPE
* NBRPK3C1 NBRPK3B1-FIELD-01                               40,527                                                 PK
* NBRPK3C1 NBRPK3B1-FIELD-02                                1,368-                                                PK
* NBRPK3C1 NBRPK3B1-FIELD-03                               41,634                                                 PK
* NBRPK3C1 NBRPK3B1-FIELD-04                              220,200                                                 PK
* NBRPK3C1 Record count for SYSUT1                      000000003
* NBRPK3C1 Field Name                                     Summary.Total                HEX40     HEX20    NUMCHK TYPE
* NBRPK3C1 ************************************************************************************************************
* NBRPK3C1 Program to Calculate Totals generated by using SimoTime Technologies
* NBRPK3C1 Please send all comments or suggestions to the helpdesk@simotime.com

Table of Contents Previous Section Next Section Results, without Numeric Check

The following shows the results when a packed-decimal field contains space characters and the program recognizes the condition.

The following shows a report that was created with HEX20 and HEX40 set to ZERO_ADJ. The test file contained three (3) records with both EBCDIC and ASCII spaces in some of the packed-decimal fields. The program that accumulates the summary totals will first test the packed-decimal field for all spaces (EBCDIC or ASCII) and if true set the value to zero prior to adding to the summary total. This will produce a summary total that a business user would expect.

Note: The packed-decimal value is only altered for the purpose of calculating the summary total. The data file will not be updated.

* NBRPK3C2 Packed Numeric Field with SPACES   v15.05.18   helpdesk@simotime.com
* NBRPK3C2 A Program to Calculate Totals was generated by SimoTime Technologies
* NBRPK3C2 * Compiled for an ASCII environment...
* NBRPK3C2 * HEX20 parameter is ZERO_ADJ
* NBRPK3C2 * HEX40 parameter is ZERO_ADJ
* NBRPK3C2 ************************************************************************************************************
* NBRPK3C2 Field Name                                     Summary.Total                HEX40     HEX20    NUMCHK TYPE
* NBRPK3C2 NBRPK3B1-FIELD-01                                  123                              0000002            PK
* NBRPK3C2 NBRPK3B1-FIELD-02                                1,368-                                                PK
* NBRPK3C2 NBRPK3B1-FIELD-03                                1,230                    0000001                      PK
* NBRPK3C2 NBRPK3B1-FIELD-04                              199,998                              0000001            PK
* NBRPK3C2 Record count for SYSUT1                      000000003
* NBRPK3C2 Field Name                                     Summary.Total                HEX40     HEX20    NUMCHK TYPE
* NBRPK3C2 ************************************************************************************************************
* NBRPK3C2 Program to Calculate Totals generated by using SimoTime Technologies
* NBRPK3C2 Please send all comments or suggestions to the helpdesk@simotime.com

Table of Contents Previous Section Next Section Prepare

Prior to executing the jobs it will be necessary to create (or generate) the programs that will read a test file and accumulate totals for the packed-decimal fields. The following is an overview of the programs that will be generated.

1. NBRPK301.pcf - this set of programs will process the packed-decimal fields with the NET20 and NET40 functions disabled.
2. NBRPK302.pcf - this set of programs will process the packed-decimal fields with the NET20 and NET40 functions set to ZERO_ADJ. The program that accumulates the summary totals will first test the packed-decimal field for all spaces (EBCDIC or ASCII) and if true set the value to zero prior to adding to the summary total. This will produce a summary total that a business user would expect.
3. NBRPK303.pcf - this set of programs will process the packed-decimal fields with the NET20 and NET40 functions set to ZERO_FIX. The program that accumulates the summary totals will first test the packed-decimal field for all spaces (EBCDIC or ASCII) and if true set the value to zero prior to adding to the summary total and the data file will be updated to reflect the changes. Also, this will produce a summary total that a business user would expect.

Table of Contents Previous Section Next Section Generate Programs

This section describes how to generate the COBOL programs used to accumulate summary totals and do a hex-dump of the test file. The purpose of this example is to process packed-decimal fields that contain space characters.

Table of Contents Previous Section Next Section Generate with Numeric Check

The following (NBRZD301.pcf) is the Process Control File that is used to generate the programs that will produce summary totals. The NET20 and NET40 functions are set to ZERO_ADJ. The program that accumulates the summary totals will first test the packed-decimal field for all spaces (EBCDIC or ASCII) and if true set the value to zero prior to adding to the summary total. This will produce a summary total that a business user would expect.

***********************************************************************
*                NBRZD301.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*             (C) Copyright 1987-2019 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 is the Sequential File with 80-byte records.
***********************************************************************
* This Process Control File will be used to generate a set of COBOL
* programs that will accumulate totals for user-defined numeric fields
* and provide a record count.
*
* Refer to http://www.simotime.com/utcomp01.htm for additional detail
* about the PCF statements for Data Validate, Dump and Compare.
*
* The following group of statements will define the high level
* functions and processes to be performed.
*
&SIMOPREP  call ..\Env1BASE
&USERPREP  call UserCOGI
&CONFORM   IBM
&COPYFILE  NBRZD3B1.cpy
&HTMLFILE  nbrzd3b1.htm
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the file I/O Program
* to be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Zoned Decimal with non-Numeric
&PROGID    NBRZD3C1
&SYSUT1    org=Sequential recfm=FIXED rlen=80
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the record content
* conversion program to be generated.
* The following defines the name of the callable routine for special
* numeric processing.
*
&NUMCALL   NBRZD3R1
&NUMREC    NBRZD3B1-RECORD-01
*
* The following group of statements will look at the user-defined
* numeric fields and compensate when the field contains a non-numeric
* value. A non-numeric value will be treated as zero.
*
&NUMCHK    ENABLE
*
* The following group of statements will define the type of processing
* and the name of the numeric fields.
*
&UT1TOTAL  NBRZD3B1-RECID-R01
&UT1TOTAL  NBRZD3B1-FIELD-01
&UT1TOTAL  NBRZD3B1-FIELD-02
&UT1TOTAL  NBRZD3B1-FIELD-03
&UT1TOTAL  NBRZD3B1-FIELD-04
*
&END

Table of Contents Previous Section Next Section Generate without Numeric Check

***********************************************************************
*                NBRZD302.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*             (C) Copyright 1987-2019 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 is the Sequential File with 80-byte records.
***********************************************************************
* This Process Control File will be used to generate a set of COBOL
* programs that will accumulate totals for user-defined numeric fields
* and provide a record count.
*
* Refer to http://www.simotime.com/utcomp01.htm for additional detail
* about the PCF statements for Data Validate, Dump and Compare.
*
* The following group of statements will define the high level
* functions and processes to be performed.
*
&SIMOPREP  call ..\Env1BASE
&USERPREP  call UserCOGI
&CONFORM   IBM
&COPYFILE  NBRZD3B1.cpy
&HTMLFILE  nbrzd3b1.htm
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the file I/O Program
* to be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Zoned Decimal with non-Numeric
&PROGID    NBRZD3C2
&SYSUT1    org=Sequential recfm=FIXED rlen=80
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the record content
* conversion program to be generated.
* The following defines the name of the callable routine for special
* numeric processing.
*
&NUMCALL   NBRZD3R2
&NUMREC    NBRZD3B1-RECORD-01
*
* The following group of statements will look at the user-defined
* numeric fields and compensate when the field contains a non-numeric
* value. A non-numeric value will be treated as zero.
*
&NUMCHK    DISABLE
*
* The following group of statements will define the type of processing
* and the name of the numeric fields.
*
&UT1TOTAL  NBRZD3B1-RECID-R01
&UT1TOTAL  NBRZD3B1-FIELD-01
&UT1TOTAL  NBRZD3B1-FIELD-02
&UT1TOTAL  NBRZD3B1-FIELD-03
&UT1TOTAL  NBRZD3B1-FIELD-04
*
&END

Table of Contents Previous Section Next Section Create Test Data

This section describes the COBOL program that is used to create the test data. The test data is a record sequential file of 80-byte fixed-length records. Each record contains a record ID field and four (4) numeric fields in zoned-decimal (USAGE IS DISPLAY) format. Some of the zoned-decimal fields will contain non-numeric characters that are invalid and will cause a SOC7 error (non-numeric in numeric field) message. The purpose of this example is to process zoned-decimal fields that contain non-numeric characters or invalid values.

Table of Contents Previous Section Next Section CMD File, Create Test Data

The following (NBRZD3W8.cmd) is the Windows CMD that is used to create the test data.

@echo OFF
rem  * *******************************************************************
rem  *               NBRZD3W8.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   - Create a Record Sequential Data Set
rem  * Author - SimoTime Technologies
rem  * Date   = January 24, 1996
rem  *
rem  * The 1ST step will map the logical file name used by the program
rem  * to the fully-qualified physical file name.
rem  * The 2ND step will create a new test file.
rem  * The 3RD step will read the test file and create a HEX-Dump file.
rem  *
rem  * This set of programs will run on a Windows System with Micro Focus
rem  * Enterprise Developer.
rem  *
     set CmdName=NBRZD3W8
     call ..\Env1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
rem  * *******************************************************************
rem  * Step 1 of 3, Prepare the environment...
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%, User is %USERNAME%"
     call SimoNOTE "StepInfo Delete previously created files"
     set SYSUT2=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.NBRZD3D1.DAT
     if exist %SYSUT2% del %SYSUT2%
     set JobStatus=0000
rem  *
rem  * *******************************************************************
rem  * Step 2 of 3, Create and populate a new RSEQ file...
rem  *
     call SimoNOTE "StepInfo Create the Record Sequential File"
     run NBRZD3C8
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataMake %SYSUT2%"
rem  *
rem  * *******************************************************************
rem  * Step 3 of 3, Hex Dump of the RSEQ file...
rem  *
     call SimoNOTE "StepInfo HEX-Dump of the Record Sequential File"
     set SYSUT1=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.NBRZD3D1.DAT
     set SYSUT2=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.NBRZD3X1.DAT
     run HX80DUMP
     if not "%ERRORLEVEL%" == "0" set JobStatus=0020
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake %SYSUT1%"
     call SimoNOTE "DataMake %SYSUT2%"
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :End
:EojNok
     call SimoNOTE "NOTE ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
:End
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section JCL Member, Create Test Data

The following (NBRZD3J8.jcl) is a sample of the JCL Member that is used to create the test data.

//NBRZD3J8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       NBRZD3J8.jcl - a JCL Member for Batch Job Processing        *
//*       This JCL Member 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   - Create a Sequential Data Set on disk using IEBGENER.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* The 1st job step (JOBSETUP) will delete any previously created
//* file.
//* The 2nd job step (BUILDNEW) will create a new file of
//* packed-decimal, numeric fields within the records.
//* The 3rd job step (DUMPINFO) will create a new file of Hex-Dump
//* information.
//*
//* This set of programs may be compiled and executed on a Mainframe
//* System with ZOS or a Linux, UNIX or Windows System with Micro Focus
//* Enterprise Developer.
//*
//* *******************************************************************
//* Step 1 of 3, Delete any previously created file...
//*
//JOBSETUP EXEC PGM=IEFBR14
//SYSUT1   DD  DSN=SIMOTIME.DATA.NBRZD3D1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//SYSUT2   DD  DSN=SIMOTIME.DATA.NBRZD3D2,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 3, Create and populate a new QSAM file...
//*
//BUILDNEW EXEC PGM=NBRZD3C8
//SYSUT2   DD  DSN=SIMOTIME.DATA.NBRZD3D1,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//*
//* *******************************************************************
//* Step 3 of 3, Create a HEX-Dump File...
//*
//DUMPINFO EXEC PGM=HX80DUMP
//SYSUT1   DD  DSN=SIMOTIME.DATA.NBRZD3D1,DISP=SHR
//SYSUT2   DD  DSN=SIMOTIME.DATA.NBRZD3D2,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//

Table of Contents Previous Section Next Section Technical Details

This section provides additional details about the programs and control files that are used in this suite of programs.

Table of Contents Previous Section Next Section USAGE IS DISPLAY Field

A zoned decimal representation stores one decimal digit in one byte.

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.

Table of Contents Previous Section Next Section Compiler Options or Directives

The following is an overview of the Micro Focus Compiler Options the are used for batch jobs or transaction processing that uses CICS.

Link to Internet   Link to Server   Explore the Compiler Directives available for the Micro Focus COBOL technologies.

Table of Contents Previous Section Next Section Default Compiler Directives

The following are the Micro Focus compiler directives that are used for batch processing.

DIALECT"ENTCOBOL"
CHARSET"ASCII"
ASSIGN"EXTERNAL"
IDXFORMAT"8"
IBMCOMP
NOTRUNC
HOSTNUMMOVE
HOSTNUMCOMPARE
NOSIGNFIXUP
HOSTARITHMETIC
NOHOSTFD
CHECKNUM
ANIM
COBIDY
NOOPTIONAL-FILE
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATE
TIME
DATAMAP
settings
list()
noform

Table of Contents Previous Section Next Section Alternate Compiler Directives for NBRZD3R2

The following are the Micro Focus compiler directives that are used to manage the special processing requirements of zoned-decimal fields that contain non-numeric values.

DIALECT"ENTCOBOL"
CHARSET"ASCII"
ASSIGN"EXTERNAL"
IBMCOMP
NOTRUNC
HOST-NUMMOVE
HOST-NUMCOMPARE
NOSIGN-FIXUP
HOST-ARITHMETIC
defaultbyte"20"
ANIM
COBIDY
NOOPTIONAL-FILE
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATAMAP
settings
list()
noform

Table of Contents Previous Section Next Section Record Structure for Test File

The following (NBRZD3B1.cpy) is the COBOL copy file that defines the record structure for the data file used by this suite of programs.

      *****************************************************************
      *               NBRZD3B1.CPY - a COBOL Copy File                *
      *  A Record Sequential File with Zoned-Decimal Numeric Fields   *
      *         Copyright (C) 1987-2019 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      *    The length of this data structure is 80 bytes.
      *
       01  NBRZD3B1-RECORD-01.
           05  NBRZD3B1-RECID-G01.
               10  NBRZD3B1-RECID-R01  PIC 9(2).
           05  FILLER                  PIC X(5).
           05  NBRZD3B1-GROUP-01.
               10  NBRZD3B1-FIELD-01   PIC 9(5)  USAGE IS DISPLAY.
           05  FILLER                  PIC X(5).
           05  NBRZD3B1-FIELD-02       PIC S9(5).
           05  FILLER                  PIC X(5).
           05  NBRZD3B1-FIELD-03       PIC S9(5).
           05  FILLER                  PIC X(5).
           05  NBRZD3B1-GROUP-04.
               10  NBRZD3B1-FIELD-04   PIC S9(5).
           05  NBRZD3B8-CATCH-01       PIC X(12).
           05  FILLER                  PIC X(26).
      *
      ***  NBRZD3B1 - End-of-Copy File - - - - - - - - - - - NBRZD3B1 *
      *****************************************************************
      *

For additional information about the fields within the record structure refer to the following link.

Link to Internet   Link to Server   Explore an HTML document of the COBOL Copy File for NBRZD3B1. This document will provide additional information about each of the fields in the record structure that is used for the zoned-decimal regression testing.

Table of Contents Previous Section Next Section Hex-Dump of Test File

The following is a Hex-Dump of a test file that contains three records.

The 1st line is the position indicator.
The 2nd line is the possible ASCII character or symbol.
The 3rd line is the high-order nibble of the byte for the Hex-dump.
The 4th line is the low-order nibble of the byte for the Hex-dump.
The 5th line is the possible EBCDIC character or symbol.

....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
01FLD1=00123FLD2=0045vFLD3=00615FLD4=     Eye-Catcher
33444333333344433333374443333333444332222247624676667222222222222222222222222222
016C41D001236C42D004566C43D006156C44D00000595D3143852000000000000000000000000000
...<.........<.........<.........<.........`.../................................
*
01FLD1=.....FLD2=0045vFLD3=00615FLD4=99999Eye-Catcher
3344433FFFFF44433333374443333333444333333347624676667222222222222222222222222222
016C41DFFFFF6C42D004566C43D006156C44D99999595D3143852000000000000000000000000000
...<.........<.........<.........<.........`.../................................
*
01FLD1=00123FLD2=0045vFLD3=@@@@@FLD4=99999Eye-Catcher
33444333333344433333374443344444444333333347624676667222222222222222222222222222
016C41D001236C42D004566C43D000006C44D99999595D3143852000000000000000000000000000
...<.........<.........<...     .<.........`.../................................
*

Note: NBRZD3B1-FIELD-04 (positions 38-42) of the first record contains all ASCII-encoded space characters.

Note: NBRZD3B1-FIELD-01 (positions 8-12) of the second record contains all high-value (or x'FF') characters.

Note: NBRZD3B1-FIELD-03 (positions 28-32) of the third record contains all EBCDIC-encoded space characters.

A generated program was used to produce this hexadecimal dump information. The following provides additional detail about the hexadecimal dump program.

Link to Internet   Link to Server   Explore How to Create and Execute a Hexadecimal Dump Program for a record sequential file with eighty (80) byte records.

Table of Contents Previous Section Next Section Summary

This document (with sample programs) describes the anomalies of working with numeric fields that are defined as Zoned-Decimal and contain non-numeric values. 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 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 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 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 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 at 1 415 827-7045 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 at 1 415 827-7045 or send an e-mail to: helpdesk@simotime.com

Also, check the web site at http://www.simotime.com


Return-to-Top
Zoned Decimal Format with Non-Numeric Content
Copyright © 1987-2019
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com