IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Creating GDG base similar to another GDG base


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vasanthr

New User


Joined: 24 Jan 2011
Posts: 21
Location: India

PostPosted: Fri Sep 09, 2011 12:44 pm
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Sep 09, 2011 2:48 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Sep 10, 2011 12:11 am
Reply with quote

Gosh Robert, what do you mean nothing else, what about the SCRATCH parameter icon_lol.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Sep 10, 2011 12:22 am
Reply with quote

expat, I forgot about the scratch parameter and the purge / nopurge parameter -- mea culpa?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Sep 10, 2011 12:37 am
Reply with quote

Mea Maxima Culpa . . .

icon_wink.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Sat Sep 10, 2011 3:03 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Creating Unix Directory using COBOL i... COBOL Programming 2
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Creating CSV file from Variable recs ... DFSORT/ICETOOL 11
No new posts Creating a VB file PL/I & Assembler 10
No new posts Creating filelist ps file JCL & VSAM 2
Search our Forums:

Back to Top