Files with 80-byte Records
CMD, Create QSAM & KSDS
  Table of Contents  v-24.01.01 – mkc080w8.htm 
  Introduction
  Program Objectives
  Program Input and Output
  Program Requirements
  Program Overview
  Windows CMD File
  The COBOL Programs
  Sequential Load, QSAM to KSDS
  Hex-Dump of KSDS
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document describes a Windows CMD file that will create a QSAM file and a VSAM KSDS with 80-byte records. The last job step will do a Hex-Dump of selected records in the VSAM KSDS based on a list of user-defined keys.

The source code for both COBOL programs is written using the VS COBOL II dialect and also work with COBOL for MVS and COBOL/370. This job may serve as a tutorial for new programmers and as a reference for experienced programmers.

This job script (or CMD File) is unique to the Windows Operating System and and is not part of the SimoTime the single set of source code that may be compiled and executed on an IBM Mainframe System, a Linux System, a UNIX System or a Windows System.

Note: A job script (JCL Member) is provided and may be used on an IBM Mainframe System, a Linux System, a UNIX System or a Windows System. The non-mainframe systems will require Micro Focus Technology.


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 Program Objectives

The following is a list of the functions provided by this job.

1 Demonstrate how to Create a Sequential Test File using in-stream data.
2 Demonstrate how to Create and populate a VSAM Key-Sequenced-Data-Set (KSDS).
3 Demonstrate how to present records from the VSAM, KSDS in a Hex-Dump format.
  Objectives when Creating the Test Files

 

Table of Contents Previous Section Next Section Program Input and Output

The input test data is included within the CMD File. The following is a list of the output test files created by this job.

1. DSN=SIMOTIME.DATA.CU80QSAM
1.1. This sequential file is created using the ECHO Command. The input is in-stream data that is included within the ECHO statement within the CMD File.
2. DSN=SIMOTIME.DATA.CU80KSDS
2.1. This file is created using a COBOL program (KSLOADC1.cbl). The input is the sequential file created in the previous job step.
3. DSN=SIMOTIME.DATA.CU80DUMP
3.1. This sequential file contains records that are in a Hex-Dump format and is created using a COBOL program. The primary input is in-stream data (SYSUT3) that is included within the CMD File. This in-stream data is a list of user-defined record keys that will be used to retrieve records from the VSAM, KSDS (SYSUT1) and write Hex-Dump information to a sequential file (SYSUT2),

 

Table of Contents Previous Section Next Section Program Requirements

This job must execute on a Windows System. The programs must compile and execute on Windows System that have COBOL technologies such as Micro Focus. The primary testing for this job is a DELL System running Windows/7 and Micro Focus Enterprise Server.

Table of Contents Previous Section Next Section Program Overview

The following diagram is an overview of how this job creates the test files and provides a Hex-Dump capability.

             
 
 
 
LSEQDELT
 
 
 
 
 
 
 
 
 
 
 
Start of Job, Execute Step 1 of 7
MKC080W8
cmd
Submit the job - MKC080W8
   
Job Step 1
Execute the Job Step
   
DELETE
cmd
 
 
CU80RSEQ
delete
Delete the CU80RSEQ Test File
 
 
 
LSEQMAKE
 
 
 
 
 
 
 
 
 
 
 
Step 2 of 7, QSAM Test File Files for Input
Job Step 2
Execute the Job Step
   
IN-STREAM
data
 
 
ECHO
cmd
   
   
CU80LSEQ
lseq
Make the QSAM Test File.
 
 
 
DATACONV
 
 
 
 
 
 
 
 
 
 
 
Step 3 of 7, Convert LSEQ to RSEQ
Job Step 3
Execute the Job Step
   
CU80LSEQ
lseq
   
   
CV80ALAR
cbl
 
 
CU80RSEQ
rseq
Convert LSEQ to RSEQ
 
 
 
KSDSLOAD
 
 
 
 
 
 
 
 
 
 
 
Step 4 of 7, Sequential Load of KSDS
Job Step 4
Execute the Job Step
   
CU80RSEQ
rseq
   
   
KSLOADC1
cbl
 
 
CU80KSDS
ksds
Execute KSLOADC1
 
 
 
WORKMAKE
 
 
 
 
 
 
 
 
 
 
 
Step 5 of 7, Define Record Keys for Hex-Dump
Job Step 5
Execute the Job Step
   
