Dynamic GDG allocation



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

Dynamic GDG allocation

Postby DFuhr2010 » Sat Sep 04, 2010 7:17 pm

Trying to create GDG data set within REXX.
Code appears:
/***********************************************************/
/* OPEN THE INPUT FILE (CONTAINING DCOLLECT RECORDS) */
/***********************************************************/
INNAME = "myhlq.DCOLLECT.ALLVOLS(+0)"
"ALLOC F(INFILE) DA("INNAME") SHR"
IF RC¬= 0 THEN DO
SAY 'ALLOCATION OF ('INNAME') FAILED'
EXIT 8
END


Receive RC08 (code exit) with:
INVALID DATA SET NAME, myhlq.DCOLLECT.ALLVOLS(+0)
MISSING DATA SET NAME OR *+
MISSING NAME OF DATA SET TO BE ALLOCATED
ALLOCATION OF (myhlq.DCOLLECT.ALLVOLS(+0)) FAILED
DFuhr2010
 
Posts: 20
Joined: Sat Sep 04, 2010 7:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX Code

Postby steve-myers » Sat Sep 04, 2010 7:35 pm

This is not a Rexx problem; it's a TSO problem! The TSO ALLOCATE command, and TSO in general, for that matter, does not support the +numeric, -numeric, or even numeric in DATASET(dsname(+1))
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: REXX Code

Postby MrSpock » Sat Sep 04, 2010 7:36 pm

The TSO allocate command doesn't work for a dataset name as you've provided. It has to be a real, actual dataset name, something like:

INNAME = "myhlq.DCOLLECT.ALLVOLS.G0001V00"

which uses the absolute generation format of a GDS.

Which will work fine. If you really want to create a new GDG using the relative generation, then I'd suggest that you allocate the GDG in the calling JCL, not within your REXX exec.

If you absolutely MUST try to allocate a new generation using a relative generation, in a TSO foreground process, then you'll have to use the BPXWDYN dynamic allocation routine:

/* REXX */                                                       
allocstr = "ALLOC DD(SYSUT2) DSN('THE.GDG(+1)')",             
  "NEW CATALOG REUSE RELEASE",                                   
  "RECFM(F,B) UNIT(SYSDA) DSORG(PS) RTDDN(THEDDN) RTDSN(THEDSN)" 
Call BPXWDYN(allocstr)                           
Do i = 1 To 10                                         
  Queue "Record"Right(i,3)" of 10"                     
End                                                     
"EXECIO "Queued()" DISKW SYSUT1 (FINIS"                 
"CALL *(ICEGENER)"                                     
x = LISTDSI(SYSUT2 FILE)                               
Say THEDDN THEDSN                                       
Say SYSDSNAME                                           
Do n = 1 To S99MSG.0                                   
  Say S99MSG.n                                         
End                                                     
allocstr = "FREE DD(SYSUT2)"                           
Call BPXWDYN(allocstr)                 
Exit 0 


Just keep in mind how GDG processing works, how system enqueues are placed and how the next absolute generation number is determined.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Dynamic GDG allocation

Postby DFuhr2010 » Sat Sep 04, 2010 7:57 pm

I will reference a DD Statement in the JCL and use REXX to reference the DD statement.
Thanks for quick response.
DFuhr2010
 
Posts: 20
Joined: Sat Sep 04, 2010 7:08 pm
Has thanked: 0 time
Been thanked: 0 time


Return to All other Mainframe Topics