Totals & Record Counts
Various Numeric Formats
  Table of Contents  v-16.01.01 - vtn25601.htm 
  Introduction
  Execute and Review
  Accumulate Totals & Record Counts
  JCL, Totals and Record Counts
  CMD, Totals and Record Counts
  Review the Results
  SYSOUT, Totals & Record Counts
  Preparation and Support
  JCL, Prepare a Test File
  Generate the Programs
  The Generated COBOL Programs
  The Primary I/O Program
  The Called Calculation Routine
  The COBOL Copy File
  COBOL Copy File for Test File
  HTML Document for Test File
  The Process Control 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 suite of programs and documentation will describe and demonstrate an approach for reading a file, calculating record counts and producing summary totals for a set of pre-defined currency or numeric fields that are defined as Binary, Packed Decimal or Zoned Decimal. This may be used to validate Data integrity for all currency or numeric fields but is especially useful for currency amounts. The approach uses two COBOL programs that were generated using SimoTime technology. The programs are generated on a Windows System with Micro Focus COBOL and may be compiled and executed on an IBM Mainframe (ZOS or VSE) or a Linux, UNIX or Windows (LUW) System with Micro Focus COBOL.

If data files are being transferred between systems (i.e. from Mainframe System to an LUW System with Micro Focus) the programs may be executed on the Mainframe System and the output file may be used as a control or validation mechanism to ensure that all the records were transferred and the numeric totals match.

This document is 1 of 5 documents and will focus on how to accumulate summary totals.

The following is a list of the five (5) documents included in this model for data management functions of non-relational data structures. The functions include data conversion (file structure and record content), record presentation in hexadecimal format with possible ASCII and EBCDIC character translations and the accumulation of summary totals with record counts.

Link to Internet   Link to Server   Explore the ASCII and EBCDIC data conversion techniques for a file that contains text strings and numeric fields of various formats such as BINARY, PACKED-Decimal and ZONED-Decimal. A Mainframe System and the COBOL programming language supports a variety of different numeric formats that will be discussed in this document.

Link to Internet   Link to Server   Explore how to create hexadecimal dump information of the records in a sequential file. The records may contain text strings and numeric fields of various formats such as BINARY, PACKED-Decimal and ZONED-Decimal. In addition to the Hex-Dump information the possible ASCII and EBCDIC character will be identified.

Link to Internet   Link to Server   Explore how to accumulate summary totals for currency or numeric fields that are defined (or formatted) as Binary, Packed Decimal or Zoned Decimal. The record count is included as one of the summary totals.

Link to Internet   Link to Server   Explore how to create a file that contains text and binary data. This document describes a model for creating a record sequential file that contains text strings that use EBCDIC or ASCII encoding and various numeric formats such as BINARY, PACKED-Decimal and ZONED-Decimal. This model has the capability of creating a test file for an ASCII or EBCDIC encoded environment. This document will address many of the challenges of doing a record content conversion of a file that will be transferred between an EBCDIC-encoded Mainframe System and an ASCII-encoded Linux, UNIX or Windows System.

Link to Internet   Link to Server   Explore how to generate programs (or COBOL source code) to perform various data management functions for non-relational data structures. The functions described in this document include data conversion (file structure and record content), hexadecimal dumps and summary totals accumulation.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Execute and Review

This section will describe and demonstrate how to execute the job scripts and programs in a mainframe-oriented environment or a Windows environment.

Table of Contents Previous Section Next Section Accumulate Totals & Record Counts

A JCL Member and a Windows Command File are provided to set the environment and execute the programs that do the accumulation of summary totals and record counts.

Note: The job scripts have been tested in a SimoTime Test Environment and may need to be modified in order to execute in a user environment.

Table of Contents Previous Section Next Section JCL, Totals and Record Counts

This is a single step job. It will execute a program that will read a file and calculate record counts and summary totals for a set of pre-defined numeric fields. This JCL is provided to run the job in a mainframe-oriented environment such as an IBM Mainframe running ZOS or a LINUX, UNIX or Windows System running Micro Focus Enterprise Server.

The following (RTNTOTJ1.jcl) is the JCL Member that is used to read a file and calculate Record Counts and Summary Totals for the specified numeric fields within the records.

//RTNTOTJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       RTNTOTJ1.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 counts and summary totals.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* This is a single step job. It will execute a program that will
//* read a file and calculate record counts and summary totals for
//* a set of pre-defined numeric fields.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//* *******************************************************************
//* Step 1 of 2, Delete any previously created file...
//*
//GETREADY EXEC PGM=IEFBR14
//WORKFILE DD  DSN=SIMOTIME.WRK1.RTNTOTD2,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=121,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 2, Calculate record counts and summary totals...
//*
//NUMTOTAL EXEC PGM=RTNTOTV1
//RTNTOTD1 DD  DSN=SIMOTIME.DATA.RTNTOTD1,DISP=SHR
//SYSOUT   DD  DSN=SIMOTIME.WRK1.RTNTOTD2,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=121,DSORG=PS)
//

Table of Contents Previous Section Next Section CMD, Totals and Record Counts

This is a single step task. It will execute a program that will read a file and calculate record counts and summary totals for a set of pre-defined numeric fields. This command file is provided to run the task in a Windows environment with Micro Focus COBOL.

The following (VTN256W1.cmd) is the CMD File that is used to read a file and calculate Record Counts and Summary Totals for the specified numeric fields within the records.

