Generation Data Groups
GDG's, an Introduction with Examples
  Table of Contents  v-14.03.28 - gdgone01.htm 
  Introduction
  Program Objectives
  Program Input and Output
  Program Requirements
  Program Processing Overview
  JCL for Execution in a Mainframe Environment
  JCL, Create or Define a Generation Data Group (GDG) Base
  JCL, Create or Define a Generation Data Group (GDG) Model
  JCL, Create a File (GDS) within a Generation Data Group (GDG)
  JCL, Process a Single File (GDS) within a Generation Data Group (GDG)
  JCL, Process a Generation Data Group (GDG) as a Single File
  JCL, Delete a File (GDS) within a Generation Data Group (GDG)
  JCL, Delete a Generation Data Group (GDG)
  The COBOL Demonstration 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

A Generation Data Group (or GDG) is a group of related files that can be referenced individually or as a group. The files (or generations) within a GDG are assigned names derived from the name of the GDG base. The individual files within a group have a generation number added to the end of the name to make each file name unique. For example, if the GDG base is called "SIMOTIME.DATA.GDGROUP1" then the first file created within the GDG will be given the name "SIMOTIME.DATA.GDGROUP1.G0001V00". Subsequent files are then named by incrementing the generation number resulting in filenames ending in G0002V00 through G9999V00. Once the G9999V00 is reached the numbering will start again from G0001V00. The two zeroes on the end of the name are used to represent a volume number that is used when the file is stored on media requiring the use of multiple volumes.

Within a GDG, the generations may have like or unlike Data Control Block (DCB) attributes and data set organizations. If the attributes and organizations of all generations in a group are identical, the generations (or individual data sets) may be retrieved together as a single data set.

This suite of sample jobs and programs describes how to define a Generation Data Group (GDG). Once the GDG is defined the creation and accessing of a Generation Data Set (referred to as a generation or GDS) within the group is discussed.


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-2015
SimoTime Technologies
All Rights Reserved

Table of Contents Previous Section Next Section Program Objectives

This example illustrates the following functions

1 Demonstrate how to define a Generation Data Group (GDG).
2 Demonstrate how to create files (or generations) within a Generation Data Group (GDG)
3 Demonstrate how to access generations (individual files) within a group.
4 Demonstrate how to access all the generations within a Generation Data Group (GDG) as a single file.
5 Demonstrate how to delete a generation data group (GDG)
  Program Objectives

Table of Contents Previous Section Next Section Program Input and Output

The input used by this suite of programs is generated within the programs. When creating data sets that are associated with a GDG the IEBGENER utility program is used in conjunction with inline data using SYSIN.

The output created by this suite of programs is as follows.

1 A Base for a Generation Data Group (GDG).
2 A Model for a Generation Data Group (GDG).
3 Individuals Generation Data Sets (or data files) that are associated with a Generation Data Group (GDG).
4 Record Sequential files that are created as a result of processing the Generation Data Group (GDG) or individual data sets associated with the GDG.
5 When using Micro Focus Enterprise Server on Windows/7 the contents of the Generation Data Group (GDG) or individual data sets associated with the GDG may be viewed via the catalog and the data file editor.
  Program Input and Output

Table of Contents Previous Section Next Section Program Requirements

This suite of sample programs require the following system software.

1 Windows/7 - The sample jobs execute on Microsoft Windows/7 or Microsoft Server 2008 using Micro Focus Enterprise Server that is configured to process mainframe JCL.
2 Micro Focus Enterprise Server - The sample jobs may be ported to run on the UNIX platforms supported by Micro Focus COBOL and Enterprise Server.
  Program Requirements

Table of Contents Previous Section Next Section Program Processing Overview

The following is a summary of the jobs (or JCL members) included in this suite of programs and a typical process of execution and review.

