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

DataSet member creation failed with BPXWDYN failed;


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raminenibhanu

New User


Joined: 31 Jan 2022
Posts: 7
Location: United States

PostPosted: Mon Jan 31, 2022 10:57 pm
Reply with quote

Trying to create a member DataSet and it failed with the below error message. Please let me know how to address this issue.?

com.ibm.jzos.RcException: BPXWDYN failed; error in keyword number: 5 RC=-25 (0xffffffe7)
at com.ibm.jzos.ZFile.bpxwdyn(ZFile.java:152)


Input Data

ReadWriteDS :PDS(TEST1)
ReadWriteDS :PDS(TEST3)
zFileInDS initialzied1 :USER.PDS(TEST1)
SourceDSN : USER.PDS(TEST1)
targetDSN : USER.PDS(TEST3)


Code

public ZFile createDSN(String datasetName,String templateDSName) throws Exception
{
ZFile zFileOut = null;
String targetDD = ZFile.allocDummyDDName();

// bpxwdyn requires fully-qualfied dsn (it will not add uid).
// so we make sure that we have a fully qualified DSNs
String sourceDSN = templateDSName;
System.out.println("SourceDSN : "+sourceDSN);
String targetDSN = ZFile.getFullyQualifiedDSN(datasetName);
System.out.println("targetDSN : "+targetDSN);
try{

ZFile.bpxwdyn("alloc fi(" + targetDD + ") da(" + targetDSN
+ ") like(" + sourceDSN + ") reuse new catalog msg(wtp)");

zFileOut = new ZFile("//DD:" + targetDD, "wb,type=record,noseek");

}catch(Exception e) {
e.printStackTrace();}
return zFileOut;
}[/code]
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Mon Jan 31, 2022 11:11 pm
Reply with quote

CODE TAGS
Back to top
View user's profile Send private message
raminenibhanu

New User


Joined: 31 Jan 2022
Posts: 7
Location: United States

PostPosted: Mon Jan 31, 2022 11:57 pm
Reply with quote

CODE TAGS ?

Getting error at the below command. Same command works for regular datasets creation, but for member dataset creation its failing.

ZFile.bpxwdyn("alloc fi(" + targetDD + ") da(" + targetDSN
+ ") like(" + sourceDSN + ") reuse new catalog msg(wtp)");
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Tue Feb 01, 2022 12:31 am
Reply with quote

CODE TAGS - where they are??
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Feb 01, 2022 12:39 am
Reply with quote

Quote:
Getting error at the below command. Same command works for regular datasets creation, but for member dataset creation its failing.


Is:
A) The value of targetDSN and sourceDSN the PDS name only?
B) or is the (member) included?

If B then that is your issue. You should allocate with just the PDS name. You can not allocate a member with bpxwydn or any utility (as far as I know).

To use code tags, I highlite the code below and click Code box above.
Code:
ZFile.bpxwdyn("alloc fi(" + targetDD + ") da(" + targetDSN
+ ") like(" + sourceDSN + ") reuse new catalog msg(wtp)");
Back to top
View user's profile Send private message
raminenibhanu

New User


Joined: 31 Jan 2022
Posts: 7
Location: United States

PostPosted: Tue Feb 01, 2022 12:56 am
Reply with quote

Dave,

Value of the target DSN & Source DSN are below and members included

SourceDSN : USER.PDS(TEST1)
targetDSN : USER.PDS(TEST3)

thanks
Bhanu
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Feb 01, 2022 12:58 am
Reply with quote

I am not sure what all your code is trying to do, but you can not allocate a PDS with the (member) attached.

The PDS should be created NEW ONCE (without the member).

Then perhaps allocate as SHR afterwards (with the member),
then copy/write to to that allocated DD.

I say perhaps because the information vague.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Tue Feb 01, 2022 1:03 am
Reply with quote

raminenibhanu wrote:
CODE TAGS ?

Getting error at the below command. Same command works for regular datasets creation, but for member dataset creation its failing.