@echo OFF
rem  * *******************************************************************
rem  *               VTN256W1.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 file of 256-byte records that contains numeric
rem  * fields within the records.
rem  * The programs will read the file and calculate a record count and
rem  * summary totals for user-defined numeric fields.
rem  *
rem  *                     ************
rem  *                     * VTN256W1 *
rem  *                     ********cmd*
rem  *                          *
rem  *                          *
rem  *                     ************
rem  *    ************     * VTN256C1 *     ************
rem  *    *  SYSUT1  *******    --    *******  SYSOUT  *
rem  *    *******rseq*     * VTN256R1 *     *******lseq*
rem  *                     ********cbl*
rem  *                          *
rem  *                     ************
rem  *                     *   EOJ    *
rem  *                     ************
rem  *
rem  * *******************************************************************
rem  * Read a File, Calculate Record Counts and Summary Totals...
rem  *
     set CmdName=VTN256W1
     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.HEXDATA.MKN256PD1.DAT
     set SYSOUT=%BaseLib1%\DATA\SPOOL\SYSOUT_%CmdName%.TXT
     if exist %SYSOUT% erase %SYSOUT%
     call SimoNOTE "DataTake %SYSUT1%"
     call SimoNOTE "DataMake %SYSOUT%"
     run VTN256C1
     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 Review the Results

The results of the totals accumulation process are written to the SYSOUT device. The file structure for the SYSOUT device is typically configured as a sequential file with 121 byte records. The record content is text-oriented and may be viewed with a text editor of choice.

Table of Contents Previous Section Next Section SYSOUT, Totals & Record Counts

The following is the SYSOUT produced as a result of executing the job for record counts and summary totals.

* VTN256C1 Totals for Multiple Numeric Types  v15.05.18   helpdesk@simotime.com
* VTN256C1 A Program to Calculate Totals was generated by SimoTime Technologies
* VTN256C1 *  HEX20 parameter is DISABLE
* VTN256C1 *  HEX40 parameter is DISABLE
* VTN256C1 *  HEXTR parameter is DISABLE
* VTN256C1 * NUMCHK parameter is DISABLE
* VTN256C1 ************************************************************************************************************
* VTN256C1 Field Name                                     Summary.Total                HEX40     HEX20    NUMCHK TYPE
* VTN256C1 MKN-BS-72                                          132.22-                                             BN
* VTN256C1 MKN-BS-23                                           19.345-                                            BN
* VTN256C1 MKN-BS-52                                       12,354.22-                                             BN
* VTN256C1 MKN-BS-60                                      123,467-                                                BN
* VTN256C1 MKN-BS-20                                           25-                                                BN
* VTN256C1 MKN-BU-72                                          132.22                                              BN
* VTN256C1 MKN-BU-23                                           19.345                                             BN
* VTN256C1 MKN-BU-52                                       12,354.22                                              BN
* VTN256C1 MKN-BU-60                                      123,467                                                 BN
* VTN256C1 MKN-BU-20                                           25                                                 BN
* VTN256C1 MKN-PS-72                                          132.22-                                             PK
* VTN256C1 MKN-PS-23                                           19.345-                                            PK
* VTN256C1 MKN-PS-52                                       12,354.22-                                             PK
* VTN256C1 MKN-PS-60                                      123,467-                                                PK
* VTN256C1 MKN-PS-20                                           25-                                                PK
* VTN256C1 MKN-PU-72                                          132.22                                              PK
* VTN256C1 MKN-PU-23                                           19.345                                             PK
* VTN256C1 MKN-PU-52                                       12,354.22                                              PK
* VTN256C1 MKN-PU-60                                      123,467                                                 PK
* VTN256C1 MKN-PU-20                                           25                                                 PK
* VTN256C1 MKN-ZS-72                                          132.22-                                             ZD
* VTN256C1 MKN-ZS-23                                           19.345-                                            ZD
* VTN256C1 MKN-ZS-52                                       12,354.22-                                             ZD
* VTN256C1 MKN-ZS-60                                      123,467-                                                ZD
* VTN256C1 MKN-ZS-20                                           25-                                                ZD
* VTN256C1 MKN-ZU-72                                          132.22                                              ZD
* VTN256C1 MKN-ZU-23                                           19.345                                             ZD
* VTN256C1 MKN-ZU-52                                       12,354.22                                              ZD
* VTN256C1 MKN-ZU-60                                      123,467                                                 ZD
* VTN256C1 MKN-ZU-20                                           25                                                 ZD
* VTN256C1 Record count for SYSUT1                      000000003
* VTN256C1 Field Name                                     Summary.Total                HEX40     HEX20    NUMCHK TYPE
* VTN256C1 ************************************************************************************************************
* VTN256C1 Program to Calculate Totals generated by using SimoTime Technologies
* VTN256C1 Please send all comments or suggestions to the helpdesk@simotime.com

Table of Contents Previous Section Next Section Preparation and Support

The section will describe and demonstrate the tasks that will create a test file and generate the COBOL programs. The generation process requires a Windows System (Windows/7 or later) and Micro Focus COBOL to generate the COBOL source code. The generated COBOL source code may then be compiled and executed on an IBM Mainframe or a Linux, UNIX or Windows system with Micro Focus.

Table of Contents Previous Section Next Section JCL, Prepare a Test File

The preparation of the test file is covered in a separate document.

Link to Internet   Link to Server   Explore how to create a file that contains text and binary data. This document describes a model for creating a record sequential file that contains text strings that use EBCDIC or ASCII encoding and various numeric formats such as BINARY, PACKED-Decimal and ZONED-Decimal. This model has the capability of creating a test file for an ASCII or EBCDIC encoded environment. This document will address many of the challenges of doing a record content conversion of a file that will be transferred between an EBCDIC-encoded Mainframe System and an ASCII-encoded Linux, UNIX or Windows System.

Table of Contents Previous Section Next Section Generate the Programs

This process will use a COBOL copy file and a Process Control File to generate the COBOL programs that will read a file and call a second program to calculate summary totals.

Table of Contents Previous Section Next Section The Generated COBOL Programs

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.

Table of Contents Previous Section Next Section The Primary I/O Program

