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

Read a file dynamically without the ddname in jcl.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Antonio A Negrelli

New User


Joined: 25 Apr 2020
Posts: 3
Location: Brasil

PostPosted: Wed Apr 29, 2020 10:54 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8584
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 29, 2020 11:52 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 768
Location: Pennsylvania

PostPosted: Thu Apr 30, 2020 6:42 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1018
Location: Richmond, Virginia

PostPosted: Thu Apr 30, 2020 7:54 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 891
Location: The Universe

PostPosted: Thu Apr 30, 2020 11:34 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Sort to include records of file 2 int... Java & MQSeries 1
No new posts How to modify file content using REXX CLIST & REXX 3
No new posts VB file copy COBOL program gives erro... COBOL Programming 3
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
No new posts Creating filelist ps file JCL & VSAM 2
Search our Forums:

Back to Top