Easy400    |     IBM System i home    | 
Public-Source
 
About it
PKLIB walkthrough
ZIPSAVE & UNZIPSAVE commands

Download
 
 
 

ZIPSAVE & UNZIPSAVE commands

The following commands in library EZPACK take advantage from some commands available in the IBM i QSHELL environment.
In order to avoid excessive CPU load in the interactive subsystem, the execution of QSHELL commands is done by jobs submitted to batch and synchronized with the submitting job.

1. Command ZIPSAVE
2. Command DSPZIPSAVE
3. Command UNZIPSAVE

 

1. Command ZIPSAVE

This command allows to perform a SAVLIB / SAVOBJ / SAV command and to compress the resulting save file, along with an optional "readme" stream file, into a standard "zip" file.

In this command some parameters depend on the value chosen for parameter SAVETYPE.
The next figure shows the case where SAVETYPE(*SAVLIB).

                              Save & Zip (ZIPSAVE)                              
                                                                                
 Type choices, press Enter.                                                     
                                                                                
 ZIP stream file  . . . . . . . . ZIPFILE                                               
      
 README stream file . . . . . . . README    *NONE                                       
      
 Type of save . . . . . . . . . . SAVETYPE  *SAVLIB       *SAVLIB, *SAVOBJ, *SAV        
 Library  . . . . . . . . . . . . LIB                     Name                          
 Save file data . . . . . . . . . SAVFDTA   *NO           *YES, *NO                     
                                                                                
                            Additional Parameters                               
                                                                                
 Target release . . . . . . . . . TGTRLS    *CURRENT      Character value               
 Execute in verbose mode  . . . . VERBOSE   *NO           *YES, *NO
 
                                                                                
                                                                         Bottom 
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 F24=More keys                                                                  
Figure 1 - Command EZPACK/ZIPSAVE
  • ZIPFILE - ZIP stream file - Enter the qualified name (path and name) of the stream file that will contain the compressed (zipped) files.
    This stream file, if already existing, is deleted and re-created.
    A .zip extension is recommended.
    The zip stream file will contain two compressed stream files:
    1. The readme file (if specified)
    2. A save file resulting from a SAVLIB, SAVOBJ or SAV operation (see the following parameters).
    The readme and the save file will be assigned the same name, but different extensions: .txt for the readme file, .savf for the save file.
  • README - Readme stream file - If specified, this is the qualified name (path and name) of a stream file containing a text with the installation instructions for the save file.
    For such a document a .txt extension is recommended, so that no special utility is required to display it.
    Note: If this text is a source file member, you can specify it by using the IFS syntax, example:
    '/qsys.lib/library_name.lib/file_name.lib/member_name.mbr'
    Note: The readme file, when packaged into the zip file, will be renamed to the same name of the save file, with a .txt extension.
  • SAVETYPE - Type of save - This parameter establishes the type of save that is going to be requested. Select:
    • *SAVLIB to run the SAVLIB command
    • *SAVOBJ to run the SAVOBJ command
    • *SAV to run the SAV command (save of IFS objects)
    Note: Not all the parameters of the select save command are supported. Only some basic parameters are prompted.
  • TGTRLS - Target release - Specifies the release of the operating system on which you intend to restore and use the object(s).
    VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level.
    For example, V5R3M0 is version 5, release 3, modification 0.
  • VERBOSE - Execute in verbose mode - The compression of the readme and the save files into a .zip stream file is performed by the jar utility within a QShell session, which is just started and ended for running the jar utility. Verbose is a parameter of the jar utility used to obtain detail messages about the actions performed. When this parameter is specified and the execution is interactive, the QShell terminal session is shown and you are displayed the jar verbose messages. As soon as the jar utility completes, you are asked to press the Enter key to end the Qshell terminal session.

 

2. Command DSPZIPSAVE

This command displays the names of the files contained in a zip stream file.
The zip file does not have to have been generated from command ZIPSAVE, it could for instance have been created on a PC.

