Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

BPXWDYN DISP=(NEW,CATLG,KEEP) - can it be done ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
dcshnier

New User


Joined: 28 Dec 2006
Posts: 27
Location: Baltimore, MD 21215

PostPosted: Thu May 24, 2012 6:42 am    Post subject: BPXWDYN DISP=(NEW,CATLG,KEEP) - can it be done ?
Reply with quote

I have managed to figure out how to use BPXWDYN in a COBOL program to dynamically allocate files.
I can allocate new files, if I just stick to using two disposition parameters (i.e. DISP=(NEW,CATLG) - or in BPXWDYN terminology: NEW CATALOG
But is there a way to get it to recognized a third dipsosition option ??
Specifically, I want to allocate the new dataset as:
DISP=(NEW,CATLG,KEEP). - so that the file will be retained in an ABENDED outcome.

This first attempt failed on syntax. The failed allocation string was:

ALLOC DD(FILEOUT) DSN('$XXX.VA.DEV.OUTFILE')
NEW CATALOG KEEP REUSE MSG(WTP)
TRACKS SPACE(00200,00050) RELEASE STORCLAS(SCNORMAL)

I then tried sticking the 'KEEP' parameter within a 'PATHDISP' statement; thus rendering:

ALLOC DD(FILEOUT) DSN('$XXXX.VA.DEV.OUTFILE')
NEW CATALOG PATHDISP(KEEP) REUSE MSG(WTP)
TRACKS SPACE(00200,00050) RELEASE STORCLAS(SCNORMAL)

That latest attempt did 'not' fail on SYNTAX. But rather, I failed with this message:

IKJ56876I DATA SET $XXXX.VA.DEV.OUTFILE NOT ALLOCATED, MUTUALLY EXCLUSIVE PARAMETERS SPECIFIED

If there is anyone familar with BPXWDYN who can tell me if my desire can be achieved? thanks in advance
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Thu May 24, 2012 7:21 am    Post subject:
Reply with quote

The BPXWDYN documentation for dynamic allocation refers to the TSO ALLOCATE command syntax, which does not support the option you're wanting to use. Since BPXWDYN is pretty closely based on the TSO ALLOCATE command, I suspect it is not possible to provide the abnormal termination disposition to BPXWDYN.
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Thu May 24, 2012 11:35 am    Post subject: Reply to: BPXWDYN DISP=(NEW,CATLG,KEEP) - can it be done ?
Reply with quote

Hi There,

You may want to look at the following link:

http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.bpxb600/rda.htm


I think you may have to try something like this:

NEW PATHDISP(KEEP, KEEP) REUSE MSG(WTP)
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1825
Location: UK

PostPosted: Thu May 24, 2012 11:39 am    Post subject:
Reply with quote

In an SMS environment you would not be allowed to keep an uncatalogued dataset - and why would you. If, in an abend situation, you need to look at the file as part of your diagnosis then surely you would need it catalogued anyway so that you can find it.
Back to top
View user's profile Send private message
dcshnier

New User


Joined: 28 Dec 2006
Posts: 27
Location: Baltimore, MD 21215

PostPosted: Fri May 25, 2012 1:57 am    Post subject: Reply to: BPXWDYN DISP=(NEW,CATLG,KEEP) - can it be done ?
Reply with quote

Thanks to all the responses. They inspired me to re-read the BPXWDYN documentation and read up on the 'TSO ALLOCATE' documentation.

It would appear that unlike JCL, BPXWDYN only offers two disposition options:
(1) the status option i.e. OLD, SHR, MOD, NEW
(2) the 'free up' option (my nickname) - CATALOG, UNCATALOG, KEEP, DELETE. The free-up option is where you enter the desired disposition for the dataset after it is freed up (i.e. after the process completes regardless of whether it is a normal completion or abended completion)

I ran many tests and for example discovered that:

==> When using NEW without any accompanying free-up option, the dataset gets allocated as new, BUT, after the process finishes successfully (i.e. no abend), the dataset is NOT retained. (i.e. as if I had used NEW DELETE).

==> When using NEW CATALOG, the dataset gets allocated as new, AND, after the process finishes the dataset is retained in the catalog, EVEN if the process abended in the middle. By the way, I get the same result when I use NEW KEEP. I guess in an SMS environment, KEEP and CATALOG do the same thing. (needless to say, the dataset gets retained in the catalog when the process finishes successfully without abending).

==. When using MOD DELETE, I can safely delete any pre-existing versions of a dataset using BPXWDYN, and I will still get a zero return code even if there are no pre-existing versions.

If I am correct in my conclusions, I guess BPXWDYN does not offer that convenient flexibility of having an ABEND automatically delete a dataset. However, if it is an ABEND that I forced on my own in the program, at least we can manually delete it by calling BPXWDYN using MOD DELETE.

thanks again to everyone who helped. Feel free to reply if you disagree with my conclusions.
icon_biggrin.gif icon_idea.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri May 25, 2012 2:20 am    Post subject: Reply to: BPXWDYN DISP=(NEW,CATLG,KEEP) - can it be done ?
Reply with quote

Thanks for posting what you learned icon_smile.gif

d
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 Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts DISP=(SHR,PASS) performance opinion steve-myers JCL & VSAM 1 Wed Dec 02, 2015 11:53 pm
No new posts Question about DISP=MOD harifsheik JCL & VSAM 3 Tue Jun 16, 2015 2:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us