Concatenated Data Sets
JCL, Utility Programs and COBOL
  Table of Contents  v-16.01.01 - concat01.htm 
  Introduction
  Programming Objectives
  Programming Input and Output
  Programming Requirements
  Programming Overview
  JCL Members
  Run a Job, Data Set Concatenation
  Create the Test Files
  COBOL Test Program
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document will describe and demonstrate how to do data file concatenation using the function provided with JCL, Utility Programs and COBOL Programs. It is possible to process two (2) or more files as a single data set by concatenating the DD statements.


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

Table of Contents Previous Section Next Section Programming Objectives

The following is a list of the functions provided in this example.

1 Describe and Demonstrate how to create test files
2 Describe and Demonstrate how to concatenate data sets using JCL and a COBOL program
3 Describe and Demonstrate how to concatenate data sets using JCL and the SORT Utility program
4 Describe and Demonstrate how to add records to an existing sequential file
  Data Set Concatenation of Sequential Files using JCL, Utility Programs and COBOL

Table of Contents Previous Section Next Section Programming Input and Output

The following shows the contents of the three test files that are used to demonstrate the data set concatenation capabilities.The first file contains three records.

00011 File-001, Record-001
00021 File-001, Record-002
00031 File-001, Record-003

The second file contains the following three records.

00012 File-002, Record-001
00022 File-002, Record-002
00032 File-002, Record-003

The third file contains the following three records.

00013 File-003, Record-001
00023 File-003, Record-002
00033 File-003, Record-003

The following files show the results that are produced using a COBOL program and the SORT Utility program. The first file is the results produced by the job step (DUPE80S2) that executes the COBOL program

00011 File-001, Record-001
00021 File-001, Record-002
00031 File-001, Record-003
00012 File-002, Record-001
00022 File-002, Record-002
00032 File-002, Record-003
00013 File-003, Record-001
00023 File-003, Record-002
00033 File-003, Record-003

The second file is the results produced by the job steps (SORT80S3 and EXTENDS4)) that executes the Sort program to read and sort the concatenated files into a single, sorted sequentail file based on the content of the first five positions in the records. The final step uses IEBGENER to add a record to the file.

00011 File-001, Record-001
00012 File-002, Record-001
00013 File-003, Record-001
00021 File-001, Record-002
00022 File-002, Record-002
00023 File-003, Record-002
00031 File-001, Record-003
00032 File-002, Record-003
00033 File-003, Record-003
99999 File-009, Record-999

Table of Contents Previous Section Next Section Programming Requirements

This suite of samples programs will run on the following platforms.

1 Executes on Windows/XP, Windows/7 and Windows Server using Micro Focus Server or Studio.
2 May be ported to run on the Linux or UNIX platforms supported by Micro Focus COBOL.
3 Executes on an IBM Mainframe System with MVS or a Windows System using Micro Focus Mainframe Express.
  Operating Systems and Supporting Software

Table of Contents Previous Section Next Section Programming Overview

The following shows the processing logic by job step for the JCL Member that demonstrates the usage of data set concatenation.

             
CONCATJ1
jcl
Start the process to demonstrate Data Set Concatenation
   
IEFBR14
THROWOUT
   
   
CONCATD4
rseq
Delete previously created files.
   
   
   
   
   
CONCATD5
rseq
   
CONCATD1
rseq
   
   
DUPE8080
DUPE80S2
 
 
CONCATD4
rseq
Read three concatenated data set, write one sequential file
   
   
CONCATD2
rseq
   
   
   
Read three concatenated data set, write one sequential file
   
   
CONCATD3
rseq
   
   
   
Read three concatenated data set, write one sequential file
   
SYSIN
INSTREAM
   
   
SORT
SORT80S3
 
 
SORTOUT
CONCATD5
Read three concatenated data set, write sorted sequential file
   
   
SORTIN
CONCATD1
   
   
   
Read three concatenated data set, write one sequential file
   
   
SORTIN
CONCATD2
   
   
   
Read three concatenated data set, write one sequential file
   
   
SORTIN
CONCATD3
   
   
   
Read three concatenated data set, write one sequential file
   
SYSUT1
INSTREAM
 
 
IEBGENER
EXTENDS4
 
 
SYSUT2
CONCATD5
Add one record to the Sequential file
   
EOJ
End-of-Job
 
Demonstrate the process for Data Set Concatenation (JCL, COBOL and SORT)

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using the Mainframe and Micro Focus Enterprise Server/Studio (or Micro Focus Mainframe Express). 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 or Relational Tables. The  light-gray  boxes identify a system function or information item.

Table of Contents Previous Section Next Section JCL Members

This sample suite of programs has two JCL members. The first JCL member will execute the demonstration program. The second JCL member will create the test files used by the job that does data set concatenation.

Table of Contents Previous Section Next Section Run a Job, Data Set Concatenation

