OpenVMS Notes: ZIP and UNZIP

  1. The information presented here is intended for educational use by qualified OpenVMS technologists.
  2. The information presented here is provided free of charge, as-is, with no warranty of any kind.
Edit: 2023-05-30 (removed some broken links)

Introduction

There are lots of better websites documenting problems using UNZIP on VMS so I will not attempt to reproduce that work here. Like most of my other published stuff, I am going to explain something that just (2012-07-09) happened to me. Maybe this information can help one other poor devil who ended up here via Google :-)

Strange things after downloading a zipped file from HP

Experiment:

legend: <sr> = system response
        <ur> = user response
-------------------------------------------------
<sr> $
<ur> unzip DEC-AXPVMS-GNV-V0201-003-1.ZIP
<sr> bla...bla...bla...
     $
<ur> unzip DEC-AXPVMS-GNV-V0300-001-1.ZIP
<sr> bla...bla...bla...
     $
<ur> product list gnv
<sr>
	1 - DEC AXPVMS GNV V3.0-1               Layered Product
	2 - DEC AXPVMS GNV V2.1-3               Layered Product
	? - Help
	E - Exit
 
     Choose one or more items from the menu:
<ur> 1
<sr> Performing product kit validation of signed kits ...
 
     %PCSI-E-VALFAILED, validation of KAWC99$DRA1:[CSMIS.USR.][ADMCSM.NEIL]DEC-AXPVMS-GNV-V0300-001-1.PCSI$COMPRESSED;1 failed
     -PCSI-E-HPC_TEXT, validate_finalize: Verification of signed file failed
     %PCSIUI-E-ABORT, operation terminated due to an unrecoverable error condition
     $
<ur> product list gnv
<sr>
	1 - DEC AXPVMS GNV V3.0-1               Layered Product
	2 - DEC AXPVMS GNV V2.1-3               Layered Product
	? - Help
	E - Exit
 
     Choose one or more items from the menu:
<ur> 2
<sr> Performing product kit validation of signed kits ...
     %PCSI-I-ESWVALPASSED, validation of KAWC99$DRA1:[CSMIS.USR.][ADMCSM.NEIL]dec-axpvms-gnv-v0201-003-1.pcsi$compressed;1 succeeded
 
     The following product has been selected:
	DEC AXPVMS GNV V2.1-3                  Layered Product
 
	Do you want to continue? [YES]
<ur> <enter>
<sr> KAWC99$DRA1:[CSMIS.USR.][ADMCSM.NEIL]dec-axpvms-gnv-v0201-003-1.pcsi$compressed;1
	 Format:   Compressed
	 Kit Size: 86272 blocks and 144128 blocks when decompressed
	 Manifest: Kit indicates that a manifest file was created for it
		   Associated manifest file was used to successfully validate kit
 
     --------------------------------------------------------------------------------
     CONTENTS OF KIT USING RELATIVE FILE SPECIFICATION
     --------------------------------------------------------------------------------
     [000000]DEC-AXPVMS-GNV-v0201-003-1.PCSI$TLB
     [...snip...]
     $
