iSeries home   |   Easy400     |   CGIDEV2     |   MMAIL  
Public Source
 
  Introduction
 
  Commands:
zipsave
dspzipsave
unzipsave
 
 Download
 
 

 
Command UNZIPSAVE

Use this command to unzip on iSeries any zip stream file, including those generated from command ZIPSAVE. "Inflated" (decompressed files) are made available in the /home directory for the job user. Example: /home/JUDY , where JUDY is the job user profile.
If this directory does not exist, it is automatically created.

Upon user selection the uncompress operation is supported

  • either by the QShell command JAR (Java ARchive)
  • or by CL command CPYFRMARCF (Copy from Archive File) available on IBMi from release V7R2 on.

Note: If submitting this command to batch execution, be sure to specify JOBQ(QSYSNOMAX) in the SUBMIT command.

About CCSIDs - Zipped 'file data' always maintains its original CCSID, though the 'file' CCSID may be changed by the zip tool. As an example, ZIPSAVE tool always assigns a CCSID 819 (ASCII) to zipped 'files'.
The unzip tools may behave in a different way:

  • Qshell Jar keeps, on the uncompressed 'file' the CCSID found in the compressed file (data CCSID is never changed)
  • CL command CPYFRMARCF assigns to an inflated 'file' the job CCSID (example: 37).
While a mismatch between the 'file' CCSID and the 'file data' CCSID is usually not a problem for save stream files when it is copied in binary mode to a save file object, this mismatch may become a problem when trying to use other (example: text) stream files.
To reset the original CCSID (example: 37) you may use command CHGATR. Example:
    CHGATR OBJ('/home/judy/readme.txt') ATR(*CCSID) VALUE(37)

Command parameters

                       Unzip a ZIP stream file (UNZIPSAVE)
                
 Type choices, press Enter.
                                                    
 ZIP stream file  . . . . . . . . ZIPFILE     /tmp/xxx.zip                          
                           
 UNZIP tool . . . . . . . . . . . UNZIPTOOL   *JAR          *JAR, *CPYFRMARCF
 Zipped Savf stream file  . . . . SAVFSTMF    ABC.SAVF                              
                           
 Load the save file . . . . . . . LOADSAVF    *YES          *YES, *NO
 Save file library  . . . . . . . SAVFLIB     QGPL          name
 Display the loaded save file . . DSPSAVF     *NO           *YES, *NO
 Output messages  . . . . . . . . OUTPUT      *             *, *PRINT, *NONE
 Display home directory . . . . . DSPHOMEDIR  *YES          *YES, *NO
Note 1 - To input appropriate data in parameters SAVSTMF and READMESTMF, you may need to display the contents of the ZIPFILE by using command DSPZIPSAVE.

  • ZIP stream file (ZIPFILE)
    This is the qualified name (path and name) of a zip stream file containing the zipped (compressed) files that you want to unzip (inflate).
  • UNZIP tool (UNZIPTOOL)
    The tool that will be used to inflate the compressed files contained in the zip file. Two tools are available:
    1. *JAR - The Qshell command 'Jar'. Jar is available on any OS release.
      Files are expandedin the current directory.
      Command UNZIPSAVE temporarily sets the current directory as the user home directory.
    2. *CPYFRMARCF (Copy from Archive File) - This is a CL command available since OS release V7R2.
      It inflates the zipped files into a directory specified in a parameter of the command. Within UNZIPSAVE it is used to inflate zipped files into the user home directory.
  • Zipped Savf stream file (SAVSTMF) - This is exactly the name of a save stream file - compressed into ZIPFILE - that will be inflated in the user home directory. Example: 'MYLIB.SAVF', the save file of library MYLIB.
    Note 2 - A name mismatch will cause the failure of the save file load process.
    Enter *NONE if in the zip stream file there is no compressed save file, or if you do not want to process it after it has been decompressed.
  • Load the save file (LOADSAVF) -
    This parameter is available only when a save file name is specified in parameter SAVFSTMF.
    Specify *YES if you want the save file stream file be copied to a save file with the same name.
    Its library name must be specified in parameter SAVFLIB (the next parameter)
    . If such a save files does not exist in that library, it is automatically created.
    Note - If you specify LOADSAVF(*YES), the save stream file in the user home directory is deleted once it has been copied to the save file.
  • Save file library (SAVFLIB) -
    This parameter is available only when LOADSAVF(*YES).
    Enter the name of the library for the save file that will receive the inflated save file data. Examples: QTEMP, QGPL, ...
  • Display the inflated save file (DSPSAVF) -
    This parameter is available only when LOADSAVF(*YES)
    Enter *YES to display the resulting save file once it has been filled in.
  • Output messages (OUTPUT) -
    This parameter is available only when UNZIPTOOL(*JAR)
    How the Qshell "jar" output messages - created when Jar inflates the zipped stream file into a stream file in the user home directory - should be displayed.
    Select one of the following:
    • * - If the command is running in an interactive job, display output messages on the screen, otherwise display them on a printout named JAROUT.
    • *PRINT - Display output messages on a printout named JAROUT.
    • *NONE - Do not display output messages.
  • Display home directory (DSPHOMEDIR) - Whether the job user home directory will be displayed at the end of the process.
    This parameter is ignored in a batch job.

Examples

  1. UNZIPSAVE ZIPFILE('/myzip.zip') ZIPTOOL(...)
    This causes the zipped files - contained in the ZIPFILE - be unzipped (expanded) in the current directory (home directory of the user profile)
  2. UNZIPSAVE ZIPFILE('/myzip.zip') ZIPTOOL(...) DSPHOMEDIR(*YES)
    Same as the previous case, but now the job user home directory is displayed after the unzip operation.
  3. UNZIPSAVE ZIPFILE('/myzip.zip') ZIPTOOL(...) SAVFSTMF('/mylib.savf') LOADSAVF(*YES) SAVFLIB(QGPL) DSPSAVF(*YES) OUTPUT(*)
    The zipped files are unzipped (expanded) in the job user home directory. Next, the expanded save stream file 'mylib.savf' is copied from the current IFS directory to save file QGPL/MYLIB. Last, save file QGPL/MYLIB is displayed.




previous page Previous page