I have a java program calculates how old a mvs dataset is, and if it over x number of days old, deletes it. ( myzfile.remove("mydsnname") )
This works fine unless the dataset is migrated, in which case the file is not deleted.
I could recall all the datasets first, but that would likely cause space issues.
Can anybody suggest a clean(er) workaround?
thanks
Zfile.remove - migrated DSNs
Re: Zfile.remove - migrated DSNs
i should have mentioned message that appears in STDOUT is
[datasetname] on MIGRAT Volume not mounted
so it appears that zfile.remove won't work if the dataset is migrated. the only workaorund i can think of is to recall all the datasets first.
[datasetname] on MIGRAT Volume not mounted
so it appears that zfile.remove won't work if the dataset is migrated. the only workaorund i can think of is to recall all the datasets first.
Re: Zfile.remove - migrated DSNs
ZFile.remove simply calls the fremove() C library routine.
I don't know of a work-around. Suggest opening a requirement with IBM.
I don't know of a work-around. Suggest opening a requirement with IBM.
Re: Zfile.remove - migrated DSNs
ok thanks! At least i know i'm not missing something obvious.
Re: Zfile.remove - migrated DSNs
The only alternative that I can think of is writing a program that does HDELETEs.
Could be done as user-written JNI, but somewhat easier to build a z/OS Unix module and then run is via Runtime.exec() or com.ibm.jzos.Exec. Could pipe a list of datasets to delete or HDELETE via stdin.
Could be done as user-written JNI, but somewhat easier to build a z/OS Unix module and then run is via Runtime.exec() or com.ibm.jzos.Exec. Could pipe a list of datasets to delete or HDELETE via stdin.
Re: Zfile.remove - migrated DSNs
I'm sorry, I completely missed a good way to do this -
JZOS has an interface to calling IDCAMS (com.ibm.jzos.AccessMethodServices).
See the javadoc for example usage.
You could invoke this and then pass IDCAMS DELETE commands. IDCAMS will automatically avoid recalling migrated datasets.
JZOS has an interface to calling IDCAMS (com.ibm.jzos.AccessMethodServices).
See the javadoc for example usage.
You could invoke this and then pass IDCAMS DELETE commands. IDCAMS will automatically avoid recalling migrated datasets.