The following (VTN256C1.cbl) is the COBOL program that does the file I/O and calls the routine that does the calculations for the summary totals.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    VTN256C1.
       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: 2015-10-01  Generation Time: 23:53:02:76    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   SYSUT1   SEQUENTIAL    FIXED      00256            *
      *                                                               *
      *                                                               *
      *****************************************************************
       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.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  SYSUT1-FILE
           DATA RECORD    IS SYSUT1-REC
           .
       01  SYSUT1-REC.
           05  SYSUT1-DATA-01 PIC X(00256).

      *****************************************************************
      * This set of programs will create summary totals for           *
      * pre-defined user-fields. The SYSNTOT1.TXT template file was   *
      * used to create this program.  This program has the option to  *
      * process packed fields with non-numeric values or all space    *
      * characters. The fields with invalid characters or all spacces *
      * are set to a zero value prior to being used to calculate the  *
      * summary totals. The input file is NOT updated.                *
      *                                                               *
      * If Packed fields (i.e. COMP-3) are used and the packed fields *
      * may contain SPACE characters this program may ABEND with      *
      * a Mainframe S0C7 error or a Micro Foocus 163 Error.           *
      *                                                               *
      * On the Mainframe System the NUMPROC(NOPFD) Compiler option    *
      * may be used to avoid the S0C7 ABEND.                          *
      *                                                               *
      * In the Micro Focus environment the SIGNFIXUP Compiler         *
      * directive may be used in conjunction with not using the       *
      * CHECKNUM Compiler directive.                                  *
      *                                                               *
      * Note: the process that causes the packed fields to contain    *
      * SPACE characters should be addressed. The Compiler options    *
      * only prevent the error message but may produce in incorrect   *
      * results when used in arithmetic processing.                   *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 15.04.15          *
      *                                                               *
      *        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 '* VTN256C1 '.
           05  T2 pic X(34) value 'Totals for Multiple Numeric Types '.
           05  T3 pic X(10) value ' v15.05.18'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* VTN256C1 '.
           05  C2 pic X(32) value 'A Program to Calculate Totals wa'.
           05  C3 pic X(32) value 's generated by SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-01.
           05  C1 pic X(11) value '* VTN256C1 '.
           05  C2 pic X(32) value 'Program to Calculate Totals gene'.
           05  C3 pic X(32) value 'rated by using SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* VTN256C1 '.
           05  C2 pic X(32) value 'Please send all comments or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

       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'.

      *****************************************************************
      * 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 '* VTN256C1 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(109)  value SPACES.
               10  MESSAGE-TEXT-2  pic X(136)  value SPACES.

      *****************************************************************
       01  APPL-RESULT             pic S9(9)    comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  HEX20-PARM      pic X(16)   value 'DISABLE         '.
       01  HEX40-PARM      pic X(16)   value 'DISABLE         '.
       01  HEXPK-PARM      pic X(16)   value 'DISABLE         '.
       01  HEXTR-PARM      pic X(16)   value 'DISABLE         '.
       01  NUMCHK-PARM     pic X(16)   value 'DISABLE         '.

       01  SYSUT1-LRECL    pic 9(5)    value 00256.
       01  LEN-1           pic 9(5)    value 128.
       01  POS-1           pic 9(5)    value 1.

       01  SYSUT1-TOTAL.
           05  filler      pic X(25) value 'Record count for SYSUT1  '.
           05  filler      pic X(20) value SPACES.
           05  SYSUT1-RDR  pic 9(9)  value 0.

       01  FORMAT-TYPE     pic X     value 'B'.

       01  PT-1            pic 999     value 0.
       01  PT-2            pic 999     value 0.
       01  PT-3            pic 999     value 0.
       01  WORK-32         pic X(32)   value SPACES.
       01  DECIMAL-CHR     pic X       value '.'.

       COPY PANTOTB1.
       COPY MKN256B1.

      *****************************************************************
       PROCEDURE DIVISION.
           perform JOB-STARTING

           perform until SYSUT1-STATUS not = '00'
             perform SYSUT1-READ
             move SYSUT1-REC to MKN-RECORD
             if  SYSUT1-STATUS = '00'
                 add SYSUT1-RDR to ZERO giving PA-NTOT-RRN
                 call 'VTN256R1' using PA-NTOT-GROUP
                                       MKN-RECORD
             end-if
           end-perform

           perform JOB-FINISHED
           GOBACK.

      *****************************************************************
       JOB-FINISHED.
           perform SYSUT1-CLOSE

           move all '*'                      to MESSAGE-TEXT(1:108)
           perform Z-DISPLAY-MESSAGE-TEXT

           move 'Field Name'                 to MESSAGE-TEXT
           move 'Summary.Total'              to MESSAGE-TEXT(48:13)
           move '  HEX40'                    to MESSAGE-TEXT(75:7)
           move '  HEX20'                    to MESSAGE-TEXT(85:7)
           move ' NUMCHK'                    to MESSAGE-TEXT(95:7)
           move 'TYPE'                       to MESSAGE-TEXT(103:4)
           perform Z-DISPLAY-MESSAGE-TEXT

           if PA-NTOT-HOT > ZERO
              add 1 to ZERO giving PA-NTOT-IDX
              perform until PA-NTOT-IDX > PA-NTOT-HOT
                move ZERO to PT-1
                move ZERO to PT-2
                move ZERO to PT-3
                move PA-NTOT-NUMB(PA-NTOT-IDX) to WORK-32
                perform varying PT-1 from 1 by 1 until PT-1 > 31
                  if  WORK-32(PT-1:1) = DECIMAL-CHR
                      add PT-1 to ZERO giving PT-2
                  end-if
                  if  WORK-32(PT-1:1) = 0
                  or  WORK-32(PT-1:1) > 0
                  and WORK-32(PT-1:1) < 9
                  or  WORK-32(PT-1:1) = 9
                      add PT-1 to ZERO giving PT-3
                  end-if
                end-perform
                if  PT-2 > 0
                and PT-3 > PT-2
                    compute PT-1 = 56 - PT-3 + (PT-3 - PT-2)
                else
                    if  PT-3 > 0
                        compute PT-1 = 55 - PT-3
                    else
                        add 37 to ZERO giving PT-1
                    end-if
                end-if
                move PA-NTOT-DESC(PA-NTOT-IDX) to MESSAGE-TEXT
                move PA-NTOT-NUMB(PA-NTOT-IDX) to MESSAGE-TEXT(PT-1:32)
                if  PA-HEX40-CTR(PA-NTOT-IDX) > 0
                    move PA-HEX40-CTR(PA-NTOT-IDX)
                                                  to MESSAGE-TEXT(75:7)
                end-if
                if  PA-HEX20-CTR(PA-NTOT-IDX) > 0
                    move PA-HEX20-CTR(PA-NTOT-IDX)
                                                  to MESSAGE-TEXT(85:7)
                end-if
                if  PA-NUMCHK-CTR(PA-NTOT-IDX) > 0
                    move PA-NUMCHK-CTR(PA-NTOT-IDX)
                                                  to MESSAGE-TEXT(95:7)
                end-if
                if  PA-NTOT-TYPE(PA-NTOT-IDX) not = SPACES
                    move PA-NTOT-TYPE(PA-NTOT-IDX)
                                                  to MESSAGE-TEXT(104:2)
                end-if
                perform Z-DISPLAY-MESSAGE-TEXT
                add 1 to PA-NTOT-IDX
              end-perform
           end-if

           move SYSUT1-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           move 'Field Name'                 to MESSAGE-TEXT
           move 'Summary.Total'              to MESSAGE-TEXT(48:13)
           move '  HEX40'                    to MESSAGE-TEXT(75:7)
           move '  HEX20'                    to MESSAGE-TEXT(85:7)
           move ' NUMCHK'                    to MESSAGE-TEXT(95:7)
           move 'TYPE'                       to MESSAGE-TEXT(103:4)
           perform Z-DISPLAY-MESSAGE-TEXT

           move all '*'                      to MESSAGE-TEXT(1:108)
           perform Z-DISPLAY-MESSAGE-TEXT

           perform Z-THANK-YOU.

           exit.

      *****************************************************************
       JOB-STARTING.
           perform Z-POST-COPYRIGHT
           perform Z-DETERMINE-ENVIRONMENT
           initialize PA-NTOT-GROUP
           add 256 to ZERO giving PA-NTOT-LTD
           perform SYSUT1-OPEN
           exit.

      *****************************************************************
      * I/O Routines for the Primary 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
               add 1 to SYSUT1-RDR
           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-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT1-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-DETERMINE-ENVIRONMENT.
           move '*  HEX20 parameter is ' to MESSAGE-TEXT
           move HEX20-PARM               to MESSAGE-TEXT(23:16)
           perform Z-DISPLAY-MESSAGE-TEXT
           move '*  HEX40 parameter is ' to MESSAGE-TEXT
           move HEX40-PARM               to MESSAGE-TEXT(23:16)
           perform Z-DISPLAY-MESSAGE-TEXT
           move '*  HEXTR parameter is ' to MESSAGE-TEXT
           move HEXTR-PARM               to MESSAGE-TEXT(23:16)
           perform Z-DISPLAY-MESSAGE-TEXT
           move '* NUMCHK parameter is ' to MESSAGE-TEXT
           move NUMCHK-PARM              to MESSAGE-TEXT(23:16)
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display to SYSOUT Device...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:120)
           else
               display MESSAGE-BUFFER
           end-if
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-TO-CONSOLE.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:120) upon console
           else
               display MESSAGE-BUFFER upon console
           end-if
           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-TO-CONSOLE
               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-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           move SIM-TITLE to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           move SIM-COPYRIGHT to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           move SIM-THANKS-01 to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           move SIM-THANKS-02 to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           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: 2015-10-01  Generation Time: 23:53:02:79    *
      *****************************************************************

