|
The online home of
the company bringing you quality HP hardware and software support |
| File Distribution using WINZIP Format on MPE Systems |
| Heterogeneous
Information Systems environments demand sharing files among dissimilar
systems for various reasons. For instance, transferring inventory
files to a customer, receiving updated inventory data from a vendor,
or burning a CD of an entire group of source files prior to beginning
a large programming project. Even a method of transferring many files
from one system to another during a platform migration.
Sometimes these systems are on the same network and the files can be accessed directly via NFS or Samba. Other times the files must be transported by way of networks or media such as CDs. Files should be compressed prior to transfer to save transfer time, network bandwidth, or disk space. What compression format is compatible with just about any other operating system you will encounter? WINZIP. According to the Info-Zip organization (http://www.info-zip.org/), there are compatible utilities for just about all operating systems.
While not explicitly mentioned in the list, ZIP and UNZIP command line utilities for MPE are available. They can be freely download from ftp://ftp.nha.co.za. ZIP and UNZIP are stand-alone native mode MPE programs that can be placed anywhere on your system. The group where they are placed must have PH capability. I recommend it be placed somewhere on your HPPATH so that you can reference them as ZIP and UNZIP rather than fully qualifying them. ZIP You create a .zip archive of either one or many files using the ZIP program. ZIP has many options which you can see by running the program with no parameters. It is best to run ZIP from the Posix shell rather than the MPE prompt. The reason for this is twofold. First, the Posix shell will enable wildcarding of the fileset whereas from the CI prompt you have to individually list each file to be copied into the .zip archive. Second, the shell automatically passes everything after the program name as a single parameter to the program. The CI will pass all of the parameters as an INFO string, thus you have to enclose all of the options within quotes. The following commands are identical in function but as you can see the second one is much easier to type. The more files you want to place in the archive the better off you are running it from the shell.:zip Copyright (C) 1990-1996 Mark Adler, Richard B. Wales, Jean-loup Gailly Onno van der Linden and Kai Uwe Rommel. Type 'zip -L' for the software License. Zip 2.1 (April 27th 1996). Usage: zip [-options] [-b path] [-t mmddyy] [-n suffixes] [zipfile list] [-xi list] The default action is to add or replace zipfile entries from list, which can include the special name - to compress standard input. If zipfile and list are omitted, zip compresses stdin to stdout. -f freshen: only changed files -u update: only changed or new files -d delete entries in zipfile -m move into zipfile (delete files) -k force MSDOS (8+3) file names -g allow growing existing zipfile -r recurse into directories -j junk (don't record) directory names -0 store only -l convert LF to CR LF (-ll CR LF to LF) -1 compress faster -9 compress better -q quiet operation -v verbose operation/print version info -c add one-line comments -z add zipfile comment -b use "path" for temp file -t only do files after "mmddyy" -@ read names from stdin -o make zipfile as old as latest entry -x exclude the following names -i include only the following names -F fix zipfile (-FF try harder) -D do not add directory entries -A adjust self-extracting exe -J junk zip file prefix (unzipsfx) -T test zipfile integrity -X eXclude eXtra file attributes -y store symbolic links as the link instead of the referenced file -e encrypt -n don't compress these suffixes Most utilities derived from Unix share a common syntax. After the program name comes any number of optional arguments separated by spaces, followed by the target of the command, followed by a filename to operate on or a list of files separated by spaces.SOURCE.WERTH:zip "-9 -v archive1.zip TEST TESTPRNT TESTPRT" adding: TEST (in=5624) (out=1507) (deflated 73%) adding: TESTPRNT (in=1555) (out=603) (deflated 61%) adding: TESTPRT (in=512) (out=184) (deflated 64%) total bytes=7691, compressed=2294 -> 70% savings SOURCE.WERTH:sh ######################################################################## MPE/iX Shell and Utilities (A.50.02) COPYRIGHT (c) Hewlett-Packard Company 1992, All Rights Reserved. ######################################################################## (Shell/iX)/WERTH/PUB>zip -9 -v archive2.zip TEST* adding: TEST (in=5624) (out=1507) (deflated 73%) adding: TESTPRNT (in=1555) (out=603) (deflated 61%) adding: TESTPRT (in=512) (out=184) (deflated 64%) total bytes=7691, compressed=2294 -> 70% savings
A very powerful feature in Unix is "shell expansion" which means the shell is responsible for expanding the wildcard into a list of qualifying file names and then passing them to the program. Individual programs do not understand filename wildcards. The MPE Posix shell performs this wildcard expansion. In the case of ZIP the syntax is:
the shell expands FILE* into a list of qualifying file names. It is identical to typing
Here are a couple of example ZIP commands. Each will produce a file that can be downloaded to a PC where any or all of the files can be extracted with PKZip or Winzip. Archive all files in the group PROD.SOURCE. -9 means compress at a higher rate, possibly at the expense of more CPU cycles to produce a smaller zip file.
Move (archive and delete) files matching V@.EXTRACT.AP into archive named VendorExtract.zip.
ZIP cannot handle KSAM and NMKSAM files, message files, circular files, and PRIV files. This is not a serious drawback since these file types are not directly portable to other operating systems. UNZIP When you are the recipient of .zip files you will invoke the UNZIP program. UNZIP operates similarly to ZIP in syntax. List the contents of the archive named ZipArchive.zip
Unzip all files with a .cob extension into the group COBOL.SOURCE
Just like ZIP, run UNZIP with no parameters to view all of the options.
There are many
utilities to accomplish archiving files available including compress/uncompress,
lzw, tar, uhaul, mover, store-to-disk, squisher, and others. The WINZIP
format is by far most common to the widest variety of operating systems. |
Send mail to
webmaster@beechglen.com with
questions or comments about this web site.
Copyright © 2006
Beechglen Development Inc.
Last modified:
01/20/06