Joined: 06 Jun 2008 Posts: 8547 Location: Dubuque, Iowa, USA
I would like to know if it is possible to allocate and read a dataset (mydataset.G0001V00). But without declaring the ddname in the JCL.
It is possible using BPXWDYN, which allows dynamic allocation -- as long as you are using absolute generation names (fully qualified dataset name) for your GDG. If you are wanting to use a relative GDG reference such as GDGBASE(0) then you need to be aware that the BPXWDYN documentation EXPLICITLY states that a value in parentheses after a dataset name is a member name -- period. Hence relative GDG allocation is not possible with BPXWDYN. One of the references to BPXWDYN is https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxb600/wdyn.htm but read this carefully -- there are some tricky things you need to take into account when constructing your parameter list to call BPXWDYN.
Joined: 31 Oct 2006 Posts: 1002 Location: Richmond, Virginia
Just be sure that if you implement anything considered "tricky" or that works but seems to be not covered by the documentation, others in your installation, including those less experienced than you who may be entrusted with this system in the future are fully aware and capable.
A slightly klutzier implementation based on a more vanilla approach may be worthy of consideration, including knowledgeable management sign-off of either approach.
Joined: 30 Nov 2013 Posts: 813 Location: The Universe
Just to augment Mr. Sample & daveporcelan. The code in real dynamic allocation to allocate a member of GDG index and a member of a PDS is identical. You specify a data set name with the DALDSNAM key and a member specification with the DALMEMBR key. For a GDG the data in DALMEMBR is C'0', C'+n', or C'-n'.
There are two issues with TSO.
The first issue is IKJPARS does not accept a GDG type "member" in a data set specification. That rules out its use in the ALLOCATE command or any other TSO command that extracts a data set name in the command line.
The second issue is the first use of a GDG style "member" fixes the relative GDG "members" for the duration of the TSO session, which is why you have to be careful about specifying S99GDGNT in the S99RB when using dynamic allocation.
Years ago, in very early SPF, I slipped a GDG "member" through SPF much like daveporcelan slipped one through BPXWDYN. Now, of course, ISPF won't allow it. How much longer you can sneak one through BPXWDYN is a question I'd rather not speculate on. Perhaps, as Mr. Sample seems to suggest, this oversight has been corrected in BPXWDYN.
So, like Phrzby Phil suggests, don't even think about using a GDG member with BPXWDYN. Even if it works today does not mean it will work tomorrow.