Table of Contents Previous Section Next Section The Called Calculation Routine

The following (VTN256R1.cbl) is the called COBOL program that does the calculations for the summary totals.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    VTN256R1.
       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: 2015/10/01  Generation Time: 23:53:03:06    *
      *****************************************************************
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  NTOT-FLD-00001      PIC S9(16)V9(02)  value 0.
       01  NTOT-CHR-00001.
           05  NTOT-EDT-00001  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00002      PIC S9(15)V9(03)  value 0.
       01  NTOT-CHR-00002.
           05  NTOT-EDT-00002  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.999-.

       01  NTOT-FLD-00003      PIC S9(16)V9(02)  value 0.
       01  NTOT-CHR-00003.
           05  NTOT-EDT-00003  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00004      PIC S9(18)        value 0.
       01  NTOT-CHR-00004.
           05  NTOT-EDT-00004  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00005      PIC S9(18)        value 0.
       01  NTOT-CHR-00005.
           05  NTOT-EDT-00005  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00006      PIC 9(16)V9(02)   value 0.
       01  NTOT-CHR-00006.
           05  NTOT-EDT-00006  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00007      PIC 9(15)V9(03)   value 0.
       01  NTOT-CHR-00007.
           05  NTOT-EDT-00007  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.999-.

       01  NTOT-FLD-00008      PIC 9(16)V9(02)   value 0.
       01  NTOT-CHR-00008.
           05  NTOT-EDT-00008  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00009      PIC 9(18)         value 0.
       01  NTOT-CHR-00009.
           05  NTOT-EDT-00009  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00010      PIC 9(18)         value 0.
       01  NTOT-CHR-00010.
           05  NTOT-EDT-00010  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00011      PIC S9(16)V9(02)  value 0.
       01  NTOT-CHR-00011.
           05  NTOT-EDT-00011  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00012      PIC S9(15)V9(03)  value 0.
       01  NTOT-CHR-00012.
           05  NTOT-EDT-00012  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.999-.

       01  NTOT-FLD-00013      PIC S9(16)V9(02)  value 0.
       01  NTOT-CHR-00013.
           05  NTOT-EDT-00013  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00014      PIC S9(18)        value 0.
       01  NTOT-CHR-00014.
           05  NTOT-EDT-00014  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00015      PIC S9(18)        value 0.
       01  NTOT-CHR-00015.
           05  NTOT-EDT-00015  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00016      PIC 9(16)V9(02)   value 0.
       01  NTOT-CHR-00016.
           05  NTOT-EDT-00016  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00017      PIC 9(15)V9(03)   value 0.
       01  NTOT-CHR-00017.
           05  NTOT-EDT-00017  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.999-.

       01  NTOT-FLD-00018      PIC 9(16)V9(02)   value 0.
       01  NTOT-CHR-00018.
           05  NTOT-EDT-00018  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00019      PIC 9(18)         value 0.
       01  NTOT-CHR-00019.
           05  NTOT-EDT-00019  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00020      PIC 9(18)         value 0.
       01  NTOT-CHR-00020.
           05  NTOT-EDT-00020  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00021      PIC S9(16)V9(02)  value 0.
       01  NTOT-CHR-00021.
           05  NTOT-EDT-00021  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00022      PIC S9(15)V9(03)  value 0.
       01  NTOT-CHR-00022.
           05  NTOT-EDT-00022  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.999-.

       01  NTOT-FLD-00023      PIC S9(16)V9(02)  value 0.
       01  NTOT-CHR-00023.
           05  NTOT-EDT-00023  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00024      PIC S9(18)        value 0.
       01  NTOT-CHR-00024.
           05  NTOT-EDT-00024  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00025      PIC S9(18)        value 0.
       01  NTOT-CHR-00025.
           05  NTOT-EDT-00025  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00026      PIC 9(16)V9(02)   value 0.
       01  NTOT-CHR-00026.
           05  NTOT-EDT-00026  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00027      PIC 9(15)V9(03)   value 0.
       01  NTOT-CHR-00027.
           05  NTOT-EDT-00027  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.999-.

       01  NTOT-FLD-00028      PIC 9(16)V9(02)   value 0.
       01  NTOT-CHR-00028.
           05  NTOT-EDT-00028  PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99-.

       01  NTOT-FLD-00029      PIC 9(18)         value 0.
       01  NTOT-CHR-00029.
           05  NTOT-EDT-00029  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.

       01  NTOT-FLD-00030      PIC 9(18)         value 0.
       01  NTOT-CHR-00030.
           05  NTOT-EDT-00030  PIC ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.


       01  IX-P1               pic 9(9)      value 0.
       01  IX-P2               pic 9(9)      value 0.
       01  IX-NP               pic 9(5)      value 0.
       01  IX-L1               pic 9(9)      value 0.
       01  RA-P1               pic 9(3)      value 0.
       01  RA-P2               pic 9(3)      value 0.
       01  FIRST-TIME          pic X       value 'Y'.
       01  PERFORM-QUIT        pic X       value 'N'.
      *
      *****************************************************************
       LINKAGE SECTION.
       COPY PANTOTB1.
       COPY MKN256B1.
      *
      *****************************************************************
       PROCEDURE DIVISION USING PA-NTOT-GROUP,
                                MKN-RECORD.
           if  FIRST-TIME = 'Y'
               perform FIRST-TIME-LOGIC
           end-if

      *    HEX20 Parameter is DISABLE
      *    HEX40 Parameter is DISABLE
      *    HEXTR Parameter is DISABLE
      *   NUMCHK Parameter is DISABLE
           add MKN-BS-72                          to NTOT-FLD-00001
           move NTOT-FLD-00001 to NTOT-EDT-00001
           move NTOT-CHR-00001 to PA-NTOT-NUMB(00001)
           move 'BN' to PA-NTOT-TYPE(00001)
           add MKN-BS-23                          to NTOT-FLD-00002
           move NTOT-FLD-00002 to NTOT-EDT-00002
           move NTOT-CHR-00002 to PA-NTOT-NUMB(00002)
           move 'BN' to PA-NTOT-TYPE(00002)
           add MKN-BS-52                          to NTOT-FLD-00003
           move NTOT-FLD-00003 to NTOT-EDT-00003
           move NTOT-CHR-00003 to PA-NTOT-NUMB(00003)
           move 'BN' to PA-NTOT-TYPE(00003)
           add MKN-BS-60                          to NTOT-FLD-00004
           move NTOT-FLD-00004 to NTOT-EDT-00004
           move NTOT-CHR-00004 to PA-NTOT-NUMB(00004)
           move 'BN' to PA-NTOT-TYPE(00004)
           add MKN-BS-20                          to NTOT-FLD-00005
           move NTOT-FLD-00005 to NTOT-EDT-00005
           move NTOT-CHR-00005 to PA-NTOT-NUMB(00005)
           move 'BN' to PA-NTOT-TYPE(00005)
           add MKN-BU-72                          to NTOT-FLD-00006
           move NTOT-FLD-00006 to NTOT-EDT-00006
           move NTOT-CHR-00006 to PA-NTOT-NUMB(00006)
           move 'BN' to PA-NTOT-TYPE(00006)
           add MKN-BU-23                          to NTOT-FLD-00007
           move NTOT-FLD-00007 to NTOT-EDT-00007
           move NTOT-CHR-00007 to PA-NTOT-NUMB(00007)
           move 'BN' to PA-NTOT-TYPE(00007)
           add MKN-BU-52                          to NTOT-FLD-00008
           move NTOT-FLD-00008 to NTOT-EDT-00008
           move NTOT-CHR-00008 to PA-NTOT-NUMB(00008)
           move 'BN' to PA-NTOT-TYPE(00008)
           add MKN-BU-60                          to NTOT-FLD-00009
           move NTOT-FLD-00009 to NTOT-EDT-00009
           move NTOT-CHR-00009 to PA-NTOT-NUMB(00009)
           move 'BN' to PA-NTOT-TYPE(00009)
           add MKN-BU-20                          to NTOT-FLD-00010
           move NTOT-FLD-00010 to NTOT-EDT-00010
           move NTOT-CHR-00010 to PA-NTOT-NUMB(00010)
           move 'BN' to PA-NTOT-TYPE(00010)
           add MKN-PS-72                          to NTOT-FLD-00011
           move NTOT-FLD-00011 to NTOT-EDT-00011
           move NTOT-CHR-00011 to PA-NTOT-NUMB(00011)
           move 'PK' to PA-NTOT-TYPE(00011)
           add MKN-PS-23                          to NTOT-FLD-00012
           move NTOT-FLD-00012 to NTOT-EDT-00012
           move NTOT-CHR-00012 to PA-NTOT-NUMB(00012)
           move 'PK' to PA-NTOT-TYPE(00012)
           add MKN-PS-52                          to NTOT-FLD-00013
           move NTOT-FLD-00013 to NTOT-EDT-00013
           move NTOT-CHR-00013 to PA-NTOT-NUMB(00013)
           move 'PK' to PA-NTOT-TYPE(00013)
           add MKN-PS-60                          to NTOT-FLD-00014
           move NTOT-FLD-00014 to NTOT-EDT-00014
           move NTOT-CHR-00014 to PA-NTOT-NUMB(00014)
           move 'PK' to PA-NTOT-TYPE(00014)
           add MKN-PS-20                          to NTOT-FLD-00015
           move NTOT-FLD-00015 to NTOT-EDT-00015
           move NTOT-CHR-00015 to PA-NTOT-NUMB(00015)
           move 'PK' to PA-NTOT-TYPE(00015)
           add MKN-PU-72                          to NTOT-FLD-00016
           move NTOT-FLD-00016 to NTOT-EDT-00016
           move NTOT-CHR-00016 to PA-NTOT-NUMB(00016)
           move 'PK' to PA-NTOT-TYPE(00016)
           add MKN-PU-23                          to NTOT-FLD-00017
           move NTOT-FLD-00017 to NTOT-EDT-00017
           move NTOT-CHR-00017 to PA-NTOT-NUMB(00017)
           move 'PK' to PA-NTOT-TYPE(00017)
           add MKN-PU-52                          to NTOT-FLD-00018
           move NTOT-FLD-00018 to NTOT-EDT-00018
           move NTOT-CHR-00018 to PA-NTOT-NUMB(00018)
           move 'PK' to PA-NTOT-TYPE(00018)
           add MKN-PU-60                          to NTOT-FLD-00019
           move NTOT-FLD-00019 to NTOT-EDT-00019
           move NTOT-CHR-00019 to PA-NTOT-NUMB(00019)
           move 'PK' to PA-NTOT-TYPE(00019)
           add MKN-PU-20                          to NTOT-FLD-00020
           move NTOT-FLD-00020 to NTOT-EDT-00020
           move NTOT-CHR-00020 to PA-NTOT-NUMB(00020)
           move 'PK' to PA-NTOT-TYPE(00020)
           add MKN-ZS-72                          to NTOT-FLD-00021
           move NTOT-FLD-00021 to NTOT-EDT-00021
           move NTOT-CHR-00021 to PA-NTOT-NUMB(00021)
           move 'ZD' to PA-NTOT-TYPE(00021)
           add MKN-ZS-23                          to NTOT-FLD-00022
           move NTOT-FLD-00022 to NTOT-EDT-00022
           move NTOT-CHR-00022 to PA-NTOT-NUMB(00022)
           move 'ZD' to PA-NTOT-TYPE(00022)
           add MKN-ZS-52                          to NTOT-FLD-00023
           move NTOT-FLD-00023 to NTOT-EDT-00023
           move NTOT-CHR-00023 to PA-NTOT-NUMB(00023)
           move 'ZD' to PA-NTOT-TYPE(00023)
           add MKN-ZS-60                          to NTOT-FLD-00024
           move NTOT-FLD-00024 to NTOT-EDT-00024
           move NTOT-CHR-00024 to PA-NTOT-NUMB(00024)
           move 'ZD' to PA-NTOT-TYPE(00024)
           add MKN-ZS-20                          to NTOT-FLD-00025
           move NTOT-FLD-00025 to NTOT-EDT-00025
           move NTOT-CHR-00025 to PA-NTOT-NUMB(00025)
           move 'ZD' to PA-NTOT-TYPE(00025)
           add MKN-ZU-72                          to NTOT-FLD-00026
           move NTOT-FLD-00026 to NTOT-EDT-00026
           move NTOT-CHR-00026 to PA-NTOT-NUMB(00026)
           move 'ZD' to PA-NTOT-TYPE(00026)
           add MKN-ZU-23                          to NTOT-FLD-00027
           move NTOT-FLD-00027 to NTOT-EDT-00027
           move NTOT-CHR-00027 to PA-NTOT-NUMB(00027)
           move 'ZD' to PA-NTOT-TYPE(00027)
           add MKN-ZU-52                          to NTOT-FLD-00028
           move NTOT-FLD-00028 to NTOT-EDT-00028
           move NTOT-CHR-00028 to PA-NTOT-NUMB(00028)
           move 'ZD' to PA-NTOT-TYPE(00028)
           add MKN-ZU-60                          to NTOT-FLD-00029
           move NTOT-FLD-00029 to NTOT-EDT-00029
           move NTOT-CHR-00029 to PA-NTOT-NUMB(00029)
           move 'ZD' to PA-NTOT-TYPE(00029)
           add MKN-ZU-20                          to NTOT-FLD-00030
           move NTOT-FLD-00030 to NTOT-EDT-00030
           move NTOT-CHR-00030 to PA-NTOT-NUMB(00030)
           move 'ZD' to PA-NTOT-TYPE(00030)

           GOBACK.

      *****************************************************************
       FIRST-TIME-LOGIC.
           add 1 to ZERO giving PA-NTOT-IDX
           move 'N' to FIRST-TIME
           move 'MKN-BS-72'                      to PA-NTOT-DESC(00001)
           move 'MKN-BS-23'                      to PA-NTOT-DESC(00002)
           move 'MKN-BS-52'                      to PA-NTOT-DESC(00003)
           move 'MKN-BS-60'                      to PA-NTOT-DESC(00004)
           move 'MKN-BS-20'                      to PA-NTOT-DESC(00005)
           move 'MKN-BU-72'                      to PA-NTOT-DESC(00006)
           move 'MKN-BU-23'                      to PA-NTOT-DESC(00007)
           move 'MKN-BU-52'                      to PA-NTOT-DESC(00008)
           move 'MKN-BU-60'                      to PA-NTOT-DESC(00009)
           move 'MKN-BU-20'                      to PA-NTOT-DESC(00010)
           move 'MKN-PS-72'                      to PA-NTOT-DESC(00011)
           move 'MKN-PS-23'                      to PA-NTOT-DESC(00012)
           move 'MKN-PS-52'                      to PA-NTOT-DESC(00013)
           move 'MKN-PS-60'                      to PA-NTOT-DESC(00014)
           move 'MKN-PS-20'                      to PA-NTOT-DESC(00015)
           move 'MKN-PU-72'                      to PA-NTOT-DESC(00016)
           move 'MKN-PU-23'                      to PA-NTOT-DESC(00017)
           move 'MKN-PU-52'                      to PA-NTOT-DESC(00018)
           move 'MKN-PU-60'                      to PA-NTOT-DESC(00019)
           move 'MKN-PU-20'                      to PA-NTOT-DESC(00020)
           move 'MKN-ZS-72'                      to PA-NTOT-DESC(00021)
           move 'MKN-ZS-23'                      to PA-NTOT-DESC(00022)
           move 'MKN-ZS-52'                      to PA-NTOT-DESC(00023)
           move 'MKN-ZS-60'                      to PA-NTOT-DESC(00024)
           move 'MKN-ZS-20'                      to PA-NTOT-DESC(00025)
           move 'MKN-ZU-72'                      to PA-NTOT-DESC(00026)
           move 'MKN-ZU-23'                      to PA-NTOT-DESC(00027)
           move 'MKN-ZU-52'                      to PA-NTOT-DESC(00028)
           move 'MKN-ZU-60'                      to PA-NTOT-DESC(00029)
           move 'MKN-ZU-20'                      to PA-NTOT-DESC(00030)
           add 00030 to ZERO giving PA-NTOT-HOT
           exit.

      *****************************************************************
      *           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: 2015/10/01  Generation Time: 23:53:03:06    *
      *****************************************************************

