View previous topic :: View next topic
|
Author |
Message |
Antonio A Negrelli
New User
Joined: 25 Apr 2020 Posts: 3 Location: Brasil
|
|
|
|
Hello,
I have a question about reading dynamic files.
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.
And then make an output to a ddname declared in the jcl.
It is a situation that we have here in our environment and that would help a lot. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
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 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. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
I do not want to be argumentative, however I am able to create a +1 generation of a gdg using BPXWDYN.
This is just my experience.
Perhaps, running Rexx under TSO/ISPF is a factor.
Rexx Code
Code: |
DS_NAME = 'MYGDG.CARDS(+1)'
DA = 'DA('DS_NAME')'
T1 = 'ALLOC DD(DDOUT)' DA 'UNIT(SYSDA) SPACE(1,1) TRACKS REUSE'
T1 = T1 'NEW CATALOG'
T1 = T1 'DSORG(PS) RECFM(FB) BLKSIZE(0) LRECL(80)'
SAY T1
CALL 'BPXWDYN' T1
RC1 = RESULT
X = LISTDSI(DDOUT 'FILE')
SAY 'RC1 - ' RC1 SYSDSNAME |
Results
Code: |
ALLOC DD(DDOUT) DA(MYGDG.CARDS(+1)) UNIT(SYSDA) SPACE(1,1) TRACKS REUSE NEW CATALOG DSORG(PS) RECFM(FB) BLKSIZE(0) LRECL
(80)
RC1 - 0 MYGDG.CARDS.G0001V00 |
|
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 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. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 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. |
|
Back to top |
|
|
|