View previous topic :: View next topic
|
Author |
Message |
ymfdev
New User
Joined: 17 May 2010 Posts: 10 Location: India
|
|
|
|
Hi all,
I have been searching the internet to get a solution for this for quite a few days.. but in vain..
Here is my requirement - to find the file size of a (just) created zip file in mainframe using ZIP/390 using cobol program.
The file would be created with a cobol program using the utility zip/390 and i just have to get the size of this file in Kilobytes or Bytes - if possible using the same cobol program.
Please ask me if you require more clarification to help me solve this. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
Did the zip/390 utility produce any sysout listing, or can it be brought to provide information on the (uncompressed) file sizes during the zip operation.
I suggest you check the utility's documentation to examine possible keywords to include in the input parameters. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If there is code passing data to the zip/390 utility, this code can count the bytes. . .
If the file has already been created, the size can be gotten several ways. . . There are multiple examples in the forum. |
|
Back to top |
|
|
ymfdev
New User
Joined: 17 May 2010 Posts: 10 Location: India
|
|
|
|
Hello again, all
I just found an answer with a help from colleague.
1. Just open the zipped file
2. Read it on until end
3. Have a counter with PIC S9(9) COMP VALUE +0, increment this with every read
4. After file ends, multiply this counter with the record length (say 80)
5. Store it in a 9(6) or whichever is feasible for you
6. Voila! - This is what i required. This will give the filesize in bytes.
dick - Maybe i should have seen the examples in the forum. I haven't yet.
Thanks for the reply! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Depending on exactly what you wanted, the "answer" may or may not be what you are looking for. . .
If you read the content of the zip file, you can find the size of the content. This is NOT the size of the zip archive. . .
Unless i misunderstand your original questoin, you asked how to find the size of the archive:
Quote: |
to find the file size of a (just) created zip file in mainframe using ZIP/390 |
Which "answer" you want depends on how the answer will be used. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Im wondering that using the ZIP/390 API, the parameter list supplied to
ZIP/390 not is returning values about input/output file size.
Maybe it is practical to give an example about the calling sequence from
the manual/program.
Whatever i know about using ZIP api's in the PC world that infromation is
always (ok, almost all the time) returned after calling a ZIP dll. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I don't have access to my ZIP390 manual today; I can check tomorrow. However, the ZIP390 API interface does not appear to have any output file length -- there are several fields named LEN but they're all 4 digits long. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The ZIP/390 API includes parameters of Z-OUTPUT-SIZE, Z-FILE-INPUT-SIZE-64, Z-FILE-INPUT-SIZE, Z-FILE-OUTPUT-SIZE-64, and Z-FILE-OUTPUT-SIZE (all but the first are defined as READ-ONLY by the API). However, my (admittedly limited) testing has not found anything but zeroes in these fields. |
|
Back to top |
|
|
|