Sei sulla pagina 1di 2

BY DONATO CAVALLO

How to refer the oldest generation of GDG


This topic was exposed in a Mainframe expert forum and one of the answers
answer can be this.

The requirements of the exposed subject

The question said, "How


How to refer the oldest
generation of GDG in a daily production job, the
problem I'm facing is, I'm never sure of number
generations available at a particular day when the job
is getting executed ?".

The Proposal

A priori there is no way to reference the


oldest version off a GDG directly in the JCL, or at least
not that I know. The solution proposed in this
document, since the adoption of a particular one is
not suggested, is through the execution of a REXX
program that retrieves the required version and
makes a copy of the data in a file, for later
processing. Obviously, there are other solutions using
other technologies, but the same concept could be
used.

The REXX script The Example JCL

This script is basically divided into two parts. The sample JCL will have a basic step with the
The first extracts the required information using a execution of IKJEFT01 where the REXX script will be
LISTCAT, the oldestt version, and the second, once the launched with de appropriated
appropri parameters as shown
full name is obtained, makes a copy with a REPRO to in Figure 2.
the file indicated in the $OUT parameter. The reason
why REPRO is used and not EXECIO, is to avoid This JCL must be configured with site
memory problems if the file to be processed is very requirements,
rements, such as the SYSPROC statement,
large. We show the REXX script in Figure 1 and will be where resides the REXX script as well as the
included in text format in the same document parameters reported to it,
it according to specific daily
published. JOB.

COBOL TIPS ● FEBRUARY 2019


A recommendation to choose the name of the file
that will be reported as parameter $OUT, is that
within its name contains something that differentiates
it from other daily processes in case the same GDG is
used in other tasks

CONCLUSIONS AND COMMENTS With a trajectory of more than 35 years in the


development of applications both in the
aerospace and banking areas, using tools such
Surely there will be other methods that are as TSO / COBOL / CICS / DB2 / PLI / ISPF / JCL
better suited to the needs of the problem, but as it among others from the Mainframe
has been raised, without having more information, it environment and can be found in Linkedin
https://www.linkedin.com/in/donatocarloscavallo
will be able to meet the requirements.

COBOL TIPS ● FEBRUARY 2019

Potrebbero piacerti anche