View previous topic :: View next topic
|
Author |
Message |
Vasanthr
New User
Joined: 24 Jan 2011 Posts: 21 Location: India
|
|
|
|
I want to create a GDG base similar to another GDG base.
Is there any JCL to create such GDG base?
I know this is possible through fileaid 3.2 option. But I need a JCL to perform this as there are many files and I am in middle of production fix.
So it would be helpful if some one can provide the JCL |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I want to create a GDG base similar to another GDG base. |
Do you mean with the same number of generations? If not, what do you want to be similar?
A GDG base is pretty much a catalog entry with the limit and nothing else. Execute IDCAMS and use DEFINE GDG for the new one, just like you would any GDG. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Gosh Robert, what do you mean nothing else, what about the SCRATCH parameter |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
expat, I forgot about the scratch parameter and the purge / nopurge parameter -- mea culpa? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Mea Maxima Culpa . . .
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Vasanthr wrote: |
I want to create a GDG base similar to another GDG base.
Is there any JCL to create such GDG base? |
I tell you three times, and what I tell you three times is true: JCL only establishes an environment and runs a program. It cannot generate control cards, count records, extract rows from tables, or any of the myriad things that misinformed "software engineers" think that it could if only they knew how to write it.
However, you can use the following Rexx program to generate a set of control cards:
Code: |
/* Rexx */
/* Written Heisei 23.9.9 by Akatsukami-sama */
trace o
arg from to where .
isbase = 0
k = 0
drop base. limit. scratch. empty.
"ALLOC FI(TOOLOUT) DA('"where"') SHR"
x = outtrap("LISTC.")
"LISTCAT LEVEL('"from"') ALL"
x = outtrap("OFF")
do i = 1 to listc.0
if (substr(listc.i,1,1)¬=' ') then isbase = 0
if (pos("GDG BASE",listc.i)¬=0) then do
isbase = 1
mp1 = pos(from,listc.i)
mp2 = length(listc.i)
llq = substr(listc.i,mp1+length(from),mp2-mp1-1)
end
if ((pos("ATTRIBUTES",listc.i)¬=0) & (isbase=1)) then do
k = k + 1
base.0 = k
j = i + 1
lp1 = lastpos('-',listc.j)
lp2 = pos(' ',listc.j,lp1)
base.k = to || llq
limit.k = substr(listc.j,lp1+1,lp2-lp1-1)
if (pos('NOSCRATCH',listc.j)¬=0) then scratch.k = 'NOSCRATCH'
else scratch.k = 'SCRATCH'
if (pos('NOEMPTY',listc.j)¬=0) then empty.k = 'NOEMPTY'
else empty.k = 'empty'
end
end
if (base.0>0) then do i = 1 to base.0
card = " DEFINE GDG -"
push card
"EXECIO 1 DISKW TOOLOUT"
card = " NAME("base.i") -"
push card
"EXECIO 1 DISKW TOOLOUT"
card = " "empty.i" -"
push card
"EXECIO 1 DISKW TOOLOUT"
card = " "scratch.i" -"
push card
"EXECIO 1 DISKW TOOLOUT"
card = " LIMIT("limit.i"))"
push card
"EXECIO 1 DISKW TOOLOUT"
end
"EXECIO 0 DISKW TOOLOUT (FINIS"
"FREE FI(TOOLOUT)" |
|
|
Back to top |
|
|
|