ECHO
cmd
 
 
CU80WORK
lseq
Overwrite Existing Work File
 
 
 
KEYSMAKE
 
 
 
 
 
 
 
 
 
 
 
Step 6 of 7, Convert LSEQ to RSEQ
Job Step 6
Execute the Job Step
   
CU80WORK
lseq
   
   
CV80ALAR
cbl
 
 
CU80KEYS
rseq
Copy/Convert, CU80WORK to CU80KEYS
 
 
 
DUMPEXEC
 
 
 
 
 
 
 
 
 
 
 
Step 7 of 7, Dump user-requested Records
Job Step 7
Execute the Job Step
   
CU80KSDS
ksds
   
   
HX80KSC3
cbl
 
 
CU80DUMP
rseq
Hex-Dump of selected records
   
SYSUT3
rseq
   
   
 
CMD, Create a Suite of Test Files with 80-Byte Records

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using an IBM Mainframe System or Micro Focus Enterprise Developer. The  light-red  boxes are unique to the SIMOTIME Technologies using a Linux, UNIX or Windows System and COBOL Technologies such as Micro Focus. The  light-yellow  boxes are SIMOTIME Technologies, Third-party Technologies, decision points or program transitions in the processing logic or program generations. The  light-blue  boxes identify the input/output data structures such as Documents, Spreadsheets, Data Files, VSAM Data Sets, Partitioned Data Set Members (PDSM's) or Relational Tables. The  light-gray  boxes identify a system function or an informational item.

Table of Contents Previous Section Next Section Windows CMD File

This job has eight (8) job steps. The following shows the content of the CMD File (MKC080W8.cmd) that is used to create the test files and provide hex-dump information.

@echo OFF
rem  * ************************************************************************
rem  *                 MKC080W8.CMD - a Windows Command File                  *
rem  *           This program is provided by SimoTime Technologies            *
rem  *              (C) Copyright 1987-2019 All Rights Reserved               *
rem  *                Web Site URL:   http://www.simotime.com                 *
rem  *                      e-mail:   helpdesk@simotime.com                   *
rem  * ************************************************************************
rem  *
rem  * Text   - Create various data files with 80-byte records.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This procedure uses the Microsoft "ECHO" command to pipe instream
rem  * data to an ASCII/Text file. The following terms are used.
rem  *
rem  * LSEQ - a Line Sequential File or ASCII/Text File
rem  * RSEQ - a Record Sequential File. This example uses a file of
rem  *        80-byte records that may be ASCII or EBCDIC encoded.
rem  * KSDS - a VSAM Key-Sequenced-Data-Set.
rem  *
rem  * 1. Delete previously created data file.
rem  * 2. Use the Windows "ECHO" function to Create an LSEQ file to be
rem  *    used as input to create additional files or data structures.
rem  * 3. Read the LSEQ file and write an RSEQ, ASCII File.
rem  * 4. Read the RSEQ, ASCII file and write a KSDS, ASCII File.
rem  * 5. Use "ECHO" to define keys to Hex-dump.
rem  * 6. Save the key-list to an RSEQ File.
rem  * 7. Do the Hex-Dump of the requested records.
rem  * 8. Convert Hex-dump (RSEQ) to ASCII/Text (LSEQ).
rem  *
rem  * *******************************************************************
rem  * Step 1 of 8, Delete any previously created file...
rem  *
     call ..\Env1BASE
     set CmdName=MKC080W8
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName% - v16.01.01"
     call SimoNOTE "Identify JobStep 1. Delete the LSEQ Data File"
     set CU80LSEQ=%BaseLib1%\DATA\TXT1\SIMOTIME.DATA.CU80LSEQ.txt
     if exist %CU80LSEQ% del %CU80LSEQ%
rem  *
rem  * *******************************************************************
rem  * Step 2 of 8, Create a new output file. Use the "echo" command
rem  *              provided with Microsoft Windows to pipe instream
rem  *              data to a new ASCII/Text file.
rem  *
     call SimoNOTE "Identify JobStep 2. Create the LSEQ Data File"
rem  ....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
echo 000100 Anderson       Adrian    111 Peachtree Plaza     Atlanta        GA 26101 >%CU80LSEQ%
echo 000200 Brown          Billie    222 Baker Boulevard     Baltimore      MD 35702 >>%CU80LSEQ%
echo 000300 Carson         Cameron   333 Crenshaw Blvd.      Cupertino      CA 96154 >>%CU80LSEQ%
echo 000400 Davidson       Dion      444 Main Street         Wilmington     DE 27323 >>%CU80LSEQ%
echo 000500 Everest        Evan      555 5TH Avenue          New York       NY 10341 >>%CU80LSEQ%
echo 000600 Franklin       Francis   666 66TH Avenue         Bedrock        NY 11903 >>%CU80LSEQ%
echo 000700 Garfunkel      Gwen      777 77TH Street         New York       NY 16539 >>%CU80LSEQ%
echo 000800 Harrison       Hilary    888 88TH Street         Pocatello      ID 79684 >>%CU80LSEQ%
echo 000900 Isley          Isabel    999 99TH Avenue         Indianapolis   IN 38762 >>%CU80LSEQ%
echo 001000 Johnson        Jamie     1010 Paradise Drive     Larkspur       CA 90504 >>%CU80LSEQ%
echo 001100 Kemper         Kelly     1111 Oak Circle         Kansas City    KS 55651 >>%CU80LSEQ%
echo 001200 Lemond         Lesley    1212 Lockwood Road      Mohave Desert  AZ 80303 >>%CU80LSEQ%
echo 001300 Mitchell       Marlow    1313 Miller Creek Road  Anywhere       TX 77123 >>%CU80LSEQ%
echo 001400 Newman         Noel      1414 Park Avenue        Santa Monica   CA 90210 >>%CU80LSEQ%
echo 001500 Osborn         Owen      1515 Center Stage       Rolling Rock   PA 36613 >>%CU80LSEQ%
echo 001600 Powell         Pierce    PO Box 1616             Ventura        CA 97712 >>%CU80LSEQ%
echo 001700 Quigley        Quincy    1717 Farm Hill Road     Oshkosh        WI 43389 >>%CU80LSEQ%
echo 001800 Ripley         Ray       1818 Alien Lane         Wayout         KS 55405 >>%CU80LSEQ%
echo 001900 Smith          Sammy     1919 Carnoustie Drive   Novato         CA 94919 >>%CU80LSEQ%
echo 002000 Tucker         Taylor    2020 Sanger Lane        St. Paul       MN 43998 >>%CU80LSEQ%
echo 002100 Underwood      Ulysses   2121 Wall Street        New York       NY 17623 >>%CU80LSEQ%
echo 002200 Van Etten      Valerie   2222 Vine Street        Hollywood      CA 98775 >>%CU80LSEQ%
echo 002300 Wilson         Wiley     2323 Main Street        Boston         MA 01472 >>%CU80LSEQ%
echo 002400 Xray           Xavier    2424 24TH Street        Nashville      TN 44190 >>%CU80LSEQ%
echo 002500 Young          Yanni     2525 Yonge Street       Toronto        ON 6B74A6>>%CU80LSEQ%
echo 002600 Zenith         Zebulon   2626 26TH Street        Dallas         TX 71922 >>%CU80LSEQ%
echo 123456 Doe            John      123 Main Street         Anywhere       OR 88156 >>%CU80LSEQ%
rem  *
     if not exist %CU80LSEQ% set JobStatus=0002
     if not "%JobStatus%" == "0000" goto EojNok
rem  *
rem  * *******************************************************************
rem  * Step 3 of 8, Read the previously created Line Sequential File
rem  *              and write a Record Sequential File with 80-byte,
rem  *              ASCII-encoded records.
rem  *
     call SimoNOTE "Identify JobStep 3. Convert LSEQ File to RSEQ File"
     set GETLS080=%CU80LSEQ%
     set PUTRS080=%BaseLib1%\DATA\ASC1\SIMOTIME.DATA.CU80RSEQ.DAT
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALAR
     if not exist %PUTRS080% set JobStatus=0003
     if not "%JobStatus%" == "0000" goto EojNok
     set CU80RSEQ=%PUTRS080%
rem  *
rem  * *******************************************************************
rem  * Step 4 of 8, Read a previously created Record Sequential File and
rem  *              write to a VSAM, KSDS with 80-byte, ASCII-encoded
rem  *              records. The key positions are 1-6.
rem  *
     call SimoNOTE "Identify JobStep 4. Convert RSEQ File to VSAM KSDS"
     set QSAM0080=%BaseLib1%\DATA\ASC1\SIMOTIME.DATA.CU80QSAM.DAT
     set KSDS0080=%BaseLib1%\DATA\ASC1\SIMOTIME.DATA.CU80KSDS.DAT
     if exist %KSDS0080% del %KSDS0080%
     run KSLOADC1
     if not exist %KSDS0080% set JobStatus=0004
     if not "%JobStatus%" == "0000" goto EojNok
rem  *
rem  * *******************************************************************
rem  * Step 5 of 8, Define records to be Hex-Dumped.
rem  * Note: the dump information will be written to the SYSUT2 file.
rem  * *******************************************************************
rem  *
     call SimoNOTE "Identify JobStep 5. Define records to be Hex-Dumped"
     set SYSUT1=%KSDS0080%
     set SYSUT2=%BaseLib1%\DATA\ASC1\SIMOTIME.DATA.CU80DUMP.DAT
     set SYSUT3=%BaseLib1%\DATA\ASC1\SIMOTIME.DATA.CU80KEYS.DAT
     set GETLS080=%BaseLib1%\DATA\ASC1\SIMOTIME.DATA.CU80WORK.TXT
     set PUTRS080=%SYSUT3%
     echo /USERKEY   000100>%GETLS080%
     echo /USERKEY   000200>>%GETLS080%
rem  *
rem  * *******************************************************************
rem  * Step 6 of 8, Convert ASCII/Text (LSEQ) to Record Sequential (RSEQ)
rem  * *******************************************************************
rem  *
     call SimoNOTE "Identify JobStep 6. Store the Hex-Dump List in SYSUT3"
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALAR
rem  *
rem  * *******************************************************************
rem  * Step 7 of 8, Execute the HEX Dump program.
rem  * Note: the dump information will be written to the SYSUT2 file.
rem  * *******************************************************************
rem  * Dump the content of the user-defined records within a VSAM, KSDS.
rem  * The results of the dump processing is posted to the SYSUT2 File.
rem  *
     call SimoNOTE "Identify JobStep 7. Dump the Requested Records"
     run HX80KSC3
rem  *
rem  * *******************************************************************
rem  * Step 8 of 8, Convert Hex-dump (RSEQ) to ASCII/Text (LSEQ)
rem  * *******************************************************************
rem  *
     call SimoNOTE "Identify JobStep 8. Hex-Dump SYSUT2 to ASCII/Text"
     set GETRS080=%SYSUT2%
     set PUTLS080=%BaseLib1%\DATA\ASC1\SIMOTIME.DATA.CU80DUMP.TXT
     if exist %PUTLS080% del %PUTLS080%
     run CV80ARAL
rem  *
rem  * *******************************************************************
rem  *
:EojAok
     call SimoNOTE "Produced DataSet %CU80LSEQ%"
     call SimoNOTE "Produced DataSet %CU80RSEQ%"
     call SimoNOTE "Produced DataSet %KSDS0080%"
     call SimoNOTE "Produced DataSet %GETLS080%"
     call SimoNOTE "Produced DataSet %SYSUT3%"
     call SimoNOTE "Produced DataSet %SYSUT2%"
     call SimoNOTE "Produced DataSet %PUTLS080%"
     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 The COBOL Programs

This section describes the two COBOL programs that are used in the test file creation process. Both of the programs were generated using SimoTime Technologies.

Table of Contents Previous Section Next Section Sequential Load, QSAM to KSDS

The following is the source code (KSLOADC1.cbl) for the COBOL program that does a sequential load of the VSAM, KSDS. The program reads a sequential file (QSAM0080) and adds the records to the VSAM, KSDS. The sequential file must be in sequence by the key field that is located in positions 1-6.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    KSLOADC1.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2018-10-10  Generation Time: 20:28:26:36    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   QSAM0080 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  SECONDARY KSDS0080 INDEXED       VARIABLE   00080    00001   *
      *                                              00080    00006   *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT QSAM0080-FILE  ASSIGN TO       QSAM0080
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS QSAM0080-STATUS.
           SELECT KSDS0080-FILE  ASSIGN TO       KSDS0080
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS KSDS0080-PKEY-00001-00006
                  FILE STATUS   IS KSDS0080-STATUS.

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

       FD  KSDS0080-FILE
           DATA RECORD    IS KSDS0080-REC
           .
       01  KSDS0080-REC.
           05  KSDS0080-PKEY-00001-00006        PIC X(00006).
           05  KSDS0080-DATA-00007-00074        PIC X(00074).

      *****************************************************************
      * This program was created with the SYSMASK1.TXT file as input. *
      * The SYSMASK1 provides for the sequential reading of the input *
      * file and the sequential writing of the output file.           *
      *                                                               *
      * If the output file is indexed then the input file must be in  *
      * sequence by the field that will be used to provide the key    *
      * for the output file. This is a sequential load process.       *
      *                                                               *
      * If the key field is not in sequence then refer to SYSMASK2    *
      * to provide for a random add or update of the indexed file.    *
      *                                                               *
      * This program mask will have the ASCII/EBCDIC table inserted   *
      * for use by the /TRANSLATE function of SimoZAPS.               *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 16.01.01          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* KSLOADC1 '.
           05  T2 pic X(34) value 'Load KSDS0080 from QSAM0080       '.
           05  T3 pic X(10) value ' v16.01.01'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* KSLOADC1 '.
           05  C2 pic X(32) value 'This Data File Convert Member wa'.
           05  C3 pic X(32) value 's generated by SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

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

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

       01  QSAM0080-LRECL            pic 9(5)    value 00080.
       01  KSDS0080-LRECL            pic 9(5)    value 00080.
       01  QSAM0080-LRECL-MAX        pic 9(5)    value 00080.
       01  KSDS0080-LRECL-MAX        pic 9(5)    value 00080.

      *****************************************************************
      * The following buffers are used to create a four-byte status   *
      * code that may be displayed.                                   *
      *****************************************************************
       01  IO-STATUS.
           05  IO-STAT1            pic X.
           05  IO-STAT2            pic X.
       01  IO-STATUS-04.
           05  IO-STATUS-0401      pic 9     value 0.
           05  IO-STATUS-0403      pic 999   value 0.
       01  TWO-BYTES-BINARY        pic 9(4)  BINARY.
       01  TWO-BYTES-ALPHA         redefines TWO-BYTES-BINARY.
           05  TWO-BYTES-LEFT      pic X.
           05  TWO-BYTES-RIGHT     pic X.

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(011)  value '* KSLOADC1 '.
           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 'KSLOADC1'.

       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   'Load KSDS0080 from QSAM0080       '.
           05  filler      pic X(24)
               value ' http://www.SimoTime.com'.

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

       01  WRITE-FLAG      pic X       value 'Y'.

       01  QSAM0080-TOTAL.
           05  QSAM0080-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for QSAM0080'.
       01  KSDS0080-TOTAL.
           05  KSDS0080-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for KSDS0080'.

      *****************************************************************
       PROCEDURE DIVISION.
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           move INFO-STATEMENT to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TEXT
           perform Z-POST-COPYRIGHT
           perform QSAM0080-OPEN
           perform KSDS0080-OPEN

      *    USRSOJ Processing not specified...

           perform until QSAM0080-STATUS not = '00'
               perform QSAM0080-READ
               if  QSAM0080-STATUS = '00'
                   add 1 to QSAM0080-RDR
                   perform BUILD-OUTPUT-RECORD
                   if  WRITE-FLAG = 'Y'
                       perform KSDS0080-WRITE
                       if  KSDS0080-STATUS = '00'
                           add 1 to KSDS0080-ADD
                       end-if
                   end-if
               end-if
           end-perform

      *    USREOJ Processing not specified...

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

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

           if  APPL-EOF
               move 'Complete' to INFO-ID
           else
               move 'ABENDING' to INFO-ID
           end-if
           move INFO-STATEMENT to MESSAGE-TEXT(1:79)
           perform Z-DISPLAY-MESSAGE-TEXT

           perform KSDS0080-CLOSE
           perform QSAM0080-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *    TransCOPY...
           move QSAM0080-REC(00001:00080) to KSDS0080-REC(00001:00080)
           exit.

      *****************************************************************
      * I/O Routines for the INPUT File...                            *
      *****************************************************************
       QSAM0080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close QSAM0080-FILE
           if  QSAM0080-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 QSAM0080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move QSAM0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       QSAM0080-READ.
           read QSAM0080-FILE
           if  QSAM0080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  QSAM0080-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 QSAM0080-EOF
               else
                   move 'READ Failure with QSAM0080' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move QSAM0080-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       QSAM0080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input QSAM0080-FILE
           if  QSAM0080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to QSAM0080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with QSAM0080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move QSAM0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       KSDS0080-WRITE.
           if  KSDS0080-OPEN-FLAG = 'C'
               perform KSDS0080-OPEN
           end-if
           write KSDS0080-REC
           if  KSDS0080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  KSDS0080-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if.
           if  APPL-AOK
               CONTINUE
           else
               move 'WRITE Failure with KSDS0080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move KSDS0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       KSDS0080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT KSDS0080-FILE
           if  KSDS0080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to KSDS0080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with KSDS0080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move KSDS0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       KSDS0080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close KSDS0080-FILE
           if  KSDS0080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to KSDS0080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with KSDS0080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move KSDS0080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * The following Z-ROUTINES provide administrative functions     *
      * for this program.                                             *
      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-CALCULATE-MESSAGE-LSB.
           add 267 to ZERO giving MSG-LSB
           perform until MSG-LSB < 80
                      or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE
             if MESSAGE-BUFFER(MSG-LSB:1) = SPACE
                subtract 1 from MSG-LSB
             end-if
           end-perform
           exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display the file status bytes. This routine will display as   *
      * four digits. If the full two byte file status is numeric it   *
      * will display as 00nn. If the 1st byte is a numeric nine (9)   *
      * the second byte will be treated as a binary number and will   *
      * display as 9nnn.                                              *
      *****************************************************************
       Z-DISPLAY-IO-STATUS.
           if  IO-STATUS not NUMERIC
           or  IO-STAT1 = '9'
               move IO-STAT1 to IO-STATUS-04(1:1)
               subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY
               move IO-STAT2 to TWO-BYTES-RIGHT
               add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-MESSAGE-TEXT
           else
               move '0000' to IO-STATUS-04
               move IO-STATUS to IO-STATUS-04(3:2)
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2018-10-10  Generation Time: 20:28:26:38    *
      *****************************************************************

Table of Contents Previous Section Next Section Hex-Dump of KSDS

The following is the source code (HX80KSC3.cbl) for the COBOL program that will do a Hex-Dump of selected records in the VSAM KSDS based on a list of user-defined keys. A sequential file (SYSUT3) contains the list of keys.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    HX80KSC3.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2018-10-11  Generation Time: 21:41:46:61    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   SYSUT1   INDEXED       FIXED      00080    00001   *
      *                                                       00006   *
      *  SECONDARY SYSUT2   SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT SYSUT1-FILE  ASSIGN TO       SYSUT1
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS SYSUT1-PKEY-00001-00006
                  FILE STATUS   IS SYSUT1-STATUS.
           SELECT SYSUT2-FILE  ASSIGN TO       SYSUT2
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT2-STATUS.
           SELECT SYSUT3-FILE  ASSIGN TO       SYSUT3
                  ORGANIZATION  IS 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-PKEY-00001-00006          PIC X(00006).
           05  SYSUT1-DATA-00007-00074          PIC X(00074).

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

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

      *****************************************************************
      * This program was created with the SYSHEXK3.TXT file as the    *
      * template for the File I/O. It is intended for use with the    *
      * Hex Dump facility.                                            *
      *                                                               *
      * The SYSHEXK3 template provides for the random reading of an   *
      * input file (SYSUT1, a VSAM, KSDS) and the sequential writing  *
      * to an output file (SYSUT2, a sequential file) that contains   *
      * Hexadecimal dump information.                                 *
      *                                                               *
      * The records to be read from SYSUT1 are defined in a control   *
      * file (SYSUT3) that contains a list of primary record keys.    *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 18.06.01          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* HX80KSC3 '.
           05  T2 pic X(34) value 'Batch, HEX-Dump for KSDS 080/1-06 '.
           05  T3 pic X(10) value ' v18.06.01'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* HX80KSC3 '.
           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 '* HX80KSC3 '.
           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 '* HX80KSC3 '.
           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  SYSUT2-LRECL            pic 9(5)    value 00080.
       01  SYSUT3-LRECL            pic 9(5)    value 00080.
       01  KEY-LEN                 pic 9(5)    value 00006.

      *****************************************************************
      * 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-TO-SYSOUT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* HX80KSC3 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.
       01  MB-CTR                  pic 9(3)    value 0.
       01  MB-LOB                  pic 9(3)    value 267.
       01  MB-LSB                  pic 9(3)    value 267.

      *****************************************************************
       01  PROGRAM-NAME            pic X(8)     value 'HX80KSC3'.

       01  GROUP-DELIMITER         pic X        value 'Y'.

       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   'Batch, HEX-Dump for KSDS 080/1-06 '.
           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-RPI        pic X       value 'Y'.

       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(23)   value 'Line count for SYSUT1  '.
       01  SYSUT2-TOTAL.
           05  SYSUT2-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for SYSUT2  '.
       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.


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

           perform until SYSUT3-STATUS not = '00'
             perform SYSUT3-READ
               if  SYSUT3-STATUS = '00'
                   if  SYSUT3-DATA-01(1:11) = '/USERKEY   '
                       move SYSUT3-DATA-01(12:KEY-LEN)
                         to SYSUT1-PKEY-00001-00006
                       perform SYSUT1-READ
                       if  SYSUT1-STATUS = '00'
                           add 1 to SYSUT1-RDR
                           move SYSUT3-DATA-01(1:60)
                             to SYSUT2-REC(1:60)
                           perform SYSUT2-WRITE
                           perform ACTION-DUMP-REQUEST
                       else
                           move all '.' to SYSUT2-REC
                           perform SYSUT2-WRITE
                           move SYSUT3-DATA-01(1:60)
                             to SYSUT2-REC(1:60)
                           inspect SYSUT2-REC
                             replacing first '                  '
                                          by ', Record not found'
                           perform SYSUT2-WRITE
                       end-if
                   else
                       move all '.' to SYSUT2-REC
                       perform SYSUT2-WRITE
                       if  SYSUT3-DATA-01(1:1) not = '*'
                           move SYSUT3-DATA-01(1:60)
                             to SYSUT2-REC(1:60)
                           inspect SYSUT2-REC
                             replacing first '                  '
                                          by ', Invalid /request'
                           perform SYSUT2-WRITE
                       end-if
                   end-if
               end-if
           end-perform

           perform JOB-FINISHED

           GOBACK.

      *****************************************************************
       ACTION-DUMP-REQUEST.
           compute LOOP-REDO = (SYSUT2-LRECL / 10)
           move all '.' to SYSUT2-REC
           if  DUMP-RPI = 'Y'
               add 1 to ZERO giving PT-1
               add 10 to ZERO giving RPI-VALUE
               perform LOOP-REDO times
                 move RPI-10 to SYSUT2-REC(PT-1:10)
                 if  SYSUT2-REC(PT-1 + 5:3) = '000'
                     move '...' to SYSUT2-REC(PT-1 + 5:3)
                 else
                     if  SYSUT2-REC(PT-1 + 5:2) = '00'
                         move '..' to SYSUT2-REC(PT-1 + 5:2)
                     else
                        if  SYSUT2-REC(PT-1 + 5:1) = '0'
                            move '.' to SYSUT2-REC(PT-1 + 5:1)
                        end-if
                     end-if
                 end-if
                 add 10 to RPI-VALUE
                 add 10 to PT-1
               end-perform
               perform SYSUT2-WRITE
           end-if

           add 1 to ZERO giving SEQ-IX
           add SEQ-VALUE(SEQ-IX) to ZERO giving PT-2
           perform 4 times
             add 1 to ZERO giving PT-1
             add SEQ-VALUE(SEQ-IX) to ZERO giving PT-2
             if  PT-2 = 1 and DUMP-HEX = 'Y'
             or  PT-2 = 2 and DUMP-HEX = 'Y'
             or  PT-2 = 3 and DUMP-EBC = 'Y'
             or  PT-2 = 4 and DUMP-ASC = 'Y'
                 perform SYSUT2-LRECL times
                   move SYSUT1-REC(PT-1:1) to BN-2-GROUP(2:1)
                   move TAB-X1(BN-2-VALUE + 1) to WORK-05
                   move WORK-05(PT-2:1) to SYSUT2-REC(PT-1:1)
                   add 1 to PT-1
                 end-perform
                 perform SYSUT2-WRITE
             end-if
             add 1 to SEQ-IX
           end-perform
           if  SYSUT2-STATUS = '00'
               add 1 to SYSUT2-ADD
           end-if
           exit.

      *****************************************************************
       JOB-FINISHED.
           if  GROUP-DELIMITER = 'Y'
               move SPACES  to SYSUT2-REC
               perform SYSUT2-WRITE
               move all '*' to SYSUT2-REC
               perform SYSUT2-WRITE
           end-if

           move 'Conclude' to INFO-ID
           move INFO-SHORT to SYSUT2-REC
               perform SYSUT2-WRITE
           move 'Finished' to INFO-ID

           move SYSUT1-TOTAL to SYSUT2-REC
           perform SYSUT2-WRITE

           move SYSUT2-TOTAL to SYSUT2-rec
           perform SYSUT2-WRITE

           perform Z-THANK-YOU.

           perform SYSUT3-CLOSE
           perform SYSUT2-CLOSE
           perform SYSUT1-CLOSE

           exit.

      *****************************************************************
       JOB-STARTING.
           perform Z-POST-COPYRIGHT
           perform SYSUT1-OPEN
           perform SYSUT2-OPEN
           perform SYSUT3-OPEN

           move all '*' to SYSUT2-REC
           perform SYSUT2-WRITE
           move SIM-TITLE to SYSUT2-REC
           perform SYSUT2-WRITE
           move SIM-COPYRIGHT to SYSUT2-REC
           perform SYSUT2-WRITE
           move all '*' to SYSUT2-REC
           perform SYSUT2-WRITE
           move INFO-STATEMENT to SYSUT2-REC
           perform SYSUT2-WRITE
           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-TO-SYSOUT
               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-TO-SYSOUT
                   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-TO-SYSOUT
               move SYSUT1-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       SYSUT2-WRITE.
           if  SYSUT2-OPEN-FLAG = 'C'
               perform SYSUT2-OPEN
           end-if
           write SYSUT2-REC
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SYSUT2-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if.
           if  APPL-AOK
               CONTINUE
           else
               move 'WRITE Failure with SYSUT2  ' to MESSAGE-TEXT
               perform Z-DISPLAY-TO-SYSOUT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SYSUT2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with SYSUT2  ' to MESSAGE-TEXT
               perform Z-DISPLAY-TO-CONSOLE
               perform Z-DISPLAY-TO-SYSOUT
               move SYSUT2-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SYSUT2-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SYSUT2-FILE
           if  SYSUT2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SYSUT2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with SYSUT2  ' to MESSAGE-TEXT
               perform Z-DISPLAY-TO-SYSOUT
               move SYSUT2-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-TO-SYSOUT
                   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-TO-SYSOUT
               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-TO-SYSOUT
               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-TO-SYSOUT
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-TO-SYSOUT
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-TO-SYSOUT.
           perform Z-DISPLAY-MESSAGE-SIZE
           display MESSAGE-BUFFER(1:MB-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.
      *---------------------------------------------------------------*
       Z-DISPLAY-TO-CONSOLE.
           perform Z-DISPLAY-MESSAGE-SIZE
           display MESSAGE-BUFFER(1:MB-LSB) upon console
           exit.
      *---------------------------------------------------------------*
       Z-DISPLAY-MESSAGE-SIZE.
           if  MESSAGE-TEXT-2 = SPACES
               add 79 to ZERO giving MB-LSB
           else
               add MB-LOB to ZERO giving MB-LSB
           end-if
           perform until MB-LSB < 2
                      or MESSAGE-BUFFER(MB-LSB:1) not = SPACE
             if  MESSAGE-BUFFER(MB-LSB:1) = SPACE
                 subtract 1 from MB-LSB
             end-if
           end-perform
           subtract MB-LSB from MB-LOB giving MB-CTR
           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-SYSOUT
           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-SYSOUT
           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-TO-SYSOUT
           move SIM-THANKS-02 to MESSAGE-BUFFER
           perform Z-DISPLAY-TO-SYSOUT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2018-10-11  Generation Time: 21:41:46:64    *
      *****************************************************************

Table of Contents Previous Section Next Section Summary

This document describes a Windows CMD file that will create a QSAM file and a VSAM KSDS with 80-byte records. The last job step will do a Hex-Dump of selected records in the VSAM KSDS based on a list of user-defined keys. The purpose of this document is to assist as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This 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 how to create a Suite of Test Files with 80-byte Records. This document describes three job scripts that will create a sequential file and a VSAM KSDS. The last step in each of the jobs will show how to present records from the KSDS in a Hex-Dump format. The jobs are scripted using Mainframe JCL Members, Windows CMD Files and Linux/UNIX Script Files.

Link to Internet   Link to Server   Explore a JCL Member that creates a Suite of Test Files with 80-byte Records. This job will create a sequential file and a VSAM KSDS. The last step of the job will show how to present records from the KSDS in a Hex-Dump format.

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

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

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

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

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

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

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

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

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Contact or Feedback

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

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

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

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

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

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

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


Return-to-Top
QSAM & KSDS Files with 80-byte Records
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com