Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Read a file dynamically without the ddname in jcl.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Read a file dynamically without the ddname in jcl.
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: 8553
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 29, 2020 11:52 pm    Post subject:
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 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.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 741
Location: Pennsylvania

PostPosted: Thu Apr 30, 2020 6:42 pm    Post subject:
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: 1008
Location: Richmond, Virginia

PostPosted: Thu Apr 30, 2020 7:54 pm    Post subject:
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: 843
Location: The Universe

PostPosted: Thu Apr 30, 2020 11:34 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CA Sysview - JCL or Rexx - Read or Ex... Jasi CA Products 4 Wed Aug 05, 2020 9:19 pm
No new posts Multiple Sums in one File Rick Ryan SYNCSORT 2 Wed Jul 29, 2020 1:30 am
No new posts Extract part of data from file and wr... sathyajes DFSORT/ICETOOL 9 Thu Jul 16, 2020 10:49 am
No new posts Identify the count from two diffrent ... UmashankarSubramani DFSORT/ICETOOL 19 Sat Jul 11, 2020 4:35 am
No new posts CICS file processing using applicatio... Satish_gsv CICS 3 Sat Jul 11, 2020 4:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us