Table of Contents Previous Section Next Section The COBOL Copy File

The following (VTN256B1.cpy) is the COBOL copy file used to generate the COBOL programs that will calculate Summary Totals .

The file format for the test file is record sequential with a fixed record length of 256 bytes. The record content has text strings, numeric fields of various formats and a few filler items.

Table of Contents Previous Section Next Section COBOL Copy File for Test File

The following source member (MKN256B1.cpy) is the COBOL Copy File that defines the record structure for the test file.

      *****************************************************************
      *               MKN256B1.cpy - a COBOL Copy File                *
      *   Copy File for testing of Text Strings and Numeric Formats.  *
      *****************************************************************
      *         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  MKN-RECORD.
           05  MKN-TEXT.
               10  MKN-ID                PIC X.
               10  MKN-TAG               PIC X(08).
               10  MKN-COMMENT           PIC X(23).
      *
      * ------------------------------------------------------------- *
      *    A group of SIGNED and UNSIGNED Numbers using a
      *    COMPUTATIONAL format.
      *    The physical structure is Binary.
      *    An abbreviated form of the USAGE IS COMPUTATIONAL clause
      *    is simply coded in COMP.
      *    An following statement is an example of the full sysntax.
      *    01  FIELD-NAME    PIC S9(5)V99  USAGE IS COMPUTATIONAL.
      *
           05  MKN-BS-NBRS.
               10  MKN-BS-72             PIC S9(7)V99   COMP.
               10  MKN-BS-23             PIC S9(2)V999  COMP.
               10  MKN-BS-52             PIC S9(5)V99   COMP.
               10  MKN-BS-60             PIC S9(6)      COMP.
               10  MKN-BS-20             PIC S99        COMP.
           05  MKN-BU-NBRS.
               10  MKN-BU-72             PIC 9(7)V99    COMP.
               10  MKN-BU-23             PIC 9(2)V999   COMP.
               10  MKN-BU-52             PIC 9(5)V99    COMP.
               10  MKN-BU-60             PIC 9(6)       COMP.
               10  MKN-BU-20             PIC 99         COMP.
      *
      * ------------------------------------------------------------- *
      *    A group of SIGNED and UNSIGNED Numbers using a
      *    COMPUTATIONAL-3 format.
      *    The physical structure is Packed Decimal.
      *    An abbreviated form of the USAGE IS COMPUTATIONAL-3 clause
      *    is simply coded in COMP-3.
      *    An following statement is an example of the full sysntax.
      *    01  FIELD-NAME    PIC S9(5)V99  USAGE IS COMPUTATIONAL-3.
      *
           05  MKN-PS-NBRS.
               10  MKN-PS-72             PIC S9(7)V99   COMP-3.
               10  MKN-PS-23             PIC S9(2)V999  COMP-3.
               10  MKN-PS-52             PIC S9(5)V99   COMP-3.
               10  MKN-PS-60             PIC S9(6)      COMP-3.
               10  MKN-PS-20             PIC S99        COMP-3.
           05  MKN-PU-NBRS.
               10  MKN-PU-72             PIC 9(7)V99    COMP-3.
               10  MKN-PU-23             PIC 9(2)V999   COMP-3.
               10  MKN-PU-52             PIC 9(5)V99    COMP-3.
               10  MKN-PU-60             PIC 9(6)       COMP-3.
               10  MKN-PU-20             PIC 99         COMP-3.
      *
      * ------------------------------------------------------------- *
      *    A group of SIGNED and UNSIGNED Numbers using a
      *    DISPLAY format.
      *    The physical structure is Zoned Decimal.
      *    The USAGE IS DISPLAY clause is the default value and
      *    is typically not hard coded.
      *    An following statement is an example of the full sysntax.
      *    01  FIELD-NAME    PIC S9(5)V99  USAGE IS DISPLAY.
      *
           05  MKN-ZS-NBRS.
               10  MKN-ZS-72             PIC S9(7)V99.
               10  MKN-ZS-23             PIC S9(2)V999.
               10  MKN-ZS-52             PIC S9(5)V99.
               10  MKN-ZS-60             PIC S9(6).
               10  MKN-ZS-20             PIC S99.
           05  MKN-ZU-NBRS.
               10  MKN-ZU-72             PIC 9(7)V99.
               10  MKN-ZU-23             PIC 9(2)V999.
               10  MKN-ZU-52             PIC 9(5)V99.
               10  MKN-ZU-60             PIC 9(6).
               10  MKN-ZU-20             PIC 99.
      *
           05  FILLER                   PIC X(86).
      *
      * ------------------------------------------------------------- *
      *    A Text string to tag the end of a record.
      *
           05  MKN-TEXT-END.
               10  MKN-END               PIC X(8).
      *
      ***  MKN256B1 - End-of-Copy File - - - - - - - - - - - MKN256B1 *
      *****************************************************************
      *

