You could download the free ARP-ZIP utility from here:

It's a native iseries command driven zipper that does zips, tars, jars, gzips, bzips and z's. It has encryption too. Wildcards of course.

On 10/22/2012 10:46 PM, Anderson, Kurt wrote:

I'm posting this mainly for the archives (although also for any additional input as people see fit), as it was a hassle I went through.

Quite often we create a file on the IFS, zip it, then FTP the zipped file. This is how we zip it, and it works great:
STRQSH CMD('jar cfM /Customer/DLG/BillingReportFiles/ -C /Customer/DLG/BillingReportFiles/ DLG1207F-Corp228147F.csv')

I've been given a task to zip up multiple files. I tried using the wildcard, which didn't work, and have since found out that QSH will interpret the wildcard instead of passing it along to the jar command.
jar cfM /Customer/DLG/BillingReportFiles/ -C /Customer/DLG/BillingReportFiles/ DLG1207F-*.*
When I did this, it created a zip file that had a 0 byte version of itself inside. The new zip file was created in the same directory as the .csv file, but did not zip up that .csv.

I also tried using a period (.) instead of DLG1207F-*.* That didn't go over so well as it started to create a huge zip file (hopefully me exiting out of QSH cancelled that... I deleted the file as well.).

I eventually discovered what I believe to be the issue. It seems that STRQSH was resolving the wildcard in the current directory' outside of the file path I was expecting it to use (the one supplied to the JAR command).

I have modified our zip process to now to change the current directory prior to performing the zip. In doing this, STRQSH appears to correctly resolve the wildcards.
STRQSH CMD('cd /Customer/DLG/BillingReportFiles/; jar cfM /Customer/DLG/BillingReportFiles/ -C /Customer/DLG/BillingReportFiles/ DLG1207F-*.*')

I wondered if this issue of STRQSH interpreting wildcards would be a good reason to switch over to the new QZIPZIP API, however according to the documentation that doesn't support wildcards either.
"Wild card characters and pattern matching of the path name is not supported."

I was also wondering if there was a way to escape STRQSH from resolving wildcards so the command being called would.

Kurt Anderson
Sr. Programmer/Analyst
CustomCall Data Systems, a division of Enghouse Networks

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page