The following is the JCL member (CONCATJ1.jcl) required to run the job that does data set concatenation. This job will run on an IBM Mainframe System with ZOS or a Linux, UNIX or Windows System with Micro Focus Enterprise Server or Studio.

//CONCATJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CONCATJ1.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2017 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Copy three concatenated data sets into one data set.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* Step 1, THROWOUT will delete any previously created file.
//* Step 2, DUPE80S2 will create a new file.
//* Step 3, SORT80S3 will sort the file.
//* Step 4, EXTENDS4 will add a record to the input file.
//*
//* This job uses instream sorting specifications.
//*
//* This set of programs will run on a mainframe under ZOS or on a
//* Windows System and Micro Focus Enterprise Server or Studio.
//*
//* 1. Demonstrate how to use IEFBR14 with DD statements to delete
//*    files that have been created by a previous execution of this
//*    job.
//* 2. Demonstrate how to use JCL with concatenated data sets and
//*    a COBOL Program to copy three record sequential file with
//*    eighty (80) byte fixed length records into a single file.
//* 3. Demonstrate how to use JCL with concatenated data sets and
//*    the SORT program to sort three record sequential file with
//*    eighty (80) byte fixed length records into a single file
//*    based on the value in position one (1) of each record.
//* 4. Demonstrate how to add records to a sequential file.
//*
//* *******************************************************************
//* Step 1 of 4, Delete any previously created file...
//*
//JOBSETUP EXEC PGM=IEFBR14
//CONCATD4 DD  DSN=SIMOTIME.DATA.CONCATD4,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//CONCATD5 DD  DSN=SIMOTIME.DATA.CONCATD5,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 4, DUPE input, create a new output file...
//*
//DUPE80S1 EXEC PGM=DUPE8080
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//DUPEGET1 DD  DSN=SIMOTIME.DATA.CONCATD1,DISP=SHR
//         DD  DSN=SIMOTIME.DATA.CONCATD2,DISP=SHR
//         DD  DSN=SIMOTIME.DATA.CONCATD3,DISP=SHR
//DUPEPUT1 DD  DSN=SIMOTIME.DATA.CONCATD4,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//*
//* *******************************************************************
//* Step 3 of 4, Sort the file...
//*
//SORT80S3 EXEC PGM=SORT,
//             REGION=1024K
//SYSIN    DD  *
* ..:....1....:....2....:....3....:....4....:....5....:....6....:....7.
         SORT  FIELDS=(1,5,CH,A)