<sr> $
<ur> dir *.pcsi$compressed;*/full
<sr> Directory CSMIS$USER3:[ADMCSM.NEIL]

     dec-axpvms-gnv-v0201-003-1.pcsi$compressed;1                  File ID:  (13852,26,0)          
     Size:        86272/86272      Owner:    [NEIL]
     Created:     5-NOV-2009 15:54:08.00
     Revised:     5-NOV-2009 15:54:08.00 (0)
     Expires:    <None specified>
     Backup:     <No backup recorded>
     Effective:  <None specified>
     Recording:  <None specified>
     Accessed:    9-JUL-2012 18:43:27.51
     Attributes:  5-NOV-2009 15:54:08.00
     Modified:    5-NOV-2009 15:54:08.00
     Linkcount:  1
     File organization:  Sequential
     Shelved state:      Online 
     Caching attribute:  Writethrough
     File attributes:    Allocation: 86272, Extend: 16384, Global buffer count: 0, No version limit
     Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes
     Record attributes:  Carriage return carriage control
     RMS attributes:     None
     Journaling enabled: None
     File protection:    System:RWED, Owner:RWED, Group:, World:RWED
     Access Cntrl List:  None
     Client attributes:  None

     DEC-AXPVMS-GNV-V0300-001-1.PCSI$COMPRESSED;1                  File ID:  (745,717,0)           
     Size:       393450/393456     Owner:    [NEIL]
     Created:    18-NOV-2011 15:10:00.00
     Revised:    18-NOV-2011 15:10:00.00 (0)
     Expires:    <None specified>
     Backup:     <No backup recorded>
     Effective:  <None specified>
     Recording:  <None specified>
     Accessed:    9-JUL-2012 18:42:07.72
     Attributes: 18-NOV-2011 15:10:00.00
     Modified:   18-NOV-2011 15:10:00.00
     Linkcount:  1
     File organization:  Sequential
     Shelved state:      Online 
     Caching attribute:  Writethrough
     File attributes:    Allocation: 393456, Extend: 16384, Global buffer count: 0, No version limit
     Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes
     Record attributes:  Carriage return carriage control
     RMS attributes:     None
     Journaling enabled: None
     File protection:    System:RWED, Owner:RWED, Group:RE, World:
     Access Cntrl List:  None
     Client attributes:  None
	
     Total of 2 files, 479722/479728 blocks.
     $
We now have three alternatives:
1) A little hacking proves these files can be installed as-is but without kit validation (not recommended)
prod inst gnv /option=novalid
2) HP says the files can be repaired like so:
set file/attribute=(rfm:fix,lrl:512,mrs:512,org:seq,rat:none) DEC-AXPVMS-GNV-V0300-001-1.PCSI$COMPRESSED
3) But what about changes to how we UNZIP?

How UNZIP is supposed to be used on VMS (and OpenVMS)

Real-world Experiments

VMS Rules:

Consider the following examples:
Analyze (via the DIR/FULL command) all the BASIC (text) source files here
<sr> $
<ur> dir *.*/col=1							! display all files here
<sr> Directory CSMIS$ROOT3:[DVLP.YADA]

     float_demo_a.bas;1 
     float_demo_b.bas;1 
     folding_time_100.bas;1
     olivaw_100.bas;1   
     olivaw_101.bas;1   
     olivaw_102.bas;1   

     Total of 6 files.
     $
<ur> pipe dir/ful *.* | search sys$input "record ",".bas"		! see how they are encoded
<sr> float_demo_a.bas;1            File ID:  (1106,10,0)           
     Record format:      Variable length, maximum 255 bytes, longest 75 bytes
     Record attributes:  Carriage return carriage control
     float_demo_b.bas;1            File ID:  (1387,684,0)          
     Record format:      Variable length, maximum 255 bytes, longest 75 bytes
     Record attributes:  Carriage return carriage control
     folding_time_100.bas;1                    File ID:  (1419,560,0)          
     Record format:      Variable length, maximum 255 bytes, longest 122 bytes
     Record attributes:  Carriage return carriage control
     olivaw_100.bas;1              File ID:  (1495,319,0)          
     Record format:      Variable length, maximum 255 bytes, longest 73 bytes
     Record attributes:  Carriage return carriage control
     olivaw_101.bas;1              File ID:  (1561,996,0)          
     Record format:      Variable length, maximum 255 bytes, longest 123 bytes
     Record attributes:  Carriage return carriage control
     olivaw_102.bas;1              File ID:  (1655,247,0)          
     Record format:      Variable length, maximum 255 bytes, longest 123 bytes
     Record attributes:  Carriage return carriage control
     $
Create two (slightly different) zip files  
<ur> zip archive1.zip *.bas						! create a zip (using no switches)
<sr>   adding: FLOAT_DEMO_A.BAS (deflated 68%)
       adding: FLOAT_DEMO_B.BAS (deflated 68%)
       adding: FOLDING_TIME_100.BAS (deflated 68%)
       adding: OLIVAW_100.BAS (deflated 66%)
       adding: OLIVAW_101.BAS (deflated 71%)
       adding: OLIVAW_102.BAS (deflated 71%)
     $
