TCPHX4C2
COBOL Source Member
  Table of Contents  v-23.01.01 
  Introduction
  COBOL Source Member
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact, Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document shows the content of an ASCII/Text file. The record structure may use one of the following formats.

1. Comma-Separated-Values (CSV) format.
2. A group of concatenated Text string of fixed length. The numeric values may be padded with leading zeroes and the text values may be padded with trailing spaces.
3. A single string of ASCII-encoded text.

 


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

Table of Contents Previous Section Next Section COBOL Source Member

The following shows the content of a user-defined, ASCII/Text file.

This generated COBOL program will access a user file and call a second program that will present the record content in a Hex-Dump Format along with a possible dislay of an associated ASCII or EBCDIC character.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    TCPHX4C2.
       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: 2022-08-30  Generation Time: 23:01:31:10    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   SYSUT1   SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  INPUT     SYSUT3   ASCII/CRLF    FIXED      00080            *
      *****************************************************************
       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 SYSUT3-FILE  ASSIGN TO       SYSUT3
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT3-STATUS.

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

       FD  SYSUT3-FILE
           DATA RECORD    IS SYSUT3-REC
           .
       01  SYSUT3-REC.
           05  SYSUT3-DATA-01 PIC X(00080).

      *****************************************************************
      * This program was created with the SYSHXLS3.TXT file as the    *
      * template for the File I/O. It is intended for use with the    *
      * Hex Dump facility.                                            *
      *                                                               *
      * The SYSHXLS3 template provides for the sequential reading of  *
      * an input file (SYSUT1, a sequential file).                    *
      *                                                               *
      * The Hexadecimal dump information will be written to an output *
      * file that is defined by the HEX DUMP Device or SYSLUSER.      *
      *                                                               *
      * The record structure for the records to be read from SYSUT1   *
      * are defined in a control file (SYSUT3) that contains a range  *
      * of record numbers to be selected.                             *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 22.08.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 '* TCPHX4C2 '.
           05  T2 pic X(34) value 'Dump RSEQ80 to SYSLUSER via SYSUT3'.
           05  T3 pic X(10) value ' v22.08.15'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* TCPHX4C2 '.
           05  C2 pic X(32) value 'This Data File HexDump Member 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 '* TCPHX4C2 '.
           05  C2 pic X(32) value 'This Data File HexDump Member wa'.
           05  C3 pic X(32) value 's generated by SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* TCPHX4C2 '.
           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'.

       01  SYSUT3-STATUS.
           05  SYSUT3-STATUS-L     pic X.
           05  SYSUT3-STATUS-R     pic X.
       01  SYSUT3-EOF              pic X       value 'N'.
       01  SYSUT3-OPEN-FLAG        pic X       value 'C'.

       01  SYSUT1-LRECL            pic 9(5)    value 00080.
       01  SYSUT3-LRECL            pic 9(5)    value 00080.

       01  SYSUT1-LRECL-M  pic 9(5)    value 00080.
       01  SYSUT3-LRECL-M  pic 9(5)    value 00080.

       01  D-LEN           pic 9(5)    value 00080.
       01  D-POS           pic 9(5)    value 1.

       01  W-LEN           pic 9(5)    value 0.
       01  W-POS           pic 9(5)    value 10.

      *    Header row for positional indicator...
       01  DUMP-H10.
           05  FILLER      pic X(5)    value '....:'.
           05  POS-NO      pic 9(5)    value 10.
           05  FILLER      pic X(10)   value '....:.....'.
       01  DUMP-W10.
           05  FILLER      pic X(5)    value '....:'.
           05  W10-POS-NO  pic X(5)    value '00000'.
           05  FILLER      pic X(10)   value '....:.....'.

       01  DUMP-HEADER     pic X(00080)  value all '.'.
       01  D-P1            pic 9(5)      value 0.
       01  WK-1            pic 9(5)      value 0.
       01  WK-2            pic 9(5)      value 0.

       01  RECORD-HEADER.
           05  RECORD-ID   pic X(8)    value 'SYSUT1'.
           05  filler      pic X(2)    value '..'.
           05  REC-NUMBER  pic 9(9)    value 0.
           05  filler      pic X       value '('.
           05  RECORD-POS  pic 9(5)    value 0.
           05  filler      pic X       value ':'.
           05  RECORD-LEN  pic 9(5)    value 0.
           05  filler      pic X(2)    value ') '.
           05  REC-CTYPE   pic X(10)   value 'UNKNOWN   '.
           05  filler      pic X(2)    value SPACES.
           05  REC-CMODE   pic X(10)   value 'UNKNOWN   '.

       01  SYSLOG-OUTPUT   pic X(4)    value '&&&&'.

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

       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   'Dump RSEQ80 to SYSLUSER via SYSUT3'.
           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  PT-1            pic 9(5)    value 0.
       01  PT-2            pic 9(5)    value 0.
       01  WORK-05         pic X(5).
       01  BN-2-GROUP.
           05  BN-2-VALUE  pic 9(3)    comp value 0.

       01  SEQ-GROUP       pic 9(4)    value 3124.
       01  SEQ-TABLE       redefines   SEQ-GROUP.
           05  SEQ-VALUE   pic 9       occurs 4 times.
       01  SEQ-IX          pic 9       value 0.

       01  DUMP-FLAGS.
           05  DUMP-ASC        pic X       value 'Y'.
           05  DUMP-EBC        pic X       value 'Y'.
           05  DUMP-HEX        pic X       value 'Y'.
           05  DUMP-DET-GRP.
               10  DUMP-DET    pic X       value 'Y'.
               10  DUMP-DET-2  pic XX      value 'NE'.
           05  DUMP-SUM        pic X       value 'Y'.
       01  DUMP-PGM            pic X(8)    value 'SIMOL32K'.

       01  YES-YES         pic XX      value 'YY'.
       01  N-BYTE          pic X       value 'N'.
       01  Y-BYTE          pic X       value 'Y'.
       01  GROUP-DELIMITER pic X       value 'Y'.

       01  RANGE-GROUP.
           05  FILLER              pic X(11) value '/Range Low='.
           05  RANGE-GROUP-LO.
               10  RANGE-VALUE-LO  pic 9(11)   value 1.
           05  FILLER              pic X(07) value ', High='.
           05  RANGE-GROUP-HI.
               10  RANGE-VALUE-HI  pic 9(11)   value 999999999.

       01  RA11-GROUP.
           05  RA11-VALUE  pic 9(11)   value 0.
       01  RA11-IDX        pic 9(5)    value 0.

       01  TAG11-PARM      PIC X(11)   value SPACES.

       01  RPI-10.
           05  RPI-ALPHA   pic X(5)    value '....:'.
           05  RPI-VALUE   pic 9(5)    value 10.

       01  LOOP-REDO       pic 9(5)    value 0.

       01  SYSUT1-TOTAL.
           05  SYSUT1-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for SYSUT1  '.
       01  SYSUT2-TOTAL.
           05  SYSUT2-ADD  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for SYSUT2  '.
       01  SYSUT3-TOTAL.
           05  SYSUT3-RDR  pic 9(9)  value 0.
           05  filler      pic X(3)  value ' - '.
           05  filler      pic X(25) value 'Record count for SYSUT3  '.

       COPY HEXTAB02.
       COPY PASSPARS.
       COPY PASSULOG.

      *    USERDATA Definitions not specified.

      *****************************************************************
       PROCEDURE DIVISION.
           perform JOB-STARTING
           perform until SYSUT1-STATUS not = '00'
                   perform SYSUT1-READ
                   if  SYSUT1-STATUS = '00'
                       add 1 to SYSUT1-RDR
                       if  SYSUT1-RDR > RANGE-VALUE-LO
                       or  SYSUT1-RDR = RANGE-VALUE-LO
                           if  SYSUT1-RDR < RANGE-VALUE-HI
                           or  SYSUT1-RDR = RANGE-VALUE-HI
                           perform DUMP-POSITION-INDICATOR
                           perform DUMP-PRIMARY-RECORD
                           end-if
                       end-if
                   end-if
           end-perform
           perform JOB-FINISHED

           GOBACK.

      *****************************************************************
      *    Build the position header row...
      *****************************************************************
       DUMP-POSITION-INDICATOR.
           add 10 to ZERO giving POS-NO
           subtract 1 from D-POS giving WK-1
           divide 10 into WK-1 giving WK-1 remainder WK-2
           add 1 to WK-2
           perform varying D-P1 from 1 by 10 until D-P1 > D-LEN - 10
               move DUMP-H10 to DUMP-W10
               inspect W10-POS-NO replacing leading ZEROES by '.'
               move DUMP-W10(WK-2:10) to DUMP-HEADER(D-P1:10)
               add 10 to POS-NO
           end-perform

           move 'HYPE' to ULOG-REQUEST
      *    add 28 to ZERO giving ULOG-LENGTH
           add D-LEN to ZERO      giving ULOG-LENGTH
           move all '-'               to ULOG-MESSAGE(1:D-LEN)
           move '* Record Count is ' to ULOG-MESSAGE(1:18)
           move SYSUT1-RDR            to ULOG-MESSAGE(19:9)
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE

           add D-LEN to ZERO giving ULOG-LENGTH
           move DUMP-HEADER(1:D-LEN) to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE
           exit.

      *****************************************************************
       DUMP-PRIMARY-RECORD.
           move 'DUMP'                    to ULOG-REQUEST
           add SYSUT1-LRECL-M to ZERO giving ULOG-LENGTH
           move SYSUT1-REC(D-POS:D-LEN)    to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE
           exit.

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

           move 'POST' to ULOG-REQUEST
           add 80 to ZERO giving ULOG-LENGTH

           if  GROUP-DELIMITER = 'Y'
               move SPACES  to ULOG-MESSAGE
               call DUMP-PGM using ULOG-PASS-AREA
                                   ULOG-MESSAGE
               move all '*' to ULOG-MESSAGE(1:79)
               call DUMP-PGM using ULOG-PASS-AREA
                                   ULOG-MESSAGE
           end-if

           move 'Conclude' to INFO-ID
           move INFO-SHORT to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE
           move 'Finished' to INFO-ID

           move SYSUT1-TOTAL to ULOG-MESSAGE
           call DUMP-PGM  using ULOG-PASS-AREA
                                ULOG-MESSAGE

           move SYSUT3-TOTAL to ULOG-MESSAGE
           call DUMP-PGM  using ULOG-PASS-AREA
                                ULOG-MESSAGE

           perform Z-THANK-YOU.

           move 'WRAP' to ULOG-REQUEST
               call DUMP-PGM using ULOG-PASS-AREA
                                   ULOG-MESSAGE

           exit.

      *****************************************************************
       JOB-STARTING.
           perform Z-POST-COPYRIGHT
           perform SYSUT1-OPEN
           perform JOB-STARTING-CNTL

           move 'PREP' to ULOG-REQUEST
           move SPACES        to ULOG-MESSAGE
           move 'SIMOL32K'    to ULOG-SYSLOG-MODE
           move 'HTML'        to ULOG-SYSLOG-FORMAT
           move 'DISABLED'    to ULOG-SYSOUT-MODE
           move 'TEXT'        to ULOG-SYSOUT-FORMAT
           move 'DISABLED'    to ULOG-SYSCON-MODE
           move 'TEXT'        to ULOG-SYSCON-FORMAT
           move 'Y'           to ULOG-DUMP-ASC
           move 'Y'           to ULOG-DUMP-HEX
           move 'Y'           to ULOG-DUMP-EBC
           move 'Y'           to ULOG-DUMP-RPI
           move 'Y'           to ULOG-DUMP-DTL
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           move 'MAKE' to ULOG-REQUEST
           call DUMP-PGM using ULOG-PASS-AREA ULOG-MESSAGE

           move 'POST' to ULOG-REQUEST
           add 79 to ZERO giving ULOG-LENGTH
           move all '*' to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE
           move SIM-TITLE to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE
           move SIM-COPYRIGHT to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE
           move all '*' to ULOG-MESSAGE(1:79)
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE
           move INFO-STATEMENT to ULOG-MESSAGE
           call DUMP-PGM using ULOG-PASS-AREA
                               ULOG-MESSAGE
           exit.

      *****************************************************************
       JOB-STARTING-CNTL.
           perform SYSUT3-OPEN
           if  SYSUT3-STATUS = '00'
               move 'SYSUT3 Opened for User Parameters...'
                 to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
      *        Prepare control items for parsing.
               move '0' to PRS-REQUEST
               add    9 to ZERO giving PRS-STATUS
               move ' ' to PRS-DELIMITER
               move 'N' to PRS-TERMINATOR
               move ' ' to PRS-TERMINATOR-BYTE
               add    5 to ZERO giving PRS-TABLE-MAX
               add   80 to ZERO giving PRS-BUFFER-SIZE
               perform until SYSUT3-STATUS not = '00'
                       perform SYSUT3-READ
                       if  SYSUT3-STATUS = '00'
                           move SYSUT3-REC to MESSAGE-TEXT
                           perform Z-DISPLAY-MESSAGE-TEXT
                           if  SYSUT3-REC(1:1) = '/'
                               move SYSUT3-REC    to PRS-BUFFER
                               call 'SIMOPARS' using PRS-PARAMETERS
                               perform JOB-STARTING-CNTL-10
                           end-if
                       end-if
               end-perform
               perform SYSUT3-CLOSE
           else
               move 'Assume User Defaults for Parameters...'
                 to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           exit.

      *****************************************************************
       JOB-STARTING-CNTL-10.
           if  PRS-POSITION(1) > 0
           and PRS-SIZE    (1) < 12
               move SPACES to TAG11-PARM
               move SYSUT3-REC(PRS-POSITION(1):PRS-SIZE(1))
                 to TAG11-PARM
               evaluate TAG11-PARM
                 when '/RANGE     ' perform JOB-STARTING-CNTL-RANGE
                 when other         continue
               end-evaluate
           end-if
           exit.

      *****************************************************************
       JOB-STARTING-CNTL-RANGE.
           if  PRS-POSITION(2) > 0
           and PRS-SIZE(2)     < 12
               move SPACES to RA11-GROUP
               move SYSUT3-REC(PRS-POSITION(2):PRS-SIZE(2))
                 to RA11-GROUP
               perform RA11-ADJUST
               if  RA11-VALUE is NUMERIC
                   add RA11-VALUE to ZERO giving RANGE-VALUE-LO
               else
                   move '/RANGE Parameter-1 is invalid or non-numeric'
                     to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
               end-if
           end-if

           if  PRS-POSITION(3) > 0
           and PRS-SIZE(3)     < 12
               move SPACES to RA11-GROUP
               move SYSUT3-REC(PRS-POSITION(3):PRS-SIZE(3))
                 to RA11-GROUP
               perform RA11-ADJUST
               if  RA11-VALUE is NUMERIC
                   add RA11-VALUE to ZERO giving RANGE-VALUE-HI
               else
                   move '/RANGE Parameter-2 is invalid or non-numeric'
                     to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
               end-if
           end-if

           move RANGE-GROUP to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *****************************************************************
       RA11-ADJUST.
           perform until RA11-GROUP(11:1) not = SPACE
             add 10 to ZERO giving RA11-IDX
             perform until RA11-IDX = 0
               move RA11-GROUP(RA11-IDX:1)
                 to RA11-GROUP(RA11-IDX + 1:1)
               subtract 1 from RA11-IDX
             end-perform
             move '0' to RA11-GROUP(1:1)
           end-perform
           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 Control or Parameter File...             *
      *****************************************************************
       SYSUT3-READ.
           read SYSUT3-FILE
           if  SYSUT3-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               add 1 to SYSUT3-RDR
           else
               if  SYSUT3-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 SYSUT3-EOF
               else
                   move 'READ Failure with SYSUT3  ' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move SYSUT3-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT3-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input SYSUT3-FILE
           if  SYSUT3-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT3-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with SYSUT3  ' to MESSAGE-TEXT
               perform Z-DISPLAY-TO-CONSOLE
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT3-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT3-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT3-FILE
           if  SYSUT3-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SYSUT3-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with SYSUT3  ' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move SYSUT3-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 CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-TO-CONSOLE.
           perform Z-CALCULATE-MESSAGE-LSB
           if MESSAGE-TEXT-2 = SPACES
           display MESSAGE-BUFFER(1:MSG-LSB) upon console
           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.

      *****************************************************************
       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: 2022-08-30  Generation Time: 23:01:31:14    *
      *****************************************************************

