APIs by Example: Zip and Unzip Files with the New 7.1 Zip API Support

In a recent IBM announcement, IBM revealed that zip and unzip file support had been developed and PTF’d for release 7.1. This support comes in the form of two ILE APIs, QzipZip and QzipUnzip, respectively. At the end of this article, I’ve included information about the 7.1 PTFs delivering the zip support APIs. One PTF installs the QZIPUTIL service program containing the aforementioned APIs, and another PTF copies the associated header files to the QSYSINC library. The zip support was part of a major refresh of IBM i 7.1, and I suggest you follow the above link to familiarize yourself with all the details, which might include other enhancements of interest.

After a quick study of the zip APIs’ documentation and header files, I knew that it would be quite useful to create a couple of CL command interfaces to make the zip and unzip services immediately available, wherever and whenever the common requirement of zipping or unzipping a file or directory on IBM i was encountered. I therefore decided to write the Zip File (ZIPF) and Unzip File (UNZIPF) CL commands. The CPPs also offer RPG/IV examples of how to code the two corresponding APIs, should you want to integrate zip or unzip functionality directly in your programs. Today’s APIs by Example brings you the details.

The IBM announcement says that the QzipZip and QzipUnzip APIs are available with the most recent IBM HTTP SERVER FOR I group PTF, which at the time of writing amounts to level 10. However, it quickly became apparent that this is not the case. I expect the APIs will be included in the next update of the HTTP group PTF, although I do not know that for sure, so we’ll have to wait and see. Doing a search on IBM’s APAR and PTF database, however, allowed me to identify the two PTFs including the APIs as well as the associated QSYSINC library header files, respectively, and as mentioned you’ll find links to the PTF cover letters below.

Download the save file containing the source code.

Read the entire article.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s