Step Description
1 GDGIDXJ1.JCL - this job will create a GDG Base (or index).
2 GDGMODJ1.JCL - this job will create a GDG Model with DCB information. The DCB (Data Control Block) defines the file attributes.
3 GDSPUTJ1.JCL - this job will create (or generate) a Generation Data Set (GDS or file) that is associated with the Generation Data Group (GDG). The GDS will be created using the GDG Model to determine the file attributes. The job uses IEBGENER to add two records to a file.
4 GDSPUTJ2.JCL - this job will create (or generate) a Generation Data Set (GDS or file) that is associated with the Generation Data Group (GDG). The GDS will be created using the GDG Model to determine the file attributes. The job uses IEBGENER to add two records to a file. The JCL for processing the new generation data set (GDS) is identical to GDSPUTJ1.
5 GDSPUTJ3.JCL - this job will create (or generate) a Generation Data Set (GDS or file) that is associated with the Generation Data Group (GDG). The GDS will be created using the GDG Model to determine the file attributes. The job uses IEBGENER to add two records to a file. The JCL for processing the new generation data set (GDS) is identical to GDSPUTJ1.
6 GDGALLJ1.JCL - this job will process a Generation Data Group (GDG) using a COBOL program. Since the DSN name is the GDG name without an appended GnnnnVnn segment each of the individual data stes (or files) will be processed as a contiguous file starting with the last created data set.
7 GDSPUTJ4.JCL - this job will create (or generate) a Generation Data Set (GDS or file) that is associated with the Generation Data Group (GDG). The GDS will be created using the GDG Model to determine the file attributes. The job uses IEBGENER to add two records to a file. The JCL for processing the new generation data set (GDS) is identical to GDSPUTJ1.
8 GDGALLJ1.JCL - this job will process a Generation Data Group (GDG) using a COBOL program. Since the DSN name is the GDG name without an appended GnnnnVnn segment each of the individual data sets (or files) will be processed as a contiguous file starting with the last created data set.
  Program Processing Overview

A typical sequence of events is to submit the jobs described in Steps 1-3 to Enterprise Server and then review the results.

The GDG naming standard appends a segment to the end of the file name that is formatted as GnnnnVnn. The Gnnnn is a generation number from 0000 to 9999 and the Vnn is a volume number from 00 to 99, this is typically 00. Notice the appended segment of G0001V00 on the data set name.

The following shows the catalog list from Enterprise Server.

DS Org  DS Name
GDG     SIMOTIME.DATA.GDGROUP1
PS      SIMOTIME.DATA.GDGROUP1.G0001V00
PS      SIMOTIME.DATA.GDMODEL1

Next, run the jobs described in Steps 4-6 to create additional data sets. The following shows the catalog list from Enterprise Server. Notice the additional data sets associated with the GDG and the appended segments of G0002V00 and G0003V00 on the data set names.

DS Org  DS Name
GDG     SIMOTIME.DATA.GDGROUP1
PS      SIMOTIME.DATA.GDGROUP1.G0001V00
PS      SIMOTIME.DATA.GDGROUP1.G0002V00
PS      SIMOTIME.DATA.GDGROUP1.G0003V00
PS      SIMOTIME.DATA.GDMODEL1
PS      SIMOTIME.DATA.GDG2RSEQ

The preceding job that is described in Step 6 created an output file. Since the job (GDGALLJ1.JCL) referenced the GDG as a group the output file should have all six records (each of the individual data sets associated with the GDG has two (2) records).

The following shows the content of the output file (SIMOTIME.DATA.GDG2RSEQ) as viewed using the Enterprise Server catalog display functions.

RECORD-3000001
RECORD-3000002
RECORD-2000001
RECORD-2000002
RECORD-1000001
RECORD-1000002

The GDG now contains the maximum number of associated or generation Data Sets (GDS). Submit the jobs described in steps 7-8 and review the results. Notice the data sets associated with the GDG and the appended segments of G0002V00 through G0004V00 on the data set names. The G0001V00 has been deleted.

The following shows the catalog list from Enterprise Server.

