java.util.zip mvs unzip routine

General discussion on the JZOS batch launcher and toolkit
Post Reply
gpklos
Posts: 10
Joined: Mon Oct 26, 2009 10:44 am

java.util.zip mvs unzip routine

Post by gpklos »

I have written a jcl routine in java for zos, which takes an MVS dataset (gdg,sequential), copies it to USS, then runs a routine from the classes in java.util.zip to zip the dataset into a zip file on USS, then use OCOPY to copy it back to the MVS side. That works fine, but now I'm trying do the same for an Unzip routine. Everything works basically the same (copy zip file from mvs to USS, then unzip it on the USS side). Now the problem comes in when I copy the unzipped files back to MVS. I don't know what the record length is or the record format, etc. Is there any way to determine that before unizipping it so that it can be allocated properly?
Thanks,
Gary
________
Yamaha FZX750
Last edited by gpklos on Mon Feb 07, 2011 8:35 pm, edited 1 time in total.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

You don't have to copy the dataset to USS first... check out the com.ibm.jzos.sample.ZipDatasets sample program.

The ZFile() class has getLrecl() and getRecfm() methods that you can use to get these attributes from an open dataset.
gpklos
Posts: 10
Joined: Mon Oct 26, 2009 10:44 am

Post by gpklos »

You mean I could run a zip/unzip program all from the mvs side that utilizes java on the USS? Could it be done so that the unzip would then unzip a file and put in a dataset with the correct characteristics? Is this part of the JZOS. I currently don't use it.

thanks,
Gary
________
Move
Last edited by gpklos on Mon Feb 07, 2011 8:35 pm, edited 1 time in total.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

I'm not sure that I understand your question.
There really isn't an MVS side or a USS side per se - a Java program can run as an MVS job and use Unix apis and filesystems, and can also run under a Unix shell and access MVS apis and dateasts.

Check out the JZOS sample program com.ibm.jzos.ZipDatasets, available here:

http://www-03.ibm.com/servers/eserver/z ... ssamp.html
gpklos
Posts: 10
Joined: Mon Oct 26, 2009 10:44 am

Post by gpklos »

I will take a look at it and try the JZOS.

I will also look at the Zip stuff for JZOS and see if I can somehow take the zipped file and know what characteristics to make it before I turn it back into a gdg.

Gary
________
buy no2 vaporizer
Post Reply