First an foremost - GZIP != ZIP

While ZIP is an archiving solution, which packs several files and directories into one ZIP-file - GZIP is a data-stream compressor. It simply compresses/decompresses the data-stream which it got feed by other tools (like TAR or CAT). It was developed as an replacement for the Unix compress command, which used the patented LZW algorithm.

Depending on what exactly should be done, it might be quite easy to utilize Java from ILE-RPG (using JNI) to compress and decompress data in GZIP/GZ format.

Java knows the classes:

- java.util.zip.GZIPInputStream
- java.util.zip.GZIPOutputStream

And it's quite easy to create your own IFS file compressor or decompressor in about 20 lines of code each. And as you more or less can translate Java code to ILE-RPG, this isn't so hard to do.

If I find some time, I will try to create a small example which compresses or decompresses a BLOB (or better a VARCHAR(...) CCSID(*HEX)) - maybe that will help.

HTH and kind regards,
Daniel


Am 22.03.2025 um 14:43 schrieb Vern Hamberg via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>:

I suspect that this command is limited to PKZIP compression. I tried running it against a tar.gz file and received a message that the file or content was not valid for decompression - something like that.

Examples in the command help text are a ZIP file and a JAR file. JAR files are PKZIP'd archives.

I ran the CPYTOARCF, and the result was a PKZIP'd archive. You can determine that by looking at the file contents in a text editor, the first 2 characters are PK. Also look in WRKLNK with CCSID 850.

The archive file was created as CCSID 37, but the contents are ASCII, that's why I used F15 in WRKLNK display to see the actual content in CCSID 850. Archives like this are probably processed as non-text, so CCSID doesn't really matter, especially on other systems.

*Regards*

*Vern Hamberg*

IBM Champion 2025 <cid:part1.dokVVjHR.X9RPFjYt@centurylink.net> CAAC (COMMON Americas Advisory Council) IBM Influencer 2023

On 3/22/2025 6:59 AM, Gad Miron wrote:
Just wondering

What about CPYFRMARCF CL CMD?

Gad
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.