DS Org  DS Name
GDG     SIMOTIME.DATA.GDGROUP1
PS      SIMOTIME.DATA.GDGROUP1.G0002V00
PS      SIMOTIME.DATA.GDGROUP1.G0003V00
PS      SIMOTIME.DATA.GDGROUP1.G0004V00
PS      SIMOTIME.DATA.GDMODEL1
PS      SIMOTIME.DATA.GDG2RSEQ

The preceding job that is described in Step 8 created an output file. Since the job (GDGALLJ1.JCL) referenced the GDG as a group the output file should have all six records (each of the individual data sets associated with the GDG has two (2) records). The following shows the content of the output file (SIMOTIME.DATA.GDG2RSEQ) as viewed using the Enterprise Server catalog display functions.

RECORD-4000001
RECORD-4000002
RECORD-3000001
RECORD-3000002
RECORD-2000001
RECORD-2000002

Table of Contents Previous Section Next Section JCL for Execution in a Mainframe Environment

The following describes the JCL members included in this suite of programs.

Table of Contents Previous Section Next Section JCL, Create or Define a Generation Data Group (GDG) Base

The following (GDGIDXJ1.jcl) is a listing of the JCL member needed to run the job that will create a GDG Base.

//GDGIDXJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2015 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Create the Base for a Generation Data Group (GDG).
//* Author  - SimoTime Technologies
//* Date    - November 24, 2005
//* Version - 07.01.22
//*
//* This job uses IDCAMS to create the base for a GDG.
//*
//* *******************************************************************
//* Step 1 of 1, Sample job to create GDG Index.
//*
//GDGIDXX1 EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
    DEFINE GDG(NAME(SIMOTIME.DATA.GDGROUP1)   -
           LIMIT(3)                           -
           NOEMPTY                            -
           SCRATCH)