<ur> zip "-V" archive2.zip *.bas					! create a zip using the -V switch
<sr>   adding: FLOAT_DEMO_A.BAS (deflated 66%)
       adding: FLOAT_DEMO_B.BAS (deflated 66%)
       adding: FOLDING_TIME_100.BAS (deflated 65%)
       adding: OLIVAW_100.BAS (deflated 63%)
       adding: OLIVAW_101.BAS (deflated 68%)
       adding: OLIVAW_102.BAS (deflated 68%)
     $
See how the data was archived (twice)
<ur> unzip "-Z" archive1.zip     					! get details of archive1
<sr> Archive:  CSMIS$ROOT3:[DVLP.YADA]ARCHIVE1.ZIP;1
     Zip file size: 6849 bytes, number of entries: 6
     RWED,RWED,RWED  vms     1522 t- defN 11-Feb-01 08:03 float_demo_a.bas
     RWED,RWED,RWED  vms     1602 t- defN 11-Feb-02 08:34 float_demo_b.bas
     RWED,RWED,RWED  vms     1663 t- defN 10-Sep-28 18:59 folding_time_100.bas
     RWED,RWED,RWED  vms     3466 t- defN 10-Sep-22 11:27 olivaw_100.bas
     RWED,RWED,RWED  vms     6045 t- defN 10-Sep-22 12:17 olivaw_101.bas
     RWED,RWED,RWED  vms     6141 t- defN 10-Sep-22 12:22 olivaw_102.bas
     6 files, 20439 bytes uncompressed, 6183 bytes compressed:  69.7%
     $
<ur> unzip "-Z" archive2.zip						! get details of archive2 
<sr> Archive:  CSMIS$ROOT3:[DVLP.YADA]ARCHIVE2.ZIP;1
     Zip file size: 9406 bytes, number of entries: 6
     RWED,RWED,RWED  vms     1582 bx defN 11-Feb-01 08:03 float_demo_a.bas
     RWED,RWED,RWED  vms     1662 bx defN 11-Feb-02 08:34 float_demo_b.bas
     RWED,RWED,RWED  vms     1754 bx defN 10-Sep-28 18:59 folding_time_100.bas
     RWED,RWED,RWED  vms     3660 bx defN 10-Sep-22 11:27 olivaw_100.bas
     RWED,RWED,RWED  vms     6320 bx defN 10-Sep-22 12:17 olivaw_101.bas
     RWED,RWED,RWED  vms     6420 bx defN 10-Sep-22 12:22 olivaw_102.bas
     6 files, 21398 bytes uncompressed, 7168 bytes compressed:  66.5%
     $
Now unzip archive #1 then inspect the resultant files
<ur> unzip      archive1.zip						! unzip archive1
<sr>	Archive:  CSMIS$ROOT3:[DVLP.YADA]ARCHIVE1.ZIP;1
	new version of float_demo_a.bas? [y]es, [n]o, [A]ll, [N]one, [r]ename:
<ur> A
<sr>	  inflating: float_demo_a.bas        
	  inflating: float_demo_b.bas        
	  inflating: folding_time_100.bas    
	  inflating: olivaw_100.bas          
	  inflating: olivaw_101.bas          
	  inflating: olivaw_102.bas          
	$
<ur> pipe dir/ful *.*;/exc=*.zip | search sys$input "record ",".bas"	! view the results
<sr> float_demo_a.bas;2            File ID:  (1238,1233,0)         
     Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes
     Record attributes:  Carriage return carriage control
     float_demo_b.bas;2            File ID:  (1770,173,0)          
     Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes
     Record attributes:  Carriage return carriage control
     folding_time_100.bas;2                    File ID:  (1935,558,0)          
     Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes
     Record attributes:  Carriage return carriage control
     olivaw_100.bas;2              File ID:  (2217,1397,0)         
     Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes
     Record attributes:  Carriage return carriage control
     olivaw_101.bas;2              File ID:  (2238,30,0)           
     Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes
     Record attributes:  Carriage return carriage control
     olivaw_102.bas;2              File ID:  (2239,29,0)           
     Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes
     Record attributes:  Carriage return carriage control
     $
Now unzip archive #2 (twice) inspect the resultant files each time
<ur> unzip      archive2.zip						! unzip archive 2
<sr> Archive:  CSMIS$ROOT3:[DVLP.YADA]ARCHIVE2.ZIP;1
     new version of float_demo_a.bas? [y]es, [n]o, [A]ll, [N]one, [r]ename:
<ur> A
<sr>   inflating: float_demo_a.bas        
       inflating: float_demo_b.bas        
       inflating: folding_time_100.bas    
       inflating: olivaw_100.bas          
       inflating: olivaw_101.bas          
       inflating: olivaw_102.bas          
     $
<ur> pipe dir/ful *.*;/exc=*.zip | search sys$input "record ",".bas"	! view the results
<sr> float_demo_a.bas;3            File ID:  (2240,17,0)           
     Record format:      Variable length, maximum 255 bytes, longest 75 bytes
     Record attributes:  Carriage return carriage control
     float_demo_b.bas;3            File ID:  (2247,24,0)           
     Record format:      Variable length, maximum 255 bytes, longest 75 bytes
     Record attributes:  Carriage return carriage control
     folding_time_100.bas;3                    File ID:  (2253,17,0)           
     Record format:      Variable length, maximum 255 bytes, longest 122 bytes
     Record attributes:  Carriage return carriage control
     olivaw_100.bas;3              File ID:  (2255,455,0)          
     Record format:      Variable length, maximum 255 bytes, longest 73 bytes
     Record attributes:  Carriage return carriage control
     olivaw_101.bas;3              File ID:  (2260,18,0)           
     Record format:      Variable length, maximum 255 bytes, longest 123 bytes
     Record attributes:  Carriage return carriage control
     olivaw_102.bas;3              File ID:  (2270,16,0)           
     Record format:      Variable length, maximum 255 bytes, longest 123 bytes
     Record attributes:  Carriage return carriage control
     $
<ur> unzip   -b archive2.zip						! unzip archive2 (again) using -b
<sr> Archive:  CSMIS$ROOT3:[DVLP.YADA]ARCHIVE2.ZIP;1
     new version of float_demo_a.bas? [y]es, [n]o, [A]ll, [N]one, [r]ename:
<ur> A
<sr>   inflating: float_demo_a.bas        
       inflating: float_demo_b.bas        
       inflating: folding_time_100.bas    
       inflating: olivaw_100.bas          
       inflating: olivaw_101.bas          
       inflating: olivaw_102.bas          
     $
<ur> pipe dir/ful *.*;/exc=*.zip | search sys$input "record ",".bas"	! view the results
<sr> float_demo_a.bas;4            File ID:  (2271,18,0)           
     Record format:      Variable length, maximum 255 bytes, longest 75 bytes
     Record attributes:  Carriage return carriage control
     float_demo_b.bas;4            File ID:  (2277,27,0)           
     Record format:      Variable length, maximum 255 bytes, longest 75 bytes
     Record attributes:  Carriage return carriage control
     folding_time_100.bas;4                    File ID:  (2282,17,0)           
     Record format:      Variable length, maximum 255 bytes, longest 122 bytes
     Record attributes:  Carriage return carriage control
     olivaw_100.bas;4              File ID:  (2283,25,0)           
     Record format:      Variable length, maximum 255 bytes, longest 73 bytes
     Record attributes:  Carriage return carriage control
     olivaw_101.bas;4              File ID:  (2292,39,0)           
     Record format:      Variable length, maximum 255 bytes, longest 123 bytes
     Record attributes:  Carriage return carriage control
     olivaw_102.bas;4              File ID:  (2303,22,0)           
     Record format:      Variable length, maximum 255 bytes, longest 123 bytes
     Record attributes:  Carriage return carriage control
     $ 

Advice for VMS users

Compression of large save-sets

gzip examples for OpenVMS

compression example #1

	$ gzip onuadmin.sql

		1. creates onuadmin.sql-gz
		2. deletes the original file (might not be what you want)

compression example #2

	$ def/user sys$output onuadmin.sql-gz
	$ gzip -c onuadmin.sql

		1. creates onuadmin.sql-gz
		2. does not delete the original file

decompress example #1

	$ gzip -d onuadmin.sql-gz

		1. creates onuadmin.sql
		2. deletes the original file (might not be what you want)

decompress example #2

	$ def/user sys$output whatever.sql
	$ gzip -cd onuadmin.sql-gz

		1. creates whatever.sql
		2. does not delete the original file

Back to Home
Neil Rieck
Waterloo, Ontario, Canada.