/*
//SORTIN   DD  DSN=SIMOTIME.DATA.CONCATD1,DISP=SHR
//         DD  DSN=SIMOTIME.DATA.CONCATD2,DISP=SHR
//         DD  DSN=SIMOTIME.DATA.CONCATD3,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.CONCATD5,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//*
//* *******************************************************************
//* Step 4 of 4, Extend or add records to an existing QSAM file...
//*
//EXTENDS4 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6....:....7.
//SYSUT1   DD  *
99999 File-009, Record-999
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.CONCATD5,
//             DISP=(MOD,KEEP,KEEP),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)

Table of Contents Previous Section Next Section Create the Test Files

The following is the JCL member (CONCATJ8.jcl) that is used to create the test files. This job will run on an IBM Mainframe System with ZOS or a Linux, UNIX or Windows System with Micro Focus Enterprise Server or Studio.

//CONCATJ8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CONCATJ8.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2017 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Create three Sequential Data Files on disk using IEBGENER.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* Job step 1 will delete any previously created files.
//* Job steps 2-4 will create a new files.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//* *******************************************************************
//* Step 1 of 4, Delete any previously created file...
//*
//JOBSETUP EXEC PGM=IEFBR14
//CONCATD1 DD  DSN=SIMOTIME.DATA.CONCATD1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//CONCATD2 DD  DSN=SIMOTIME.DATA.CONCATD2,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//CONCATD3 DD  DSN=SIMOTIME.DATA.CONCATD3,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 4, Create and populate a new QSAM file...
//*
//CONCATS2 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6....:....7.
//SYSUT1   DD  *
00011 File-001, Record-001
00021 File-001, Record-002
00031 File-001, Record-003
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.CONCATD1,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//*
//* *******************************************************************
//* Step 3 of 4, Create and populate a new QSAM file...
//*
//CONCATS2 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6....:....7.
//SYSUT1   DD  *
00012 File-002, Record-001
00022 File-002, Record-002
00032 File-002, Record-003
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.CONCATD2,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//*
//* *******************************************************************
//* Step 4 of 4, Create and populate a new QSAM file...
//*
//CONCATS2 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6....:....7.
//SYSUT1   DD  *
00013 File-003, Record-001
00023 File-003, Record-002
00033 File-003, Record-003
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.CONCATD3,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)

Table of Contents Previous Section Next Section COBOL Test Program

The following is the COBOL program (DUPE8080.cbl) that is used to read the three concatenated data sets and write a new, single data set containing all the records. This job will run on an IBM Mainframe System with ZOS or a Linux, UNIX or Windows System with Micro Focus Enterprise Server or Studio.

Note:  The DD statements in the JCL will present the three concatenated data sets to the COBOL program as if they were one sequential file. The COBOL program will see the first record in the first file as the starting point. The COBOL program will not get an End-of-File result until after the last record in the third data set has been read.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    DUPE8080.
       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: 2012-01-16  Generation Time: 13:01:19:28    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     DUPEGET1 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  OUTPUT    DUPEPUT1 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *                                                               *
      *            Translation Mode is ASCII to ASCII                 *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT DUPEGET1-FILE  ASSIGN TO       DUPEGET1
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS DUPEGET1-STATUS.
           SELECT DUPEPUT1-FILE  ASSIGN TO       DUPEPUT1
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS DUPEPUT1-STATUS.

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

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

      *****************************************************************
      * This program was created with the SYSMASK1.TXT file as input. *
      * The SYSMASK1 provides for the sequential reading of the input *
      * file and the sequential writing of the output file.           *
      *                                                               *
      * If the output file is indexed then the input file must be in  *
      * sequence by the field that will be used to provide the key    *
      * for the output file. This is a sequential load process.       *
      *                                                               *
      * If the key field is not in sequence then refer to SYSMASK2    *
      * to provide for a random add or update of the indexed file.    *
      *                                                               *
      * This program mask will have the ASCII/EBCDIC table inserted   *
      * for use by the /TRANSLATE function of SimoZAPS.               *
      *                                                               *
      * For additional information contact SimoTime Technologies.     *
      *                                                               *
      *        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 '* DUPE8080 '.
           05  T2 pic X(34) value 'Duplicate RSEQ-80 to RSEQ-80      '.
           05  T3 pic X(10) value ' v11.05.02'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* DUPE8080 '.
           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  DUPEGET1-STATUS.
           05  DUPEGET1-STATUS-L     pic X.
           05  DUPEGET1-STATUS-R     pic X.
       01  DUPEGET1-EOF              pic X       value 'N'.
       01  DUPEGET1-OPEN-FLAG        pic X       value 'C'.

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

       01  DUPEGET1-LRECL            pic 9(5)    value 00080.
       01  DUPEPUT1-LRECL            pic 9(5)    value 00080.
       01  DUPEGET1-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(11)   value '* DUPE8080 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

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

       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   'Duplicate RSEQ-80 to RSEQ-80      '.
           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  DUPEGET1-TOTAL.
           05  DUPEGET1-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for DUPEGET1'.
       01  DUPEPUT1-TOTAL.
           05  DUPEPUT1-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for DUPEPUT1'.


      *****************************************************************
       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 DUPEGET1-OPEN
           perform DUPEPUT1-OPEN

           perform until DUPEGET1-STATUS not = '00'
               perform DUPEGET1-READ
               if  DUPEGET1-STATUS = '00'
                   add 1 to DUPEGET1-RDR
                   perform BUILD-OUTPUT-RECORD
                   perform DUPEPUT1-WRITE
                   if  DUPEPUT1-STATUS = '00'
                       add 1 to DUPEPUT1-ADD
                   end-if
               end-if
           end-perform

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

           move DUPEPUT1-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 DUPEPUT1-CLOSE
           perform DUPEGET1-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *    TransMODE is A2A...
      *    TransCOPY...
           move DUPEGET1-REC(00001:00080) to DUPEPUT1-REC(00001:00080)
           exit.

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

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

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79)
           else
               display MESSAGE-BUFFER
           end-if
           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: 2012-01-16  Generation Time: 13:01:19:32    *
      *****************************************************************

Table of Contents Previous Section Next Section Summary

This document will describe and demonstrate how to do data file concatenation using the functions provided with JCL, Utility Programs and COBOL Programs. 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 document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives.

The documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please send an e-mail to: helpdesk@simotime.com or call 415 883-6565. We appreciate hearing from you.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

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

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

Table of Contents Previous Section Next Section Downloads and Links

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

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

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

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

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore how to merge or append multiple files into a single file. This suite of programs will describe and demonstrate the process using multiple input files of various record lengths.

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 a brief Overview of JCL Syntax that includes a description of data set concatenation using DD statements. Job Control Language (or JCL) specifies how programs are executed on the mainframe. JCL functions are the interface between the programs and the operating system.

Link to Internet   Link to Server   Explore the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.

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

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

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

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

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

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

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Comments or Feedback

This document was created and is copyrighted and maintained by SimoTime Technologies.

If you have any questions, suggestions, comments or feedback please call or send an e-mail to: helpdesk@simotime.com

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

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

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

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

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions or need assistance with converting non-relational data structures simply give us a call at 415 883-6565 or check the web site at http://www.simotime.com


Return-to-Top
Concatenated Data Sets using JCL, Utility Programs and COBOL
Copyright © 1987-2017
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com