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

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu May 24, 2012 7:21 am
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
Reply with quote

Hi There,

You may want to look at the following link:

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: 2455
Location: Hampshire, UK

PostPosted: Thu May 24, 2012 11:39 am
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
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

Moderator Emeritus


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

PostPosted: Fri May 25, 2012 2:20 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - create and write to output fi... COBOL Programming 0
No new posts DataSet member creation failed with B... Java & MQSeries 15
No new posts Dynamically read input files using BP... COBOL Programming 23
No new posts use BPXWDYN after calling CEE3DMP for... COBOL Programming 1
No new posts ISPF 3.4 edit of a ps file, disp use... TSO/ISPF 3
Search our Forums:

Back to Top