%ì VAX-11 Librarian V04-003gG%—£pœÁ}(—;;$$À5 COMPRESS:¸ DECOMPRESS­Ã=sÁ}(— 1 COMPRESSC The COMPRESS command invokes a utility to copy a file, generatingiB a file with (usually) fewer bytes. Files compressed by COMPRESS are recovered by DECOMPRESS.- COMPRESS Input-file-spec Output-file-speci 2 Parametere Input-file-spec? Specifies the name of the file to be compressed. If you havet@ specified /EXPORT=VMS mode, the file must be stored on a disk. Output-file-speco5 Specifies the name of the file created by COMPRESS. 2 Qu alifiersB Indicate special actions to be performed by the COMPRESS utility< or special properties of either the input or output files.) Qualifiers apply to the entire process..@ The following list shows all the qualifiers available with the COMPRESS command:d o /BITS=value o /EXPORT=(option,...)h o /METHOD=optionp o /MODE=(option,...) o /SHOW=(option,...)e2 /BITSa /BITS=value= This specifies the maximum number of bits to be used in thet? compre ssion. It implicitly controls both the "quality" of theB compression (more bits means more compression) and the amount ofA memory needed for both compression and decompression (more bits B requires more memory). If the compressed file is to be read by aC computer with limited memory (such as a PDP-11), choose /BITS=12,r? else leave BITS at its default of 16. The minimum value is 9m and the maximum value is 16. 2 /EXPORTN /EXPORT=(option, [,...])p@ Export controls the format of the output file. You can select the following:A VMS (D) Write a file that can only be read by VMSr! COMPRESS.,C UNIX Write a format that can be read by programseB compatible with the Unix compress utility.@ [NO]ENDMARKER Write a special file endmarker after the* data if specified.C [NO]BLOCK Monitor compression and reinitialize if thee7 qualit y decreases if specified.E@ [NO]HEADER Write a file header with information for0 DECOMPRESS if specified.C In general, use /EXPORT=VMS for compression where the result willtC be decompressed on a VMS system and /EXPORT=UNIX where the result/C will be decompressed on a Unix, RSX-11M, RSTS/E, or other non-VMSaD system. If /EXPORT=UNIX is specified, BLOCK, HEADER, or ENDMARKER; may be negated to further qualify the output file format.r3 VMSR? Sp ecifies output in VMS ("private") mode. In addition to thebB contents of the file itself, the "File definition block" is alsoB compressed. The decompression utility can thus recreate the fileA exactly (including ISAM indexes). This is the default, and thel! recommended mode for most uses.U3 UNIX@ Specifies an output format compatible with Unix compress v3.0.C This allows transmitting sequential files to non-VMS systems thatf? support a compress-compatible utility. If you have specifiedyB /EXPORT=UNIX, the utility can be configured for variants of UnixA compress by negating BLOCK, HEADER, and/or ENDMARKER as needed."@ Notice that file attributes are not preserved by /EXPORT=UNIX.3 BLOCKeA Selects an algorithm whereby COMPRESS evaluates its performance@ and re-initializes the compression tables whenever performance@ degrades. Older versions of Unix compress do not support this9 capability. If negated, ENDMARKER must also be negated.T3 HEADER? If n .egated, COMPRESS does not write a header record. This is ? for compatiblity with very old versions of Unix compress. If 4 negated, BLOCK and ENDMARKER must also be negated. 3 ENDMARKERgC If specified, a special "endmark" is written after the end of thenD file. This is necessary if the file is to be decompressed on RT11D or other systems that require the last block of a file to fill the@ last block. On the other hand, some versions of Unix compressA cannot understand the "extra" ies the name of the file created by COMPRESS. If the file? was compressed by /EXPORT=VMS, the original file name will bey< used if the Output file spec. is omitted. If the file wasB compressed by /EXPORT=UNIX and no Output file spec. is provided,) the file will be written to SYS$OUTPUT:f2 Command_QualifiersB Indicate special actions to be performed by the COMPRESS utility< or special properties of either the input or output files.) Qualifiers apply to the entire process.S@ The following list shows all the qualifiers available with the DECOMPRESS command:r o /BITS=value o /EXPORT=(option,...)  o /METHOD=optionp o /MODE=(option,...) o /SHOW=(option,...)s2 /BITSa /BITS=valueA If a header was not provided, this specifies the maximum numberT? of bits that were used in the compression. This parameter iso3 ignored if the compressed file contains a header.e 2 /EXPORTe /EXPORT=(option, [,...])f@ Export describes the format of the input file. You can select the following:= VMS (D) The file was created by VMS COMPRESS.o= UNIX The file was created by Unix compress( or a compatible program.eB compatible with the Unix compress utility.B [NO]ENDMARKER A special file endmarker follows the data.C [NO]BLOCK The compress program may have reinitializeda compression.EA [NO]HEADER The compress program wrote its parameterso  into a file header.A In general, the program can determine the proper value of theset> flags by reading the first few bytes of the file. If valid,; the file header overrides the command line specification.pA Generally, this option is needed only if you are trying to read = a file generated by a version of Unix compress that did notr? write a header. See the description of COMPRESS for details.C 2 /METHOD  /METHOD=(option) B This specifies the particular compression algorithm. Currently, only /METHOD=LZW is supported.3 LZW 1 Use the Lempel-Ziv-Welch compression algorithm. 2 /MODEP /MODE=(option).< This allows specification of variations on the output file: format. These values will be taken from the source file' description if /EXPORT=VMS is chosen.s3 BINARYB This creates the file in "binary" mode, rather than "text" mode.A It is ignored if COMPRESS created the file in /EXPORT=VMS mode.u< The output file will be created in RMS "Stream-LF" format.3 DELTAr? Compress used the difference between successive bytes, rather,? than the bytes themselves. For certain file formats, such ass= bit-mapped graphics, this may yield a 10-15% improvement inAC compressibility. This is not compatible with some implementationss> of Unix compress. This value is normally read from the file< header, and generally need not be specified by DECOMPRESS.3 FIXEDn2 Create the file in "fixed-length-record" format.; This is probably the best format to use for decompressinga7 binary files (such as tar archives) created on Unix.i; The record size can be specified with this keyword, as ini /MODE=(FIXED=recsiz)r: If no size is specified, then a value of 512 is assumed.3 TEXT? Create the file in "variable-length carriage-control" format.n; This is appropriate for decompressing readable text filesU created by Unix compress.h2 /SHOWi /SHOW=(option, [,...])ED Display information about the compression. If omitted, DECOMPRESS0 operates silently (except for error messages).3 ALLe/ Equivalent to /SHOW=(PROGRESS,STATISTICS,FDL), 3 PROGRESSB Print status messages at intervals, showing the operation of the program. 3 STATISTICS+ Print a report at the end of the process.a3 FDL C Dump the File Definition Language block that describes the outputh file.o3 DEBUGe' Print internal debugging information. 3 DEBUG_SERIOUS , Print more internal debugging information. 3 DEBUG_IO Dump the input file, too.e2 Unix+ Is a trademark of AT&T Bell Laboratories.fww A)? version of Unix compress that handles endmarkers correctly ise available. 2 /METHODr /METHOD=(option) B This specifies the particular compression algorithm. Currently, only /METHOD=LZW is supported.3 LZWh1 Use the Lempel-Ziv-Welch compression algorithm. 2 /MODEi /MODE=(option)D This allows specification of variations on the compression method.3 BINARY@ This opens the file in "binary" mode, rather than "text" mode.) It is ignored if /EXPORT=VMS is chosen.l3 DELTAsC Compress the difference between successive bytes, rather than the>A bytes themselves. For certain file formats, such as bit-mappedC graphics, this may yield a 10-15% improvement in compressibility. D This is not compatible with some implementations of Unix compress.2 /SHOWo /SHOW=(option, [,...])dB Display information about the compression. If omitted, COMPRESS0 operates silently (except for error messages).3 ALL / Equivalent to /SHOW=(PROGRESS,STATISTICS,FDL)I 3 PROGRESSB Print status messages at intervals, showing the operation of the? program. The report shows the current compression ratio (the ? ratio of input to output bytes). If this decreases, COMPRESSh@ decides that the characteristics of the file have changed, and= resets its internal parameters. The "gap" is the number of.( input codes used to compute the ratio. 3 STATISTICSG Print a report at the end of the process. Note that COMPRESS reportstG the number of bytes it compresses, which includes the file as well asiK the information that COMPRESS records about the file (the File DefinitionbH Language block and some internal codes), and will therefore be several> hundred characters greater than the actual size of the file.3 FDLrD Dump the File Definition Language block that describes a VMS input file.r3 DEBUGs' Print internal debugging information.i3 DEBUG_SERIOUSf, Print more internal debugging information. 3 DEBUG_IO Dump the output file, too.2 LZW_Overview2 LZW stands for a compression method described in8 "A technique for High Performance Data Compression."< Terry A. Welch. IEEE Computer, Vol 17, No. 6 (June 1984) pp. 8-19.B This section is abstracted from Terry Welch's article referencedC below. The algorithm builds a string translation table that mapsp@ substrings in the input into fixed-length codes. The compress( algorithm may be described as follows:: 1. Initialize table to contain single-character strings.C 2. Read the first character. Set (the prefix string) to thats character.X* 3. (step): Read next input character, K./ 4. If at end of file, output code(); exit.n$ 5. If K is in the string table:" Set to K; goto step 3.* 6. Else K is not in the string table. Output code();& Put K into the string table;! Set to K; Goto step 3.aA "At each execution of the basic step an acceptable input string/@ has been parsed off. The next character K is read and theB extended string K is tested to see if it exists in the string> table. If it is there, then the extended string becomes theD parsed string and the step is repeated. If K is not in theA string table, then it is entered, the code for the successfullyB parsed string is put out as compressed data, the character K; becomes the beginning of the next string, and the step is repeated."B The decompression algorithm translates each received code into a? prefix string and extension [suffix] character. The extensionp< character is stored (in a push-down stack), and the prefixA translated again, until the prefix is a single character, whichl@ completes decompression of this code. The entire code is then@ output by popping the stack. I.e., the last code put into the0 stack was the first code in the orig inal file.? "An update to the string table is made for each code receivedv? (except the first one). When a code has been translated, itseC final character is used as the extension character, combined withiB the prior string, to add a new string to the string table. This? new string is assigned a unique code value, which is the sameoA code that the compressor assigned to that string. In this way,C the decompressor incrementally reconstructs the same string table B that the decompr!essor used.... Unfortunately ... [the algorithm]% does not work for an abnormal case.h= The abnormal case occurs whenever an input character stringa@ contains the sequence KKK, where K already appears in the compressor string table."e? The decompression algorithm, augmented to handle the abnormal case, is as follows: 1. Read first input code;  Store in CODE and OLDcode;C1 With CODE = code(K), output(K); FINchar = K;h+ 2. Read next code to CODE; INcode = CO"DE;L If at end of file, exit;e4 3. If CODE not in string table (special case) then Output(FINchar);s CODE = OLDcode;' INcode = code(OLDcode, FINchar);, 4. If CODE == code(K) thene Push K onto the stack;  CODE == code();  Goto 4. 5. If CODE == code(K) then Output K; FINchar = K;d 6. While stack not empty Output top of stack;  Pop stack;t) 7. Put OLDcode,K into the string table.m OLDcode# = INcode; Goto 2.= The algorithm as implemented here introduces two additionalc complications.: The actual codes are transmitted using a variable-length= encoding. The lowest-level routines increase the number ofeA bits in the code when the largest possible code is transmitted.i> Periodically, the algorithm checks that compression is still: increasing. If the ratio of input bytes to output bytesA decreases, the entire process is reset. This can happen if theB char%acteristics of the input file change. (This can be supressed by /EXPORT=(UNIX, NOBLOCK)).2 Unix+ Is a trademark of AT&T Bell Laboratories.! ! decompress!Fwwefinition Language block that describes the output file.3 DEBUG' Print internal debugging information.3 DEBUG_SERIOUS, Print more internal debugging information. 3 DEBUG_IO Dump the input file, too.2 Unix+ Is a trademark of AT&T Bell Laboratories.wwº«,óbÇG%— PORTER COMPRESS DECOMPRESSº«,C2¹u(— PORTER COMPRESS DECOMPRESSº«,«æ6ly(— PORTER COMPRESS DECOMPRESSº«,c˜¥Á}(— PORTER COMPRESS DECOMPRESS&­‹E/ly(— 1 DECOMPRESSA The DECOMPRESS command invokes a utility to restore copy a file' that had been compressed by COMPRESS.i1 DECOMPRESS Input-file-spec [Output-file-spec]R2 Command_Parameters Input-file-spec2 Specifies the name of the compressed input file. Output-file-spechB Specifies the name of the file created by COMPRESS. If the file? was compressed by /EXPORT=VMS, the original file name will bec< used if the Output file spec. is omitted. If the 'file wasB compressed by /EXPORT=UNIX and no Output file spec. is provided,) the file will be written to SYS$OUTPUT:n2 Command_QualifiersB Indicate special actions to be performed by the COMPRESS utility< or special properties of either the input or output files.) Qualifiers apply to the entire process..@ The following list shows all the qualifiers available with the DECOMPRESS command:B o /BITS=value o /EXPORT=(option,...)m o /METHOD=options o /MODE=(opti(on,...)I o /SHOW=(option,...)t2 /BITS" /BITS=valueA If a header was not provided, this specifies the maximum numbero? of bits that were used in the compression. This parameter ise3 ignored if the compressed file contains a header.r 2 /EXPORTo /EXPORT=(option, [,...])(@ Export describes the format of the input file. You can select the following:= VMS (D) The file was created by VMS COMPRESS./= UNIX The file was created by Unix compr)ess  or a compatible program.B compatible with the Unix compress utility.B [NO]ENDMARKER A special file endmarker follows the data.C [NO]BLOCK The compress program may have reinitialized  compression.tA [NO]HEADER The compress program wrote its parameters  into a file header.A In general, the program can determine the proper value of these > flags by reading the first few bytes of the file. If valid,; the file header ov*errides the command line specification.RA Generally, this option is needed only if you are trying to read = a file generated by a version of Unix compress that did notR? write a header. See the description of COMPRESS for details.n 2 /METHOD  /METHOD=(option)eB This specifies the particular compression algorithm. Currently, only /METHOD=LZW is supported.3 LZWi1 Use the Lempel-Ziv-Welch compression algorithm.g2 /MODEt /MODE=(option)u< This allows specification of v+ariations on the output file: format. These values will be taken from the source file' description if /EXPORT=VMS is chosen.3 BINARYB This creates the file in "binary" mode, rather than "text" mode.A It is ignored if COMPRESS created the file in /EXPORT=VMS mode. < The output file will be created in RMS "Stream-LF" format.3 DELTA ? Compress used the difference between successive bytes, ratheri? than the bytes themselves. For certain file formats, such asl= bit-mapped graph,ics, this may yield a 10-15% improvement ineC compressibility. This is not compatible with some implementationsR> of Unix compress. This value is normally read from the file< header, and generally need not be specified by DECOMPRESS.3 FIXEDe; Create the file in "fixed-block, 512-byte record" format.t; This is probably the best format to use for decompressingr7 binary files (such as tar archives) created on Unix.i3 TEXT? Create the file in "variable-length carriage-control" -format. ; This is appropriate for decompressing readable text filesp created by Unix compress.n2 /SHOWo /SHOW=(option, [,...])BD Display information about the compression. If omitted, DECOMPRESS0 operates silently (except for error messages).3 ALL / Equivalent to /SHOW=(PROGRESS,STATISTICS,FDL)o 3 PROGRESSB Print status messages at intervals, showing the operation of the program. 3 STATISTICS+ Print a report at the end of the process. 3 FDLdC Dump the File Definition Language block that describes the outputf file.m3 DEBUGd' Print internal debugging information.o3 DEBUG_SERIOUSt, Print more internal debugging information. 3 DEBUG_IO Dump the input file, too. 2 Unix+ Is a trademark of AT&T Bell Laboratories.uwwly, only /METHOD=LZW is supported.3 LZW1 Use the Lempel-Ziv-Welch compression algorithm.2 /MODE /MODE=(option)D This allows specification of variations on the compression method.3 BINARY@ /endmarker. If you guess wrong, aoC few bytes of garbage may be appended to the decompressed file. An? version of Unix compress that handles endmarkers correctly iss available. 2 /METHOD  /METHOD=(option)rB This specifies the particular compression algorithm. Currently, only /METHOD=LZW is supported.3 LZWh1 Use the Lempel-Ziv-Welch compression algorithm.x2 /MODE /MODE=(option)WD This allows specification of variations on the compression method.3 BINARY@ 0This opens the file in "binary" mode, rather than "text" mode.) It is ignored if /EXPORT=VMS is chosen.L3 DELTAGC Compress the difference between successive bytes, rather than thetA bytes themselves. For certain file formats, such as bit-mappedC graphics, this may yield a 10-15% improvement in compressibility. D This is not compatible with some implementations of Unix compress.2 /SHOWr /SHOW=(option, [,...])"B Display information about the compression. If omitted, COMPRESS01 operates silently (except for error messages).3 ALLh/ Equivalent to /SHOW=(PROGRESS,STATISTICS,FDL)m 3 PROGRESSB Print status messages at intervals, showing the operation of the? program. The report shows the current compression ratio (them? ratio of input to output bytes). If this decreases, COMPRESSc@ decides that the characteristics of the file have changed, and= resets its internal parameters. The "gap" is the number of ( input codes used to compute the ratio. 3 STATIS 2TICSG Print a report at the end of the process. Note that COMPRESS reports G the number of bytes it compresses, which includes the file as well asrK the information that COMPRESS records about the file (the File DefinitionaH Language block and some internal codes), and will therefore be several> hundred characters greater than the actual size of the file.3 FDLrD Dump the File Definition Language block that describes a VMS input file.t3 DEBUGu' Print internal debugging informa3tion.o3 DEBUG_SERIOUS, Print more internal debugging information. 3 DEBUG_IO Dump the output file, too.2 LZW_Overview2 LZW stands for a compression method described in8 "A technique for High Performance Data Compression."< Terry A. Welch. IEEE Computer, Vol 17, No. 6 (June 1984) pp. 8-19.KB This section is abstracted from Terry Welch's article referencedC below. The algorithm builds a string translation table that mapsP@ substrings in the input into fixed-len4gth codes. The compress( algorithm may be described as follows:: 1. Initialize table to contain single-character strings.C 2. Read the first character. Set (the prefix string) to that  character.i* 3. (step): Read next input character, K./ 4. If at end of file, output code(); exit. $ 5. If K is in the string table:" Set to K; goto step 3.* 6. Else K is not in the string table. Output code();& Put K into the string table;! Set 5 to K; Goto step 3.eA "At each execution of the basic step an acceptable input stringl@ has been parsed off. The next character K is read and theB extended string K is tested to see if it exists in the string> table. If it is there, then the extended string becomes theD parsed string and the step is repeated. If K is not in theA string table, then it is entered, the code for the successfullycB parsed string is put out as compressed data, the character K; beco 6mes the beginning of the next string, and the step ise repeated."B The decompression algorithm translates each received code into a? prefix string and extension [suffix] character. The extensionb< character is stored (in a push-down stack), and the prefixA translated again, until the prefix is a single character, whichc@ completes decompression of this code. The entire code is then@ output by popping the stack. I.e., the last code put into the0 stack was the first code in the orig 7inal file.? "An update to the string table is made for each code receivedr? (except the first one). When a code has been translated, itstC final character is used as the extension character, combined witheB the prior string, to add a new string to the string table. This? new string is assigned a unique code value, which is the sameA code that the compressor assigned to that string. In this way, C the decompressor incrementally reconstructs the same string table B that the decompr8essor used.... Unfortunately ... [the algorithm]% does not work for an abnormal case.h= The abnormal case occurs whenever an input character stringd@ contains the sequence KKK, where K already appears in the compressor string table." ? The decompression algorithm, augmented to handle the abnormalh case, is as follows: 1. Read first input code;e Store in CODE and OLDcode;o1 With CODE = code(K), output(K); FINchar = K;e+ 2. Read next code to CODE; INcode = CO9DE;I If at end of file, exit; 4 3. If CODE not in string table (special case) then Output(FINchar);  CODE = OLDcode;' INcode = code(OLDcode, FINchar);i 4. If CODE == code(K) thenc Push K onto the stack;  CODE == code();o Goto 4. 5. If CODE == code(K) then Output K; FINchar = K;s 6. While stack not empty Output top of stack;t Pop stack;,) 7. Put OLDcode,K into the string table.n OLDcode: = INcode; Goto 2.= The algorithm as implemented here introduces two additional. complications.: The actual codes are transmitted using a variable-length= encoding. The lowest-level routines increase the number ofdA bits in the code when the largest possible code is transmitted.s> Periodically, the algorithm checks that compression is still: increasing. If the ratio of input bytes to output bytesA decreases, the entire process is reset. This can happen if theB characteristics of the input file change. (This can be supressed by /EXPORT=(UNIX, NOBLOCK)).2 Unix+ Is a trademark of AT&T Bell Laboratories.! ! decompress!ww­£pœÁ}(— 1 DECOMPRESSA The DECOMPRESS command invokes a utility to restore copy a file' that had been compressed by COMPRESS.1 DECOMPRESS Input-file-spec [Output-file-spec]2 Command_Parameters Input-file-spec2 Specifies the name of the compressed input file. Output-file-specB Specif