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

REXX to create a new GDG version. ( not base )


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

New User


Joined: 11 Jul 2007
Posts: 68
Location: noida

PostPosted: Thu May 22, 2008 4:06 pm
Reply with quote

Hi All

Following is what i've written in REXX to define a GDG base.
Pls suggest code to create a version

----------------------------------------------------
* REXX Define GDG Base */
"DEFINE GDG(NAME('TESTM.CAA5015.P41049XF') LIM(3) SCR)"

"ALLOC DD(SYSPRINT) DA(*) REU"
"ALLOC DD(SYSIN) NEW REU"
Queue " DEFINE GDG(NAME('TESTM.CAA5015.P41049XF') LIM(3) SCR)"
"EXECIO "Queued()" DISKW SYSIN (FINIS"
"CALL *(IDCAMS)"
"FREE DD(SYSPRINT SYSIN)"
---------------------------------------------------
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 22, 2008 4:11 pm
Reply with quote

no need to invoke idcams...
DEFINE is a supprted TSO command..
Address TSO "DEFINE blah... blah..."
is enough

search the forum or google for BPXWDYN
to find out how to allocate a generation
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 22, 2008 4:14 pm
Reply with quote

It has been posted by me on the forum before ................. I think.

Do a search with expat as the author and if not I will post again when I get time ......................... or if icon_neutral.gif

Although if this REXX will run in batch, then the +1 GDG can be allocated in the JCL that is submitted. Much easier.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 22, 2008 4:30 pm
Reply with quote

Code:

GDG = "YOUR GDG BASE"                                               
DSN = STRIP(GDG!!".G0000V00")                                       
X=OUTTRAP(LST.)                                                     
" LISTC ENT('"GDG"')"                                               
X=OUTTRAP(OFF)                                                     
DO A = LST.0 TO 1 BY -1                                             
  IF POS('NONVSAM',LST.A) > 0 THEN DO                               
    DSN = SUBSTR(LST.A,POS('NONVSAM',LST.A)+13,44)                 
    A = 0                                                           
  END                                                               
END                                                                 
VX = LENGTH(STRIP(DSN)) - 6                                         
NG = STRIP(OVERLAY(RIGHT(1+SUBSTR(DSN,VX,4),4,'0'),DSN,VX,4))       
"ALLOC FI(MST) NEW TRACKS SPACE(5 3) RECFM(F B) LRECL(8) DA('"NG"')"
"FREE FI(MST)"                                                     
DROP LST.                                                           
Back to top
View user's profile Send private message
Abhishek_snn

New User


Joined: 07 Nov 2008
Posts: 2
Location: New Delhi

PostPosted: Wed Dec 10, 2008 10:24 am
Reply with quote

Hi Expat,

I tried using this by changing the "YOUR GDG BASE" to a real base "TTYY.SINHAAA.TESTABC"

It gives error at !! in line 2. Should this not be ||? Also, Why do we have G0000V00?

In line 8, that +13 is the length of the base if I am not wrong?

Could not understand this whole line <NG = STRIP(OVERLAY(RIGHT(1+SUBSTR(DSN,VX,4),4,'0'),DSN,VX,4)) >

I am new to REXX and it would be a great help if you could please take some time out to answer these queries of mine.

Regards,

Abhishek
Back to top
View user's profile Send private message
Abhishek_snn

New User


Joined: 07 Nov 2008
Posts: 2
Location: New Delhi

PostPosted: Wed Dec 10, 2008 11:11 am
Reply with quote

Hi Expat,

Its working. Thanks for your support.

Regards,

Abhishek
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top