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

Finding file size of ZIP/390 zipped file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ymfdev

New User


Joined: 17 May 2010
Posts: 10
Location: India

PostPosted: Mon Sep 06, 2010 4:25 pm
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Mon Sep 06, 2010 8:19 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Sep 06, 2010 10:28 pm
Reply with quote

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
View user's profile Send private message
ymfdev

New User


Joined: 17 May 2010
Posts: 10
Location: India

PostPosted: Tue Sep 07, 2010 2:47 pm
Reply with quote

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. icon_biggrin.gif

dick - Maybe i should have seen the examples in the forum. I haven't yet.

Thanks for the reply!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 07, 2010 8:21 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Sep 07, 2010 9:55 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 07, 2010 10:11 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Sep 07, 2010 10:16 pm
Reply with quote

Robert,

please do. I did read something on the internets about a parm list
including read only fields (even 64 bits) giving before mentioned info.
It was a french site i remember, and it was used in a CICS environment.

Found it :

www.query-informatique.com/telechargement/Data21/ZIP-390/API%20exemples%20Assembler-Cobol-CICS.doc
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Sep 09, 2010 6:07 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top