• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • IBM i and Zip Files

    January 11, 2012 Ted Holt

    You may have heard of the new zip file APIs–QZipZip and QZipUnzip–that IBM added to IBM i 7.1. I am looking forward to using them. But if your shop is like mine, that is, you’re not running 7.1, there’s another way to work with zip files, and it does a good job.

    The other way is the Java Archive utility, or jar. It’s an easy command to use, and it runs under Qshell. Here’s how it works.

    The jar command has several parameters. First is a case-sensitive list of options. You will always need a lowercase “f” option.

    Second is the name of the jar or zip file. Whether you need additional parameters or not depends on the list of options.

    I think the best way to show you how to use jar is to provide some examples. First, here’s how to create a zip file called “files.zip” to contain files “file01.txt” and “file02.txt”.

    jar cfM files.zip file01.txt file02.txt
    

    Option “c” means that the archive file is being created. Option “f” means that the second parameter contains the archive filename. Option “M” tells jar not to create a manifest file. Notice that “M” is uppercase. You don’t have to know what a manifest file is.

    The files to be zipped are named in the third and following parameters. These file names may include wildcards.

    Now view the contents of the archive.

    jar tf files.zip
    

    Option “t” means to view the list of files in the archive.

    Extract the files from (unzip) the archive.

    jar xf files.zip
    

    Option “x” stands for “extract”.

    Add another file, “file03.txt”, to the archive.

    jar ufM files.zip file03.txt
    

    Option “u” means to update the archive. Notice option “M” again.

    I assume you’ll be exchanging archive files with PCs. If so, be aware that you need to create IFS files with a code page that other systems can use, such as 819 (one of the ASCII code pages).

    For more information about the new zip APIs, visit IBM’s announcement letter. To learn more about jar, visit the Java Archive Tool page.



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Databorough:  Get ready for modernization or upgrades with X-Analysis 9.5
    Guild Companies:  The All-Everything Operating System, by Brian Kelly, Price $35
    CCSS:  Achieving Lights Out Automation in an IBM i environment. Get the Best Practice guide

    IT Jungle Store Top Book Picks

    BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The iSeries Pocket Database Guide: List Price, $59
    The iSeries Pocket SQL Guide: List Price, $59
    The iSeries Pocket WebFacing Primer: List Price, $39
    Migrating to WebSphere Express for iSeries: List Price, $49
    Getting Started with WebSphere Express for iSeries: List Price, $49
    The All-Everything Operating System: List Price, $35
    The Best Joomla! Tutorial Ever!: List Price, $19.95

    IBM Updates Software Inventory and Usage Tool Control Your Code, Control Your Costs And Destiny

    Leave a Reply Cancel reply

Volume 12, Number 1 -- January 11, 2012
THIS ISSUE SPONSORED BY:

WorksRight Software
ProData Computer Services
Twin Data Corporation

Table of Contents

  • New in DB2 for i 7.1: Use Global Variables to Track Environment Settings
  • IBM i and Zip Files
  • Admin Alert: Is It a Performance Issue or a Throughput Issue?

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Positive News From The Kyndryl Mainframe Modernization Report
  • NAViGATE, inPower 2025 On Tap for September 2025
  • Guru: WCA4i And Granite – Because You’ve Got Bigger Things To Build
  • As I See It: Digital Coup
  • IBM i PTF Guide, Volume 27, Number 37
  • AI Is Coming for ERP. How Will IBM i Respond?
  • The Power And Storage Price Wiggling Continues – Again
  • LaserVault Adds Multi-Path Support To ViTL
  • As I See It: Spacing Out
  • IBM i PTF Guide, Volume 27, Numbers 34, 35, And 36

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle