Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Creation of a number of GDG bases

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Onupz

New User


Joined: 03 Aug 2006
Posts: 3
Location: Kolkata

PostPosted: Thu Dec 27, 2007 7:37 pm    Post subject: Creation of a number of GDG bases
Reply with quote

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
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Thu Dec 27, 2007 7:48 pm    Post subject: Re: Creation of a number of GDG bases
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Dec 27, 2007 9:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Onupz

New User


Joined: 03 Aug 2006
Posts: 3
Location: Kolkata

PostPosted: Fri Dec 28, 2007 11:39 am    Post subject:
Reply with quote

But is it possible to do so through JCL?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 28, 2007 2:28 pm    Post subject:
Reply with quote

Yes it is.
Back to top
View user's profile Send private message
Onupz

New User


Joined: 03 Aug 2006
Posts: 3
Location: Kolkata

PostPosted: Fri Dec 28, 2007 7:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 28, 2007 9:05 pm    Post subject:
Reply with quote

If you bother to read the replies, you will find that it is possible to do this in ONE REXX step.
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Fri Dec 28, 2007 9:36 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 28, 2007 10:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Fri Dec 28, 2007 10:22 pm    Post subject: Reply to: Creation of a number of GDG bases
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 28, 2007 11:31 pm    Post subject:
Reply with quote

As I'm in a very good mood this evening .............. icon_eek.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us