/*
//

The preceding job uses the IDCAMS utility program to define a GDG base called MFI01.SIMOPROD.GDGROUP1 that will consist of 3 generations. The maximum number of generations that you can associate with a base is 255. The NOEMPTY parameter specifies that when the three (3) generation limit is reached the oldest generation data set will be deleted. The remaining generation data sets will be retained. An EMPTY parameter specifies that when the limit is reached the three (3) current files will be deleted and the process will start again with the new file. The SCRATCH parameter specifies that the oldest generation data set will be uncataloged and deleted when the generation limit is exceeded.

Table of Contents Previous Section Next Section JCL, Create or Define a Generation Data Group (GDG) Model

Before you create the files that attach to a GDG base you may want to create a model dataset that contains the DCB information for the files. The model data only needs to be a VTOC entry and does not require disk space to be used.

The following (GDGMODJ1.jcl) is a listing of the JCL member needed to run the job that will create a GDG Model.

//GDGMODJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2015 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Create the Model for a Generation Data Group (GDG).
//* Author  - SimoTime Technologies
//* Date    - November 24, 2005
//* Version - 07.01.22
//*
//* This job uses IEFBR14 and a DD statement to create the model for
//* a GDG.
//*
//* *******************************************************************
//* Step 1 of 1, Sample job to create GDG Model.
//*
//GDGMODX1 EXEC PGM=IEFBR14
//GDGMODEL DD  DSN=SIMOTIME.DATA.GDMODEL1,
//             DISP=(NEW,KEEP,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,0),
//             DCB=(LRECL=80,RECFM=FB,DSORG=PS)
//

The preceding job uses the IEFBR14 program (a system supplied program that simply does a return to caller with a return code of zero) in cinjunction with a DD statement to create the model.

Table of Contents Previous Section Next Section JCL, Create a File (GDS) within a Generation Data Group (GDG)

The following (GDSPUTJ1.jcl) is a listing of the JCL member needed to run the job that will create a file (or Generation Data Set) within a GDG.

//GDSPUTJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2015 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Create a Generation Data Set (GDS) within a group (GDG).
//* Author  - SimoTime Technologies
//* Date    - November 24, 2005
//* Version - 07.01.22
//*
//* This job uses IEBGENER to create the GDS within a GDG.
//* Note: the DCB definition on the DD statement uses the GDG Model.
//*
//* *******************************************************************
//* Create a Data Set within a Group.
//*
//GDGPUTX1 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6....:....7.
//SYSUT1   DD  *
RECORD-1000001
RECORD-1000002
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.GDGROUP1(+1),
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=SIMOTIME.DATA.GDMODEL1
//

Table of Contents Previous Section Next Section JCL, Process a Single File (GDS) within a Generation Data Group (GDG)

The following (GDSG00J1.jcl) is a listing of the JCL member needed to run the job that will process an individual data set associated with the GDG base.

//GDSG00J1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2015 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Process a File within a Generation Data Group (GDG).
//* Author  - SimoTime Technologies
//* Date    - November 24, 2005
//* Version - 07.01.22
//*
//* This job will process the latest generation in the GDG because
//* the DSN name has the (0) appended to the GDG name.
//*
//* *******************************************************************
//* Step 1 of 2, Delete previously created sequential file.
//*
//STEP010  EXEC PGM=IEFBR14
//PUTRS80  DD  DSN=SIMOTIME.DATA.SEQ4G000,
//             DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 2, Process a single Generation Data Set.
//*
//STEP010  EXEC PGM=GDGR80C1
//SYSPRINT DD  SYSOUT=*
//GETRS80  DD  DSN=SIMOTIME.DATA.GDGROUP1(0),DISP=SHR
//PUTRS80  DD  DSN=SIMOTIME.DATA.SEQ4G000,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section JCL, Process a Generation Data Group (GDG) as a Single File

The following (GDGALLJ1.jcl) is a listing of the JCL member needed to run the job that will process all the files associated with a group as a single, contiguous file.

//GDGALLJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2015 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Process a Generation Data Group (GDG).
//* Author  - SimoTime Technologies
//* Date    - November 24, 2005
//* Version - 07.01.22
//*
//* This job will process all the files in the GDG as a single
//* contiguous file because the GDG name is used as the DSN name with
//* the DD statement.
//*
//* Note: all the files in the group must have the same attributes.
//*
//* *******************************************************************
//* Step 1 of 2, Delete previously created sequential file.
//*
//STEP010  EXEC PGM=IEFBR14
//PUTRS80  DD  DSN=SIMOTIME.DATA.GDG2RSEQ,
//             DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 2, Process the GDG Group as a contiguous file.
//*
//STEP020  EXEC PGM=GDGR80C1
//GETRS80  DD  DSN=SIMOTIME.DATA.GDGROUP1,DISP=SHR
//PUTRS80  DD  DSN=SIMOTIME.DATA.GDG2RSEQ,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section JCL, Delete a File (GDS) within a Generation Data Group (GDG)

The following (GDSD00J1.jcl) is a listing of the JCL member needed to run the job that will delete an individual file associated with a GDG base.

//GDSD00J1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2015 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Delete an individual file asociated with a GDG.
//* Author  - SimoTime Technologies
//* Date    - November 24, 2005
//* Version - 07.01.22
//*
//* This job uses IEFBR14 and a DD statement to delete an individual
//* data set within a GDG.
//*
//* Since the DSN name has the (0) appended the last created file
//* associated with the GDG will be deleted.
//*
//* *******************************************************************
//* Step 1 of 1, Delete an individual generation data set.
//*
//STEP010  EXEC PGM=IEFBR14
//SYSOUT   DD  SYSOUT=*
//SYSDEL   DD  DSN=SIMOTIME.DATA.GDGROUP1(0),
//             DISP=(MOD,DELETE,DELETE)
//

Table of Contents Previous Section Next Section JCL, Delete a Generation Data Group (GDG)

The following (GDGDELJ1.jcl) is a sample of the JCL member needed to run this job that will delete a GDG Base and all the files included with the group.

//GDGDELJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2015 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Delete the Generation Data Group (GDG).
//* Author  - SimoTime Technologies
//* Date    - November 24, 2005
//* Version - 07.01.22
//*
//* This job uses IDCAMS to delete the base for a GDG. This will also
//* delete all the Data Sets within the group.
//* The second step will delete the GDG Model.
//*
//* *******************************************************************
//* Step 1 of 2, Sample job to delete the GDG Index and included files.
//*
//STEP010  EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
  DELETE   (SIMOTIME.DATA.GDGROUP1) GDG FORCE
/*
//*
//* *******************************************************************
//* Step 2 of 2, Sample job to delete the GDG model.
//*
//GDGMODX1 EXEC PGM=IEFBR14
//GDGMODEL DD  DSN=SIMOTIME.DATA.GDMODEL1,
//             DISP=(MOD,DELETE,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,0),
//             DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)
//

Caution! The preceding job should be used with caution. The job uses the IDCAMS utility program and will delete the GDG base and all the files associated with the GDG.

Table of Contents Previous Section Next Section The COBOL Demonstration Program

The following (GDGR80C1.cbl) is a listing of the Micro Focus COBOL demonstration program. The program was tested using Micro Focus Net Express, version 5.0 and Enterprise Server running on Windows/XP.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    GDGR80C1.
       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: 2011-06-22  Generation Time: 12:55:18:41    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     GETRS80  SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  OUTPUT    PUTRS80  SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *                                                               *
      *            Translation Mode is ASCII to ASCII                 *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT GETRS80-FILE  ASSIGN TO       GETRS80
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS GETRS80-STATUS.
           SELECT PUTRS80-FILE  ASSIGN TO       PUTRS80
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS PUTRS80-STATUS.

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

       FD  PUTRS80-FILE
           DATA RECORD    IS PUTRS80-REC
           .
       01  PUTRS80-REC.
           05  PUTRS80-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 '* GDGR80C1 '.
           05  T2 pic X(34) value 'REPRO or COPY for RSEQ80 Files    '.
           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 '* GDGR80C1 '.
           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  GETRS80-STATUS.
           05  GETRS80-STATUS-L     pic X.
           05  GETRS80-STATUS-R     pic X.
       01  GETRS80-EOF              pic X       value 'N'.
       01  GETRS80-OPEN-FLAG        pic X       value 'C'.

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

       01  GETRS80-LRECL            pic 9(5)    value 00080.
       01  PUTRS80-LRECL            pic 9(5)    value 00080.
       01  GETRS80-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 '* GDGR80C1 '.
           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 'GDGR80C1'.

       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   'REPRO or COPY for RSEQ80 Files    '.
           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  GETRS80-TOTAL.
           05  GETRS80-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for GETRS80 '.
       01  PUTRS80-TOTAL.
           05  PUTRS80-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for PUTRS80 '.


      *****************************************************************
       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 GETRS80-OPEN
           perform PUTRS80-OPEN

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

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

           move PUTRS80-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 PUTRS80-CLOSE
           perform GETRS80-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *>   TransMODE is A2A...
      *>   TransCOPY...
           move GETRS80-REC(00001:00080) to PUTRS80-REC(00001:00080)
           exit.

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

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

Table of Contents Previous Section Next Section Summary

The purpose of this suite of programs is to provide examples for creating and processing Generation Data Groups (GDG's). The document may be used 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 documents and the links to other documents are intended to provide a choice of alternatives.

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

SimoTime Enterprises 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 Enterprises 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 Catalog Entries for Generation Data Groups (GDG's) and Document the Process.

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 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 via Internet Connect for access to white papers, program examples and product information.

Explore The Micro Focus Web Site via Internet Connect for more information about products and services available from Micro Focus.

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

Founded in 1987, SimoTime Technologies 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. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. 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.

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
Generation Data Groups (GDG's), an Introduction with Examples
Copyright © 1987-2015
SimoTime Technologies
All Rights Reserved
When technology complements business
http://www.simotime.com