Table of Contents Previous Section Next Section HTML Document for Test File

The SimoTime Technologies have the ability to scan a COBOL copy file and create an HTML document of a record structure or record layout. The HTML documentation provides information that is not easy to obtain by viewing the COBOL copy file. For example, the physical position of a field within a record as calculated during the copy file scan and placed in the HTML document.

Link to Internet   Link to Server   Explore numeric values that use the BINARY, PACKED and ZONED format. This HTML document was generated by SimoTime Technologies and uses the field definitions included in a user-defined COBOL copy file to calculate additional information such as the field positions within the record.

Table of Contents Previous Section Next Section The Process Control File

The following (VTN25601.pcf) is the Process Control File used to generate the COBOL programs.

***********************************************************************
*      VTN25601.PCF - a Process Control File for Numeric Totals       *
*   This Process Control File is provided by SimoTime Technologies    *
*             (C) Copyright 1987-2019 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 is a sequential file with 256-byte, fixed-length records.    *
***********************************************************************
* This Process Control File will be used to generate a callable COBOL
* routine that will calculate summary totals for the specified field
* names as defined in a COBOL copy file.
*
* The input file (SYSUT1) is a Micro Focus Record Sequential file.
* The output will be written to SYSOUT.
*
* The following group of statements will prepare the System and
* Job environments.
*
&SIMOPREP  call ..\ENV1BASE
&USERPREP  call USERCOGI
*
* The following group of statements will define the COBOL Copy File
* used for input and the HTML file to be created.
*
&COPYFILE  MKN256B1.cpy
&HTMLFILE  mkn256b1.htm
*
* The following group of statements will define the program behavior
* and characteristics for the file I/O Program to be generated.
*
&CONFORM   IBM
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Totals for Multiple Numeric Types
&PROGID    VTN256C1
&SYSUT1    org=Sequential recfm=FIXED    rmax=256
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the numeric totals
* to be generated.
* The following defines the name of the callable routine for special
* numeric processing.
*
&NUMCALL   VTN256R1
&NUMREC    MKN-RECORD
*
* The following group of statements will define the type of processing
* and the name of the numeric fields.
*
&UT1TOTAL  MKN-BS-72
&UT1TOTAL  MKN-BS-23
&UT1TOTAL  MKN-BS-52
&UT1TOTAL  MKN-BS-60
&UT1TOTAL  MKN-BS-20
*
&UT1TOTAL  MKN-BU-72
&UT1TOTAL  MKN-BU-23
&UT1TOTAL  MKN-BU-52
&UT1TOTAL  MKN-BU-60
&UT1TOTAL  MKN-BU-20
*
&UT1TOTAL  MKN-PS-72
&UT1TOTAL  MKN-PS-23
&UT1TOTAL  MKN-PS-52
&UT1TOTAL  MKN-PS-60
&UT1TOTAL  MKN-PS-20
*
&UT1TOTAL  MKN-PU-72
&UT1TOTAL  MKN-PU-23
&UT1TOTAL  MKN-PU-52
&UT1TOTAL  MKN-PU-60
&UT1TOTAL  MKN-PU-20
*
&UT1TOTAL  MKN-ZS-72
&UT1TOTAL  MKN-ZS-23
&UT1TOTAL  MKN-ZS-52
&UT1TOTAL  MKN-ZS-60
&UT1TOTAL  MKN-ZS-20
*
&UT1TOTAL  MKN-ZU-72
&UT1TOTAL  MKN-ZU-23
&UT1TOTAL  MKN-ZU-52
&UT1TOTAL  MKN-ZU-60
&UT1TOTAL  MKN-ZU-20
*
&END

Table of Contents Previous Section Next Section Summary

The purpose of this document is to describe how to read a file and accumulate a group of user-defined summary totals based on the field names and field formats as specified in a COBOL copy file. This document may be used 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 documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

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

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

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

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

Table of Contents Previous Section Next Section Downloads and Links

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

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

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

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

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

Link to Internet   Link to Server   Explore 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 that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

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

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

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Comments or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

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

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

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

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


Return-to-Top
Summary Totals and Record Counts, Data Validation or Regression Testing
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com