View previous topic :: View next topic
|
Author |
Message |
Onupz
New User
Joined: 03 Aug 2006 Posts: 3 Location: Kolkata
|
|
|
|
Hi all,
I need JCL to define a number of GDG bases (500-600) at once.
I have the JCL for defining one GDG base:
//STEP001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GENERATIONDATAGROUP ( -
NAME(HLQ.MLQ.LLQ) -
LIMIT(3) -
NOEMPTY -
SCRATCH )
/*
But for creating X no of GDGs I have to write X no of Steps.
Is there any other way out where I can paste the name of the files in the JCL itself or in a file and the GDGs will be created? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Onupz wrote: |
But for creating X no of GDGs I have to write X no of Steps. |
No, that's not true.
Onupz wrote: |
Is there any other way out where I can paste the name of the files in the JCL itself or in a file and the GDGs will be created? |
Can't you write a program/command list/routine that can build your DEFINE statements programatically, using a list of required files that you provide as its input? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You can use REXX to call IDCAMS to define the GDG base, and also I have very recently put some code to create the next generation for a GDG, so you only need one REXX EXEC to both build the base and define the first generation. |
|
Back to top |
|
|
Onupz
New User
Joined: 03 Aug 2006 Posts: 3 Location: Kolkata
|
|
|
|
But is it possible to do so through JCL? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yes it is. |
|
Back to top |
|
|
Onupz
New User
Joined: 03 Aug 2006 Posts: 3 Location: Kolkata
|
|
|
|
how?
without repeating the steps?
becuase for creating 500-600 GDGs it is not practically feasible to repeat the steps that many time and enter the file names in each step.
How can I do so by JCL in a few steps? there must be some trick.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
If you bother to read the replies, you will find that it is possible to do this in ONE REXX step. |
|
Back to top |
|
|
Ganesh.Deokar
New User
Joined: 30 Sep 2005 Posts: 26 Location: Buffalo,NY
|
|
|
|
Onupz,
It's simple. You can create thousands of GDGs in a single IDCAMS step. Last week I got same requirement for my project and I created 1500 GDGs using a simple REXX program.
1) Create a list of GDG bases in a PS file or If you want to do more automation then write a small REXX program to read your JCL and capture GDG bases names (The dsname will be Between "DSN=" and "(+1)" in your JCL). Store all these GDG base names in a PS file.
2) Write another REXX program or continue in the same REXX above to read above file and create the JCL for creation of GDGs
Code: |
/*REXX*/
address tso
"alloc da('your.jcl.library') fi(jcl) shr reuse"
"execio * diskr jcl (stem write. finis"
write.1 ='//'jclname' JOB PRTY=03,'
write.2 ='// REGION=8M,'
write.3 ='// MSGCLASS=M,'
write.4 ='// MSGLEVEL=(1,1)'
write.5 ='//*'
write.6 ='//STEP01 EXEC PGM=IDCAMS'
write.7 ='//SYSPRINT DD SYSOUT=*'
write.8 ='//SYSOUT DD SYSOUT=*'
write.9 ='//SYSIN DD *'
w = 9
"alloc da('your.gdg.list') fi(input) shr reuse"
"execio * diskr input (stem read. finis"
do i = 1 to read.0 by 1
dsname = word(read.i,1)
w = w + 1
write.w = ' DEFINE GDG(NAME('dsname') -'
w = w + 1
write.w = ' LIMIT(15) SCRATCH NOEMPTY)'
end
"execio * diskw jcl (stem write. finis" |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why write JCL to do it ?
REXX will be able to (a) Define the GDG bases and (b) Define the first generation
All in the very same step. Only one step required once the list of GDG bases is available.
In fact, this topic was discussed very recently. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I too, am curious why you'd use a REXX exec to create JCL for something that the exec itself can do. I questioned the same logic in this other topic also. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
As I'm in a very good mood this evening ..............
Assume - your input file has variables - gdgbase recfm lrecl, recfm & lrecl are needed unless you wish to dummy the (0) gen from the first batch run, in which case there is no need to bother allocating it in the first place.
Code: |
/* REXX *** Define and build first gen GDG */
"ALLOC FI(ddname) DA('"whatever"') SHR)
"EXECIO * DISKR ddname ( STEM stemname. FINIS"
DO A = 1 TO stemname.0
PARSE VAR stemname.A gdgbase recfm lrecl .
"DEFINE GDG(NAME('"STRIP(gdgbase)"') LIM(??) SCRATCH NOEMPTY"
"ALLOC FI(NEWGEN) DA('"STRIP(gdgbase!!'.G0001V00')"') NEW TRACKS
SPACE(1) RECFM("recfm") LRECL("lrecl")"
"FREE FI(NEWGEN)"
END
|
There you go, less lines of code that you would need to write the JCL.
And if you run it in batch, just remove the 2nd line of the above code. |
|
Back to top |
|
|
|