Table of Contents Previous Section Next Section Summary

This document shows the content of an ASCII/Text file that has a record structure that uses a Comma-Separated-Values (CSV) format. 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, Comment 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 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 Binary or COMP format for numeric data strings. This numeric structure is supported by COBOL and may be explicitly defined with the "USAGE IS COMP" or "USAGE IS BINARY" clause.

Link to Internet   Link to Server   Explore The Packed-Decimal or COMP-3 format for numeric data strings. This numeric structure is supported by COBOL and may be explicitly defined with the "USAGE IS COMP-3" clause.

Link to Internet   Link to Server   Explore The Zoned-Decimal format for numeric data strings. This numeric structure is the default numeric for COBOL and may be explicitly defined with the "USAGE IS DISPLAY" clause.

Link to Internet   Link to Server   Explore 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.

Link to Internet   Link to Server   Explore How to Generate a Data File Compare, Validate or Hex-Dump 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 a data file compare, accumulate summary totals with a record count or produce a Hex-Dump of records in a VSAM, KSDS based on a list of user-defined keys. The User Guide contains a list of the PCF statements that are used for the data file compare, validate or dump process.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

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

Link to Internet   Link to Server   Explore The File Status Return Codes 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 connection.

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

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

Explore the GnuCOBOL Technologies available from SourceForge. SourceForge is an Open Source community resource dedicated to helping open source projects be as successful as possible. GnuCOBOL (formerly OpenCOBOL) is a COBOL compiler with run time support. The compiler (cobc) translates COBOL source to executable using intermediate C, designated C compiler and linker. This link will require an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Contact, Comments or Feedback

This document was created and is maintained by SimoTime Technologies and Services. 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
TCPHX4C2 - COBOL Source Member
Copyright © 1987-2023
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com