Hello,
Does anyone know of a way to remove an MVS file from a servlet running Tomcat?
Thanks in advance for your help,
Nalini Elkins
Inside Products, Inc.
www.inside-products.com
Removing an MVS file
Nalini,
Unfortunately, we do not have a nice simple api in ZFile which does this. I will add it to the list for the next release.
In the mean time, you can delete a traditional MVS dataset by allocating it with disposition delete and then freeing the dataset. This can be done by using the ZUitl.bpxwdyn() method, which is an interface to IBM's BPXWDYN service, which is a text-based interface to dynamic allocation.
For example:
ZUtil.bpxwdyn("alloc fi(mydd) da(fully.qualified.dataset.name) old delete msg(WTP)" );
ZUtil.bpxwdyn("free fi(mydd) msg(WTP)");
Note: "mydd" must be a 1-8 character DD name of your choosing which is not already allocated / in use. You may want to serialize access to the code that does this, since multiple threads running the above code might contend in a race condition for the same ddname.
Documentation for BPXWDYN can be found in the IBM manual:
http://publibz.boulder.ibm.com/epubs/pdf/bpxzb651.pdf
Unfortunately, we do not have a nice simple api in ZFile which does this. I will add it to the list for the next release.
In the mean time, you can delete a traditional MVS dataset by allocating it with disposition delete and then freeing the dataset. This can be done by using the ZUitl.bpxwdyn() method, which is an interface to IBM's BPXWDYN service, which is a text-based interface to dynamic allocation.
For example:
ZUtil.bpxwdyn("alloc fi(mydd) da(fully.qualified.dataset.name) old delete msg(WTP)" );
ZUtil.bpxwdyn("free fi(mydd) msg(WTP)");
Note: "mydd" must be a 1-8 character DD name of your choosing which is not already allocated / in use. You may want to serialize access to the code that does this, since multiple threads running the above code might contend in a race condition for the same ddname.
Documentation for BPXWDYN can be found in the IBM manual:
http://publibz.boulder.ibm.com/epubs/pdf/bpxzb651.pdf