Generation Data Groups
When technology complements business   Introduction to GDG's
Copyright © 1987-2008  SimoTime Enterprises, LLC  All Rights Reserved http://www.simotime.com

 
Introduction Version 07.09.18
 
  Programming Objectives
  Programming Input and Output
  Programming Requirements
  Programming Overview
  JCL for Execution with Mainframe Express or Mainframe
 
  JCL, Create or Define a GDG Index
  JCL, Create or Define a GDG Model
  JCL, Create a File (GDS) in a Group
  JCL, Process a File (GDS) in a Group
  JCL, Process a Generation Data Group (GDG) as a Single File
  JCL, Delete a File (GDS) in a Group
  JCL, Delete a GDG
  The COBOL Demonstration Programs
  Summary
 
  Software Agreement and Disclaimer
  Downloads and Links to Similar Pages
  Glossary of Terms
  Comments or Suggestions
  About SimoTime

Introduction
(Next) (Previous) (Table-of-Contents)

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 uique. For example, if the GDG base is called "MFI01.SIMOPROD.GDGROUP1" then the first file created within the GDG will be given the name "MFI01.SIMOPROD.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 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.

Programming Objectives
(Next) (Previous) (Table-of-Contents)

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)

Programming Input and Output
(Next) (Previous) (Table-of-Contents)

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 files that are associated with a Generation Data Group (GDG).
4. Individuals 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/XP 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.

Programming Requirements
(Next) (Previous) (Table-of-Contents)

This suite of sample programs require the following system software.

1. Windows/XP - The sample jobs execute on Microsoft Windows/XP or Microsoft Server 2003 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.

Programming Overview
(Next) (Previous) (Table-of-Contents)

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.

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.

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

The following shows the catalog list from Enterprise Server. The GDG naming standard appends a segment to the end of the file name that is formatted as GnnnnVnn. The nnnn is a generation number from 0000 to 9999 and the nn is a volume number from 00 to 99, this is typically 00. Notice the appended segment of G0001V00 on the data set name.

 DS Org   DS Name 
    GDG    MFI01.SIMOPROD.GDGROUP1
     PS    MFI01.SIMOPROD.GDGROUP1.G0001V00 
     PS    MFI01.SIMOPROD.GDMODEL1

Next, run the folling jobs that will create additional data sets.

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.

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    MFI01.SIMOPROD.GDGROUP1 
     PS    MFI01.SIMOPROD.GDGROUP1.G0001V00 
     PS    MFI01.SIMOPROD.GDGROUP1.G0002V00 
     PS    MFI01.SIMOPROD.GDGROUP1.G0003V00 
     PS    MFI01.SIMOPROD.GDMODEL1 
     PS    MFI01.SIMOPROD.SEQ4GALL

The preceding job 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 (MFI01.SIMOPROD.SEQ4GALL) as viewed with the Micro Focus Data File Editor.

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 following jobs and review the results.

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 stes (or files) will be processed as a contiguous file starting with the last created data set.

The following shows the catalog list from Enterprise Server. 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.

 DS Org   DS Name 
    GDG    MFI01.SIMOPROD.GDGROUP1 
     PS    MFI01.SIMOPROD.GDGROUP1.G0002V00 
     PS    MFI01.SIMOPROD.GDGROUP1.G0003V00 
     PS    MFI01.SIMOPROD.GDGROUP1.G0004V00 
     PS    MFI01.SIMOPROD.GDMODEL1 
     PS    MFI01.SIMOPROD.SEQ4GALL

