High-Values and Numbers Hex-FF in PIC 99 Fields |
The SimoTime Home Page |
One of the popular numeric formats used on a Mainframe System and in the COBOL programming environment is the Zoned-Decimal format. In the COBOL environment this format is defined by specifying the "USAGE IS DISPLAY" clause. Since this is the default format for COBOL it is rarely hard-coded and quite often the programmers forget about its physical structure and the advantages and disadvantages of using this numeric format.
One of the advantages of using this numeric format is the ease at which it may be displayed or printed and read by human beings.
One of the disadvantages of this format is its sensitivity to content. If a non-numeric value is placed in this field and an arithmetic operation is attempted a system error occurs and this causes an abnormal termination of the program.
The following sections of 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 Zoned-Decimal field and then properly managed to obtain the desired business result.
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
The following sections describe the data flow and format.
The input is an EBCDIC-encoded, record sequential file containing 80-byte, fixed-length records. The first 17 bytes of the last record in the file are X'FF' or high-values. The first 10 bytes of the record structure are defined as PIC X fields. Bytes 11-17 are defined as PIC 9 fields. This technique can cause problems if the application program tries to use the numeric (PIC 9) fields for an arithmetic operation. On the mainframe this could result in a S0C7 Program check. On a Micro Focus platform it could result in an RTS 163 message with an abnormal termination of the program.
Also, during a conversion between EBCDIC and ASCII-encoding care may need be taken to ensure the High-Values are not converted between X'FF' and X'9F'.
The following is a Hexadecimal Dump of the EBCDIC-encoded test file. The RED line represent the ASCII-encoded characters. The 1st GREEN line represents bits 0-3 of a hex-dump byte, the 2nd GREEN line represents bits 4-7 of a hex-dump byte. The BLUE line representes the EBCDIC-encoded characters.
....................@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ EEEEEEEEEEFFFFFFFFFF444444444444444444444444444444444444444444444444444444444444 77777777781112233123000000000000000000000000000000000000000000000000000000000000 XXXXXXXXXY1112233123 * ....................@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ FFFFFFFFFFFFFFFFFFFF444444444444444444444444444444444444444444444444444444444444 FFFFFFFFFFFFFFFFF123000000000000000000000000000000000000000000000000000000000000 .................123 *
The output is an ASCII-encoded, record sequential file containing 80-byte, fixed-length records.
The following is a Hexadecimal Dump of the ASCII-encoded test file. The RED line represent the ASCII-encoded characters. The 1st GREEN line represents bits 0-3 of a hex-dump byte, the 2nd GREEN line represents bits 4-7 of a hex-dump byte. The BLUE line representes the EBCDIC-encoded characters.
XXXXXXXXXY1112233123 55555555553333333333222222222222222222222222222222222222222222222222222222222222 88888888891112233123000000000000000000000000000000000000000000000000000000000000 ................................................................................ * .................123 FFFFFFFFFFFFFFFFF333222222222222222222222222222222222222222222222222222222222222 FFFFFFFFFFFFFFFFF123000000000000000000000000000000000000000000000000000000000000 ................................................................................ *
This job may be executed from a Windows Command line using a command file. This job may run on a Mainframe System using the JCL Members. The job may run on a Linux, UNIX or Windows system by submitting the JCL to Micro Focus Enterprise Server for execution.
The following is the CMD File (NBRXFFW1.cmd) required to run the generated programs from a Windows Command Line.
@echo OFF rem * ******************************************************************* rem * NBRXFFW1.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 - Convert an EBCDIC-encoded file to a ASCII-encoded file. rem * Author - SimoTime Technologies rem * Date - January 24, 1996 rem * rem * The job will read a file if 80-byte records that contains numeric rem * fields with high-values. rem * rem * This batch job will run on a Windows System with Micro Focus rem * Enterprise Server. rem * rem * ******************************************************************* rem * Step 1 Delete any previously created file... rem * set CmdName=NBRXFFW1 call ..\Env1BASE %CmdName% if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%" :DeleteQSAM call SimoNOTE "StepInfo Delete previously created file" set SYSUT1=%BaseLib1%\DATA\EBC1\SIMOTIME.DATAEBC.NBRXFFD1.DAT set SYSUT2=%BaseLib1%\DATA\ASC1\SIMOTIME.DATAASC.NBRXFFD1.DAT if exist %SYSUT2% del %SYSUT2% rem * rem * ******************************************************************* rem * Step 2 Convert EBCDIC-encoded file to ASCII-encoded file... rem * :ExecuteJustifyRoutine call SimoNOTE "StepInfo Execute the Convert Program" run NBRXFFC1 if not ERRORLEVEL = 0 set JobStatus=0010 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "DataTake %SYSUT1%" call SimoNOTE "DataMake %SYSUT2%" rem * if exist %SYSUT2% goto :EojAok set JobStatus=0020 goto :EojNok :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
The following is the JCL member (NBRXFFJ1.jcl) required to run the generated programs on a Mainframe System with ZOS or a Linux, UNIX or Windows System with Micro Focus Enterprise Developer.
//NBRXFFJ1 JOB (SIMOTIME),'COBOL TEXT JUSTIFY',CLASS=1,MSGCLASS=0, // NOTIFY=CSIP1 //* ******************************************************************* //* NBRXFFJ1.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 - Convert RSEQ EBCDIC-encoded File to ASCII-encoded File. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* This job will read a sequential file of 80-byte records that that //* are EBCDIC-encoded and create a new file that is ASCII-encoded. //* //* 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. //* //* ************ //* * NBRXFFJ1 * //* ********jcl* //* * //* ************ //* * IEFBR14 * //* ********utl* //* * //* ************ ************ ************ //* * SYSUT1 *-----* NBRXFFC1 *-----* SYSUT2 * //* ********dat* ********cbl* ********dat* //* * * //* * * ************ //* * *-call--* NBRXFFR1 * //* * ********cbl* //* * //* ************ //* * EOJ * //* ************ //* //* ******************************************************************* //* Step 1 of 2, Delete any previously created file... //* //JOBSETUP EXEC PGM=IEFBR14 //SYSUT2 DD DSN=SIMOTIME.DATAASC.NBRXFFD1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 2, Do the record content conversion, EBC to ASC, //* create a new output file... //* //CONVERT1 EXEC PGM=NBRXFFC1 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //SYSUT1 DD DSN=SIMOTIME.DATAEBC.NBRXFFD1,DISP=SHR //SYSUT2 DD DSN=SIMOTIME.DATAASC.NBRXFFD1, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //SYSOUT DD SYSOUT=* //
Before the jobs can be executed some preparation work will be required. The conversion programs need to be generated. Test data will need to be created. The environment will need to be configured. The programs will need to be compiled and the executable members will need to be promoted to the load library.
The EBCDIC-encoded test file may be created using a Windows Command file or a JCL member.
The following is the CMD File (NBRXFFW8.cmd) that is used to create an EBCDIC-encoded test data file.
@echo OFF rem * ******************************************************************* rem * NBRXFFW8.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 an EBCDIC-encoded test file. rem * Author - SimoTime Technologies rem * Date - January 24, 1996 rem * rem * The job will read a file if 80-byte records that contains numeric rem * fields with high-values. rem * rem * This batch job will run on a Windows System with Micro Focus rem * Enterprise Server. rem * rem * ******************************************************************* rem * Step 1 Delete any previously created file... rem * set CmdName=NBRXFFW8 call ..\Env1BASE %CmdName% if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%" :DeleteQSAM call SimoNOTE "StepInfo Delete previously created file" set SYSUT1=%BaseLib1%\DATA\EBC1\SIMOTIME.DATAEBC.NBRXFFD1.DAT if exist %SYSUT1% del %SYSUT1% rem * rem * ******************************************************************* rem * Step 2 Edit input, create a new output file... rem * :ExecuteJustifyRoutine call SimoNOTE "StepInfo Execute the Convert Program" run NBRXFFC8 if not ERRORLEVEL = 0 set JobStatus=0010 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "DataMake %SYSUT1%" rem * if exist %SYSUT1% goto :EojAok set JobStatus=0020 goto :EojNok :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
The following is the JCL member (NBRXFFJ8.jcl) that is used to create an EBCDIC-encoded test data file. This job may be executed on a Mainframe System with ZOS or a Linux, UNIX or Windows System with Micro Focus Enterprise Developer.
//NBRXFFJ8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* NBRXFFJ8.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 File using a COBOL program. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* The first job step (JOBSETUP) will delete any previously created //* file. The second job step (BUILDNEW) will create a new file. //* //* 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 2, Delete any previously created file... //* //JOBSETUP EXEC PGM=IEFBR14 //SYSUT1 DD DSN=SIMOTIME.DATAEBC.NBRXFFD1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 2, Create and populate a new EBCDIC-encoded QSAM file... //* //BUILDNEW EXEC PGM=NBRXFFC8 //SYSUT1 DD DSN=SIMOTIME.DATAEBC.NBRXFFD1, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //SYSOUT DD SYSOUT=* //
The Process Control File (PCF) is used to define the specifications that will be used in conjunction with the COBOL copy file to generate a set of COBOL programs that will be used to do the actual data conversion at the field level.
The following is the PCF File (NBRXFF01.pcf) that is used to generate the COBOL programs that will be used to do the EBCDIC to ASCII conversion.
*********************************************************************** * NBRXFF01.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 - Record Sequential file with fixed-length 80-byte records. * * SYSUT2 - Record Sequential file with fixed-length 80-byte records. * *********************************************************************** * For more information about a Process Control File (PCF) that will * generate data conversion programs refer to the following. * * http://www.simotime.com/utconv01.htm * * This set of specification will generate an mainline I/O program and * a called COBOL routine that will convert an EBCDIC-encoded file to * an ASCII-encoded file. *********************************************************************** * &SIMOPREP call ..\..\ENV1BASE &USERPREP call USERCONV &CONFORM IBM &DIALECT C2 * * The following COPYFILE statement defines the COBOL copy file that * will be used to convert the record structure at the field level. * Also, the copy file will be used to create the documentation for * the record structure. * ©FILE NBRXFFB1.CPY * * The following HTMLFILE statement causes the HTML document for the * record structure to be generated. The parameter defines the name * of the document. * &HTMLFILE nbrxffb1.htm * * The following group of statements are for the file I/O program and * will define the file properties and behavioral characteristics for * the Program to be generated. * *HEAD34 ....:....1....:....2....:....3.... &HEAD34 Convert RSEQ 80-Byte, EBC to ASC &PROGID NBRXFFC1 &SYSUT1 org=Sequential recfm=FIXED rlen=80 &SYSUT2 org=Sequential recfm=FIXED rlen=80 * * The following group of statements are for the callable conversion * program and will define the behavioral characteristics for the * program to be generated. * &TransCALL NBRXFFR1 &TransMODE E2A * &END
Explore How to Generate a Data File Convert Program using simple specification statements in a Process Control File (PCF). This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do the actual data file conversion. The User Guide contains a list of the PCF statements that are used for the data file convert process.
The following is the CMD File (EZUTCONV.cmd) that is used to generate the conversion programs.
@echo OFF rem * ******************************************************************* rem * EZUTCONV.cmd - a Windows Command File * rem * This program is provided by SimoTime Technologies * rem * (C) Copyright 1987-2015 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * This procedure calls the following Windows Command Files. rem * 1. ENV1BASE.cmd - this provides a single point for setting commonly rem * used environment variables. rem * 2. USERCONV.cmd - set the environment variables for the directories rem * that contain user members. rem * 3. SIMONOTE.cmd - this provides a consistent process for displaying rem * messages to the screen and writing to a journal or rem * log file. rem * 4. SIMOCONV.cmd - this will do the actual compile of the rem * specified program. rem * ************************************************************************ rem * set CmdName=EZUTCONV call USERCONV call SimoNOTE "***********************************************************************%CmdName%" call SimoNOTE "Starting %CmdName% Preparation, RC=%ConvertStatus%, PGM=%1" set ConvertStatus=0000 set UTCONVD1=%UTGENGET%\%1.pcf set UTCONVD2=%UTGENGET%\%1_genr.cmd set UTCONVD3=%UTGENGET%\%1_spec.txt if exist %UTCONVD2% erase %UTCONVD2% if exist %UTCONVD3% erase %UTCONVD3% set GENILIBR=%BASELIB1%\CONVERTS\INCLUDES run UTCONVRT if not "%ERRORLEVEL%" == "0" set ConvertStatus=0010 if not "%ConvertStatus%" == "0000" goto :ConvertEojNOK rem * rem * ************************************************************************ :ConvertEojAOK set /A AOK_Count=%AOK_Count% + 1 call SimoNOTE "Starting %CmdName% Execution, RC=%ConvertStatus%, PGM=%1" call %1_genr if not "%ERRORLEVEL%" == "0" set ConvertStatus=0020 if not "%ConvertStatus%" == "0000" goto :ConvertEojNOK call SimoNOTE "Complete %CmdName%, RC=%ConvertStatus%, PGM=%1" goto :End rem * rem * ************************************************************************ :ConvertEojNOK set JobStatus=%ConvertStatus% set /A NOK_Count=%NOK_Count% + 1 call SimoNOTE "ABENDING %CmdName%, RC=%ConvertStatus%, PGM=%1, !!!ABENDING!!!" echo %1 - Error during Compile, refer to %BaseLib1%\LIST\%1.LST>%BaseLib1%\LOGS\%1.ERR goto :End rem * rem * ************************************************************************ pause :End
This section provides additional details about the programs and control files that are used in this suite of programs.
This document will focus on a discussion of a numeric field (or data string) format referred to as Zoned-Decimal and is commonly used on an IBM Mainframe System. This is the default numeric format for COBOL and may be explicitly defined with the "USAGE IS DISPLAY" clause.
The "SIGNED, ZONED-DECIMAL" format has caused problems for years for mainframe programmers because the signed position of the field will display as a character value of "A-I" for positive numbers and "J-R" for negative numbers. It also allows for a positive and negative zero value that will display as a "{" and "}", this is the curly brace symbol or x'C0' and x'D0'.
When converting this type of field from EBCDIC to ASCII the programmer is presented with a number of confusing options and challenges. This document will try to explain the options and help the programmer avoid the common mistakes that are made during a conversion process.
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.
The following link provides a guideline for using Micro Focus compiler directives based on the application environment and data access requirements.
Explore the Compiler Directives available for the Micro Focus COBOL technologies.
The following compiler directives were used to compile and test the COBOL programs included in this example.
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
The following (NBRXFFB1.cpy) is the COBOL copy file that defines the record structure for the test file used by this suite of programs.
***************************************************************** * NBRXFFB1.CPY is a COBOL Copy File * * Copy File for an 80-byte, fixed-length record. * * 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 * ***************************************************************** 01 NBRXFF01-RECORD. 05 NBRXFF01-GROUP-01. 10 NBRXFF01-GS1. 15 NBRXFF01-GS1-F01-X PIC X(9). 15 NBRXFF01-GS1-F02-X PIC X. 05 NBRXFF01-GROUP-02. 10 NBRXFF01-GS2. 15 NBRXFF01-GS2-F01-9 PIC 999. 15 NBRXFF01-GS2-F02-9 PIC 99. 15 NBRXFF01-GS2-F03-9 PIC 99. 05 NBRXFF01-GROUP-03. 10 NBRXFF01-G03-F01-9 PIC 999. 10 FILLER PIC X(60). * *** NBRXFFB1 - End-of-Copy File - - - - - - - - - - - NBRXFFB1 * ***************************************************************** *
For additional information about the fields within the record structure refer to the following link.
Explore an HTML document of the COBOL Copy File for NBRXFFB1. This document will provide additional information about each of the fields in the record structure that is used for the zoned-decimal conversion process.
The COBOL programs in this example are generated using the SimoTime Enterprise Technologies for Application and Data Migrations. The generation technology uses a COBOL copy file for a definition of the record structure and a Process Control File to define and control the structure and behavior of the generated programs.
The following (NBRXFFC1.cbl) is the main COBOL I/O program that does the file I/O and makes a call to the routine that does the record content conversion between EBCDIC and ASCII.
IDENTIFICATION DIVISION. PROGRAM-ID. NBRXFFC1. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2018-10-10 Generation Time: 20:28:27:26 * * * * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * PRIMARY SYSUT1 SEQUENTIAL FIXED 00080 * * * * SECONDARY SYSUT2 SEQUENTIAL FIXED 00080 * * * * * * Translation Mode is EBCDIC to ASCII * * * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT SYSUT1-FILE ASSIGN TO SYSUT1 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS SYSUT1-STATUS. SELECT SYSUT2-FILE ASSIGN TO SYSUT2 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS SYSUT2-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD SYSUT1-FILE DATA RECORD IS SYSUT1-REC . 01 SYSUT1-REC. 05 SYSUT1-DATA-01 PIC X(00080). FD SYSUT2-FILE DATA RECORD IS SYSUT2-REC . 01 SYSUT2-REC. 05 SYSUT2-DATA-01 PIC X(00080). ***************************************************************** * This program was created with the SYSMASK1.TXT file as input. * * The SYSMASK1 provides for the sequential reading of the input * * file and the sequential writing of the output file. * * * * If the output file is indexed then the input file must be in * * sequence by the field that will be used to provide the key * * for the output file. This is a sequential load process. * * * * If the key field is not in sequence then refer to SYSMASK2 * * to provide for a random add or update of the indexed file. * * * * This program mask will have the ASCII/EBCDIC table inserted * * for use by the /TRANSLATE function of SimoZAPS. * * * * For more information or questions please contact SimoTime * * Technologies. The version control number is 16.01.01 * * * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** WORKING-STORAGE SECTION. 01 SIM-TITLE. 05 T1 pic X(11) value '* NBRXFFC1 '. 05 T2 pic X(34) value 'Convert RSEQ 80-Byte, EBC to ASC '. 05 T3 pic X(10) value ' v16.01.01'. 05 T4 pic X(24) value ' helpdesk@simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* NBRXFFC1 '. 05 C2 pic X(32) value 'This Data File Convert Member wa'. 05 C3 pic X(32) value 's generated by SimoTime Technolo'. 05 C4 pic X(04) value 'gies'. 01 SYSUT1-STATUS. 05 SYSUT1-STATUS-L pic X. 05 SYSUT1-STATUS-R pic X. 01 SYSUT1-EOF pic X value 'N'. 01 SYSUT1-OPEN-FLAG pic X value 'C'. 01 SYSUT2-STATUS. 05 SYSUT2-STATUS-L pic X. 05 SYSUT2-STATUS-R pic X. 01 SYSUT2-EOF pic X value 'N'. 01 SYSUT2-OPEN-FLAG pic X value 'C'. 01 SYSUT1-LRECL pic 9(5) value 00080. 01 SYSUT2-LRECL pic 9(5) value 00080. 01 SYSUT1-LRECL-MAX pic 9(5) value 00080. 01 SYSUT2-LRECL-MAX pic 9(5) value 00080. ***************************************************************** * The following buffers are used to create a four-byte status * * code that may be displayed. * ***************************************************************** 01 IO-STATUS. 05 IO-STAT1 pic X. 05 IO-STAT2 pic X. 01 IO-STATUS-04. 05 IO-STATUS-0401 pic 9 value 0. 05 IO-STATUS-0403 pic 999 value 0. 01 TWO-BYTES-BINARY pic 9(4) BINARY. 01 TWO-BYTES-ALPHA redefines TWO-BYTES-BINARY. 05 TWO-BYTES-LEFT pic X. 05 TWO-BYTES-RIGHT pic X. ***************************************************************** * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine. * ***************************************************************** 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(011) value '* NBRXFFC1 '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(068) value SPACES. 10 MESSAGE-TEXT-2 pic X(188) value SPACES. 01 MSG-LSB pic 9(5) value 267. ***************************************************************** 01 PROGRAM-NAME pic X(8) value 'NBRXFFC1'. 01 INFO-STATEMENT. 05 INFO-SHORT. 10 INFO-ID pic X(8) value 'Starting'. 10 filler pic X(2) value ', '. 10 filler pic X(34) value 'Convert RSEQ 80-Byte, EBC to ASC '. 05 filler pic X(24) value ' http://www.SimoTime.com'. 01 APPL-RESULT pic S9(9) comp. 88 APPL-AOK value 0. 88 APPL-EOF value 16. 01 WRITE-FLAG pic X value 'Y'. 01 SYSUT1-TOTAL. 05 SYSUT1-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for SYSUT1 '. 01 SYSUT2-TOTAL. 05 SYSUT2-ADD pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for SYSUT2 '. ***************************************************************** * The following copy file contains the translation tables for * * the ASCII and EBCDIC conversion. Also, sections of the tables * * may be used for case conversion. * ***************************************************************** COPY ASCEBCB1. ***************************************************************** PROCEDURE DIVISION. move all '*' to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT move INFO-STATEMENT to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT move all '*' to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT perform Z-POST-COPYRIGHT perform SYSUT1-OPEN perform SYSUT2-OPEN * USRSOJ Processing not specified... perform until SYSUT1-STATUS not = '00' perform SYSUT1-READ if SYSUT1-STATUS = '00' add 1 to SYSUT1-RDR perform BUILD-OUTPUT-RECORD if WRITE-FLAG = 'Y' perform SYSUT2-WRITE if SYSUT2-STATUS = '00' add 1 to SYSUT2-ADD end-if end-if end-if end-perform * USREOJ Processing not specified... move SYSUT1-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT2-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT if APPL-EOF move 'Complete' to INFO-ID else move 'ABENDING' to INFO-ID end-if move INFO-STATEMENT to MESSAGE-TEXT(1:79) perform Z-DISPLAY-MESSAGE-TEXT perform SYSUT2-CLOSE perform SYSUT1-CLOSE GOBACK. ***************************************************************** BUILD-OUTPUT-RECORD. * TransMODE is E2A... * TransCALL process, Record Content Conversion... move SYSUT1-REC to SYSUT2-REC call 'NBRXFFR1' using SYSUT2-REC add 00080 to ZERO giving SYSUT2-LRECL exit. ***************************************************************** * I/O Routines for the INPUT File... * ***************************************************************** SYSUT1-CLOSE. add 8 to ZERO giving APPL-RESULT. close SYSUT1-FILE if SYSUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with SYSUT1 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SYSUT1-READ. read SYSUT1-FILE if SYSUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if SYSUT1-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if if APPL-AOK CONTINUE else if APPL-EOF move 'Y' to SYSUT1-EOF else move 'READ Failure with SYSUT1 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* SYSUT1-OPEN. add 8 to ZERO giving APPL-RESULT. open input SYSUT1-FILE if SYSUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to SYSUT1-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with SYSUT1 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * I/O Routines for the OUTPUT File... * ***************************************************************** SYSUT2-WRITE. if SYSUT2-OPEN-FLAG = 'C' perform SYSUT2-OPEN end-if write SYSUT2-REC if SYSUT2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if SYSUT2-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if. if APPL-AOK CONTINUE else move 'WRITE Failure with SYSUT2 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT2-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SYSUT2-OPEN. add 8 to ZERO giving APPL-RESULT. open OUTPUT SYSUT2-FILE if SYSUT2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to SYSUT2-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with SYSUT2 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT2-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SYSUT2-CLOSE. add 8 to ZERO giving APPL-RESULT. close SYSUT2-FILE if SYSUT2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to SYSUT2-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with SYSUT2 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT2-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * The following Z-ROUTINES provide administrative functions * * for this program. * ***************************************************************** * ABEND the program, post a message to the console and issue * * a STOP RUN. * ***************************************************************** Z-ABEND-PROGRAM. if MESSAGE-TEXT not = SPACES perform Z-DISPLAY-MESSAGE-TEXT end-if move 'PROGRAM-IS-ABENDING...' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT add 12 to ZERO giving RETURN-CODE STOP RUN. * exit. ***************************************************************** Z-CALCULATE-MESSAGE-LSB. add 267 to ZERO giving MSG-LSB perform until MSG-LSB < 80 or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE if MESSAGE-BUFFER(MSG-LSB:1) = SPACE subtract 1 from MSG-LSB end-if end-perform exit. ***************************************************************** * Display CONSOLE messages... * ***************************************************************** Z-DISPLAY-MESSAGE-TEXT. perform Z-CALCULATE-MESSAGE-LSB display MESSAGE-BUFFER(1:MSG-LSB) move all SPACES to MESSAGE-TEXT exit. ***************************************************************** * Display the file status bytes. This routine will display as * * four digits. If the full two byte file status is numeric it * * will display as 00nn. If the 1st byte is a numeric nine (9) * * the second byte will be treated as a binary number and will * * display as 9nnn. * ***************************************************************** Z-DISPLAY-IO-STATUS. if IO-STATUS not NUMERIC or IO-STAT1 = '9' move IO-STAT1 to IO-STATUS-04(1:1) subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY move IO-STAT2 to TWO-BYTES-RIGHT add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403 move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT else move '0000' to IO-STATUS-04 move IO-STATUS to IO-STATUS-04(3:2) move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT end-if exit. ***************************************************************** Z-POST-COPYRIGHT. display SIM-TITLE display SIM-COPYRIGHT exit. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2018-10-10 Generation Time: 20:28:27:28 * *****************************************************************
The following (NBRXFFRC1.cbl) is the callable COBOL routine that does the record content conversion between EBCDIC and ASCII at the field level.
IDENTIFICATION DIVISION. PROGRAM-ID. NBRXFFR1. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * This routine was generated by SimoREC1 * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * Generation Date: 2018/10/10 Generation Time: 20:28:27:31 * ***************************************************************** DATA DIVISION. WORKING-STORAGE SECTION. 01 IX-1 PIC 9(5) VALUE 0. 01 RM-1 PIC 9(5) VALUE 0. 01 RO-1 PIC 9(5) VALUE 0. 01 IX-2 PIC 9(5) VALUE 0. 01 RM-2 PIC 9(5) VALUE 0. 01 RO-2 PIC 9(5) VALUE 0. COPY AE0437B1. COPY ASCEBCB2. ***************************************************************** LINKAGE SECTION. COPY NBRXFFB1. ***************************************************************** PROCEDURE DIVISION using NBRXFF01-RECORD. inspect NBRXFF01-GS1-F01-X converting E-INFO to A-INFO inspect NBRXFF01-GS1-F02-X converting E-INFO to A-INFO * Zoned-Decimal-Nosign. NBRXFF01-GS2-F01-9 inspect NBRXFF01-RECORD(11:3) converting E-NUMB to A-NUMB * Zoned-Decimal-Nosign. NBRXFF01-GS2-F02-9 inspect NBRXFF01-RECORD(14:2) converting E-NUMB to A-NUMB * Zoned-Decimal-Nosign. NBRXFF01-GS2-F03-9 inspect NBRXFF01-RECORD(16:2) converting E-NUMB to A-NUMB * Zoned-Decimal-Nosign. NBRXFF01-G03-F01-9 inspect NBRXFF01-RECORD(18:3) converting E-NUMB to A-NUMB * Filler............... A Non-Unique Reference to a Data Item inspect NBRXFF01-RECORD(21:60) converting E-INFO to A-INFO GOBACK. ***************************************************************** * This routine was generated by SimoREC1 * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * Generation Date: 2018/10/10 Generation Time: 20:28:27:31 * *****************************************************************
The purpose of this document is to assist as a tutorial for new programmers or as a quick reference for experienced programmers. In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a choice of alternatives.
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 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 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.
Explore the Numbers Connection for additional information about the structure and processing of numeric data items (or numeric fields).
Explore an Extended List of Software Technologies that are available for review and evaluation. The software technologies (or Z-Packs) provide individual programming examples, documentation and test data files in a single package. The Z-Packs are usually in zip format to reduce the amount of time to download.
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 connection.
This suite of programs and documentation is available for download. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.
A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection
Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.
Explore the 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 |
High Value Byte in Numeric Field |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |