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

How to create a GDG base through REXX utilty


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

New User


Joined: 23 Apr 2007
Posts: 18
Location: India

PostPosted: Thu Apr 26, 2007 6:14 pm
Reply with quote

Hi

I need to create a GDG base through REXX. If anyone is having the code, will you be able to help?

Thanks in advance
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Apr 26, 2007 6:23 pm
Reply with quote

Does your REXX exec run under TSO? Is it running in the foreground or in batch?

If it's running under TSO in either foreground or batch, why don't you just use the same TSO command you use for defining GDG bases already?

If it's running under some other environment, you can always call IDCAMS.

Either way should work.

Here are some links to review:

DEFINE GENERATIONDATAGROUP command.

The TSO CALL Command.

z/OS V1R7.0 TSO/E REXX Reference.
Back to top
View user's profile Send private message
Velkumar

New User


Joined: 23 Apr 2007
Posts: 18
Location: India

PostPosted: Thu Apr 26, 2007 6:27 pm
Reply with quote

Hi

It truns under TSO batch only. But how to write the IDCAMS utility in REXX. I think the JCL below will not work in REXX.

//GDG EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=X
//SYSIN DD *
DEFINE GDG(NAME('TESTM.CAA5015.P41049XF') LIM(3) SCR)
/*
//

How to execute the above in REXX
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Apr 26, 2007 6:41 pm
Reply with quote

Here's an example of two different methods:

Code:

/* 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
Velkumar

New User


Joined: 23 Apr 2007
Posts: 18
Location: India

PostPosted: Fri Apr 27, 2007 10:49 am
Reply with quote

Hi

Thanks. Its working fine. Is it possible to accept the system date and use it in the name of the GDG.
In the GDG base file I need to have the sysyen date to be appended to the last qualifier of the GDG base name.

The file will be look like TSP.CAT007.BD270406
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Fri Apr 27, 2007 12:01 pm
Reply with quote

Use the DATE() built-in function when you set the dataset name.

O.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Apr 27, 2007 12:45 pm
Reply with quote

Sounds like you may want to look into expanding your user catalog environment too if you are going to create a GDG base and entries using the date as part of the base name on a very regular basis.
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