The display is done by submitting a batch job that starts a QShell session and invokes the jar (Java Archive) utility to output to a spool file the table of contents of the zip stream file. As soon as the batch job is over, the program of DSPZIPSAVE command displays such a spool file.

                     Contents of a ZIPSAVE stmf (DSPZIPSAVE)                    
                                                                                
 Type choices, press Enter.                                                     
                                                                                
 Zip stream file  . . . . . . . . ZIPFILE                                               
      
 Execute in verbose mode  . . . . VERBOSE   *NO           *YES, *NO

                                                                         Bottom
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 F24=More keys                                                                  
Figure 2 - Command EZPACK/DSPZIPSAVE
  • ZIPFILE - ZIP stream file - The qualified name (path and name) of a zip stream file.
  • VERBOSE - Execute in verbose mode - Verbose is a parameter of the jar utility. When specified, the jar utility provides some supplementary information.
    Select one of the following:
    • *NO - To list only the names of the files contained in the zipfile.
    • *YES - To list not only the names of the files contained in the zip file, but also their sizes before compression and their creation timestamps.

 

3. Command UNZIPSAVE

This command extracts and inflates the files previously compressed into a zip stream file created with command ZIPSAVE.
You may use command DSPZIPSAVE to display the table of contents of a zip stream file created with command ZIPSAVE.

Generally, a ZIPSAVed stream file contains two compressed files, with the same name but different extensions:

  1. A xxxxxx.txt text stream file, containing some installation instructions.
  2. A xxxxxx.savf binary save stream file.
Command UNZIPSAVE expands both files in the IFS directory specified in parameter TGTDIR.

                       Unzip a ZIP stream file (UNZIPSAVE)                     
                                                                               
 Type choices, press Enter.

 ZIP stream file  . . . . . . . . ZIPFILE                                                
      
 Target directory . . . . . . . . TGTDIR      *CURRENT                                   
      
 Zipped Readme stream file  . . . READMESTMF  *NONE                                      
      
 Zipped Savf stream file  . . . . SAVFSTMF    *NONE                                      
                                                                        
 Display the target directory . . DSPTGTDIR   *NO           *BEFORE, *AFTER, *BEFAFT, *NO
 Display the README stream file   DSPREADME   *NO           *YES, *NO
 Load the save file . . . . . . . LOADSAVF    *NO           *YES, *NO

                            Additional Parameters

 Execute in verbose mode  . . . . VERBOSE     *NO           *NO, *YES

                                                                         Bottom
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display
 F24=More keys
Figure 3 - Command EZPACK/UNZIPSAVE
  • ZIPFILE - ZIP stream file - Qualified name (path and name) of a zip stream file created with command ZIPSAVE.
  • TGTDIR - Target directory - This is the IFS directory where the zipped files should be expanded.
    • Leave *CURDIR to mean the current IFS directory - the one that is displayed when you run command WRKLNK OBJ('*')
    • or specify another IFS directory you would like the expanded files to go.
  • READMESTMF - Zipped Readme stream file - Name of the zipped Readme stream file, as shown by command DSPZIPSAVE.
    Enter *NONE if there is no zipped readme stream file, or if you do not want to process it.
  • SAVFSTMF - Zipped Savf stream file - Name of the zipped Savf stream file, as shown by command DSPZIPSAVE.
    Enter *NONE if there is no zipped savf stream file, or if you do not want to process it.
  • DSPTGTDIR - Display the target directory - Select one of the following:
    • *BEFORE - To display the target directory before that the decompression takes place.
    • *AFTER - To display the target directory after that the decompression is performed.
    • *BEFAFT - To display the target directory before and after the decompression.
    • *NO - Not to display the target directory.
  • DSPREADME - Display the Readme stream file - If you enter *YES for this parameter, and the readme file exists, then it is displayed when the decompression is over.
  • LOADSAVF - Load the save file - Specify *YES if you want the save file stream file be copied to a save file in library QGPL.
    If this save file does not yet exist in library QGPL, it is created.
  • DSPSAVF - Display the inflated save file - Enter *YES to display the resulting QGPL save file when the decompression is over.
  • VERBOSE - Execute in verbose mode - Verbose is a parameter of the jar utility. When specified, the jar utility provides some supplementary information.
    Select one of the following:
    • *NO - To list only the names of the files contained in the zipfile.
    • *YES - To list not only the names of the files contained in the zip file, but also their sizes before compression and their creation timestamps.