ZFile.bpxwdyn("alloc fi(" + targetDD + ") da(" + targetDSN
+ ") like(" + sourceDSN + ") reuse new catalog msg(wtp)");


1) Carefully print the result of this terrible concatenation producing the parameter for BPXWDYN

2) Run as many tests as needed to execute this resulting ALLOC command manually, in TSO environment.

3) When you are sure the ALLOC command itself is working as desired, you can start incorporating all your garbage into your terrible code.

4) Do not forget to trace carefully every intermediate step: the clear input and output produced by every your statement.

5) Do not suppose that forum members have to do your own job for you. You have to present all detailed information to the forum, and - to be polite - you must format all your input in a readable way, not in the form as if it was taken from a trash.
Back to top
View user's profile Send private message
raminenibhanu

New User


Joined: 31 Jan 2022
Posts: 7
Location: United States

PostPosted: Tue Feb 01, 2022 1:20 am
Reply with quote

Alloc cmd :alloc fi(SYS00009) da(USER.PDS(TEST6)) like(USER.PDS(TEST1)) reuse new catalog msg(wtp)
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Feb 01, 2022 1:25 am
Reply with quote

Quote:
Alloc cmd :alloc fi(SYS00009) da(USER.PDS(TEST6)) like(USER.PDS(TEST1)) reuse new catalog msg(wtp)


Let us know if this statement is clear?

You can not allocate a pds(with member) as NEW.
Back to top
View user's profile Send private message
raminenibhanu

New User


Joined: 31 Jan 2022
Posts: 7
Location: United States

PostPosted: Tue Feb 01, 2022 1:38 am
Reply with quote

what are the options that I need to pass for PDS with member

reuse new catalog msg(wtp) -- tried it didnt work.
Back to top
View user's profile Send private message
raminenibhanu

New User


Joined: 31 Jan 2022
Posts: 7
Location: United States

PostPosted: Tue Feb 01, 2022 1:39 am
Reply with quote

reuse catalog msg(wtp) -- tried it didnt work.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Feb 01, 2022 1:45 am
Reply with quote

I am getting very tired here. This is my last try to help.

From my earlier post (did you read it?)

I am not sure what all your code is trying to do, but you can not allocate a PDS with the (member) attached as new.

1) The PDS should be created NEW ONCE (without the member).

2) Then perhaps allocate as SHR afterwards (with the member)

3) Then copy/write to to that allocated DD.
Back to top
View user's profile Send private message
raminenibhanu

New User


Joined: 31 Jan 2022
Posts: 7
Location: United States

PostPosted: Tue Feb 01, 2022 2:00 am
Reply with quote

thanks Dave for the information. Will try your recommendations.
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Tue Feb 01, 2022 10:58 pm
Reply with quote

It is important to understand that specifying a member name in the data set name sent to BPXWDYN does not actually create the member.

To actually create the member you must then run a program that writes data to the "file" created by BPXWDYN. This program can be the program that calls BPXWDYN, or another program the specifies the "file" created by BPXWDYN.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 592
Location: London

PostPosted: Fri Feb 04, 2022 10:25 pm
Reply with quote

Allocate the dataset without specifying the member name at the end.

Alloc cmd :alloc fi(SYS00009) da(USER.PDS) like(USER.PDS) reuse new catalog msg(wtp)

After it's created, then you can write to the dataset specifying a member name on the end USER.PDS(TEST6). In fact you have to write to it that way, otherwise it destroys the datasets directory making it unusable.

I suggest you read about the LIKE parameter as it may not work exactly as you expect. It can affect the way the SMS ACS routines work as well because some of the read only variable are not passed using LIKE

www.ibm.com/docs/en/zos/2.1.0?topic=statement-like-parameter
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 -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts Reading Empty Dataset DFSORT/ICETOOL 5
No new posts Mainframe Dataset Binary or ASCII Mainframe Interview Questions 4
No new posts SPOOL to Mainframe dataset in batch mode JCL & VSAM 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top