JCL for Execution with Mainframe Express or Mainframe
(Next) (Previous) (Table-of-Contents)

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

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

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=A,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2007 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 Enterprises
//* 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.
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN   DD   *
          DEFINE GDG(NAME(MFI01.SIMOPROD.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.

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

Before you create the files that attach to a GDG base you will need 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=A,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2007 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 Enterprises
//* Date    - November 24, 2005
//* Version - 07.01.22
//*
//* This job uses IEFBR14 and a DD statement to create the model for
//* a GDG.
//*
//* *******************************************************************
//* Step   2 of 2  Sample job to create GDG Model.
//*
//STEP020  EXEC PGM=IEFBR14
//GDGMODEL DD  DSN=MFI01.SIMOPROD.GDMODEL1,
//             DISP=(NEW,KEEP,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,0),
//             DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,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

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

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=A,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2007 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 Enterprises
//* 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.
//*
//* *******************************************************************
//* Step   1 of 2  Create a file within a GDG.
//*
//STEP010  EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
//SYSUT1   DD  *
RECORD-1000001
RECORD-1000002
/*
//SYSUT2   DD  DSN=MFI01.SIMOPROD.GDGROUP1(+1),
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=MFI01.SIMOPROD.GDMODEL1
//

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

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=A,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2007 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 Enterprises
//* 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=MFI01.SIMOPROD.SEQ4G000,
//             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.
//*
//STEP010  EXEC PGM=GDGR80C1
//SYSPRINT DD  SYSOUT=*
//GETRS80  DD  DSN=MFI01.SIMOPROD.GDGROUP1(0),DISP=SHR
//PUTRS80  DD  DSN=MFI01.SIMOPROD.SEQ4G000,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//

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

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=A,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2007 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Process a Generation Data Group (GDG).
//* Author  - SimoTime Enterprises
//* 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=MFI01.SIMOPROD.SEQ4GALL,
//             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.
//*
//STEP010  EXEC PGM=GDGR80C1
//SYSPRINT DD  SYSOUT=*
//GETRS80  DD  DSN=MFI01.SIMOPROD.GDGROUP1,DISP=SHR
//PUTRS80  DD  DSN=MFI01.SIMOPROD.SEQ4GALL,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//

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

The following (GDGD00J1.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=A,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2007 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 Enterprises
//* 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=MFI01.SIMOPROD.GDGROUP1(0),
//             DISP=(MOD,DELETE,DELETE)
//

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

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=A,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2007 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text    - Delete the Base for a Generation Data Group (GDG).
//* Author  - SimoTime Enterprises
//* 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.
//*
//* *******************************************************************
//* Step 1 of 1, Sample job to delete the GDG Index and included files.
//*
//STEP010  EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
  DELETE   (MFI01.SIMOPROD.GDGROUP1) GDG FORCE
/*
//

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.

The COBOL Demonstration Program
(Next) (Previous) (Table-of-Contents)

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 ENTERPRISES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2007-01-23  Generation Time: 13:41:34:32    *
      *                                                               *
      *                                   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 using 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.                                          *
      *                                                               *
      * 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 Enterprises.      *
      *                                                               *
      *        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 'Data Migration and Conversion     '.
           05  T3 pic X(10) value 'v06.01.01 '.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* GDGR80C1 '.
           05  C2 pic X(20) value 'Created by SimoZAPS,'.
           05  C3 pic X(20) value '  a utility package '.
           05  C4 pic X(28) value 'of SimoTime Enterprises, LLC'.

       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.

      *****************************************************************
      * 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  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.
           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 'is Complete...' to MESSAGE-TEXT
           else
               move 'is ABENDING...' to MESSAGE-TEXT
           end-if
           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 Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2007-01-23  Generation Time: 13:41:34:34    *
      *****************************************************************

Summary
(Next) (Previous) (Table-of-Contents)

The purpose of this suite of programs is to provide examples for creating and processing Generation Data Groups (GDG's)

Software Agreement and Disclaimer
(Next) (Previous) (Table-of-Contents)

Permission to use, copy, modify and distribute this software for any commercial purpose requires a fee to be paid to Simotime Enterprises. Once the fee is received by SimoTime the latest version of the software 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.

Permission to use, copy, modify and distribute this software for a non-commercial purpose and without fee is hereby granted, 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 for any purpose. It is provided "AS IS" without any express 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.

Downloads and Links to Similar Pages
(Next) (Previous) (Table-of-Contents)

You may download this example at  http://www.simotime.com/sim4dzip.htm#gdgone01  or view the complete list of SimoTime Examples at  http://www.simotime.com/sim4dzip.htm .

Note: You must be attached to the Internet to download a Z-Pack or view the list.

The  hexadecimal dump  of the parameter-buffer uses the same technique as describe in another SimoTime example that describes the dumping of a data string using COBOL. The name of the member that does the actual hexadecimal dump is called SimoDUMP. A copy file (PASSDUMP.CPY) is provided for defining the pass area.

The  SimoZAPS Utility Program  has the capability of generating a COBOL program that will do the conversion of sequential and VSAM (KSDS) files between EBCDIC and ASCII. SimoZAPS can also read a sequential file in EBCDIC format and create an ASCII/CRLF file or VSAM KSDS file in ASCII format. The conversion tables may be viewed or modified to meet unique requirements. The Hexcess/2 function provides the capability of viewing, finding or patching the contents of a file in hexadecimal.

This item will provide a link to  an ASCII or EBCDIC translation table . A column for decimal, hexadecimal and binary is also included.

Check out  The VSAM - QSAM Connection  for more examples of mainframe VSAM and QSAM accessing techniques and sample code.

This document provides a quick summary of the  File Status Key  for VSAM data sets and QSAM files.

Check out  The SimoTime Library  for a wide range of topics for Programmers, Project Managers and Software Developers.

To review all the information available on this site start at  The SimoTime Home Page .

Glossary of Terms
(Next) (Previous) (Table-of-Contents)

Check out  The SimoTime Glossary  for a list of terms and definitions used in the documents provided by SimoTime.

Comments or Suggestions
(Next) (Previous) (Table-of-Contents)

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

We appreciate your comments and feedback.

About SimoTime Enterprises, LLC
(Next) (Previous) (Table-of-Contents)

Founded in 1987, SimoTime Enterprises is a privately owned, Limited Liability Corporation located in Novato, California. 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 complimentary 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
Copyright © 1987-2008 SimoTime Enterprises, LLC  All Rights Reserved
When technology complements business
http://www.simotime.com
Version 07.01.18