OpenExtensions for z/VM "Q"s and "A"s

Question: Is there anything special I need to know about archiving files with OpenExtensions for z/VM?

Answer: You can bundle files together in single "archive" files with utilities like pax, tar, and cpio. Usually, the filename of such an archive file will indicate the type of utility used to create the file; for example, the filename foobar.tar indicates a file created by the tar utility. The three utilities provide basically the same function: reading and writing archive files.

The important thing to know is that tar and cpio can only read and write files of their respective formats, but pax can read or write in any CPIO ASCII format, CPIO binary format, TAR format, or USTAR format. So given a pax, tar, or cpio file, you can use pax to "explode" or "unwind" the archive into its individual files. Later, I'll give examples in pax since it's easier that way and there's really no need to learn to use the others if you're only reading on OpenExtensions for z/VM.

ASCII to EBCDIC conversion

Where is your archive file coming from? If it was created on a traditional *IX type system, text files are probably encoded in ASCII and you will want to convert the data to EBCDIC on OpenExtensions for z/VM.

pax can do this conversion automatically. Many archives have been processed with this method, and there hasn't been a hint of a conversion problem (that is, translating to the wrong character). The option to perform ASCII to EBCDIC conversion is:

  -o from=ISO8859-1,to=IBM-1047
If you don't know whether you need the conversion or not, try it without first, maybe with just a single file in the archive.

This conversion feature is rather unique to OpenExtensions for z/VM because we're an EBCDIC system. If you're creating an archive that may be ported to an ASCII system, it might be a good idea to do the conversion in reverse so that data is stored in ASCII form.

Compressed archives

Is your archive compressed? Typically, archives are compressed to save disk space and transmission time. The convention for any compressed file is to end the filename with .Z (for example, the filename foobar.pax.Z). All three utilities can read and write compressed archives when they are run with the -z option.

Binary file transfer

Usually it's a good idea with archive files (especially when they are compressed) to use BINARY transfer options whenever possible. This applies when you are using FTP get and put subcommands as well as the "OPENVM GETBFS ... (BFSLINE 1" and "OPENVM PUT ... (BFSLINE NONE" commands.

A typical scenario in obtaining an archive might be:

  1. Obtain an archive from anonymous FTP server. Use BINARY mode when you perform the get!

  2. Move the file into the filesystem. Use the "BFSLINE NONE" option on the OPENVM PUTBFS

If you don't use BINARY mode everywhere you have the ability to, your archive will most likely be corrupted and unusable.

Examples of the pax command

To unwind all ASCII files from a compressed tar file:

  pax -o from=ISO8859-1,to=IBM-1047 -rzf foobar.tar.Z

To obtain a listing of all files contained in a tar file (it doesn't matter whether the files contain ASCII or EBCDIC data since the file names must always be stored in ASCII form):

  pax -vf foobar.tar

To unwind an individual ASCII file called README from an uncompressed pax file:

  pax -o from=ISO8859-1,to=IBM-1047 -rf foobar.pax README

To back up files in your current working directory and all subdirectories:

  pax -wzf ../backup.pax.Z .
Note that I deliberately wrote the archive file to a different directory than the directory I am archiving. If you accidentally include the archive file, when someone is unwinding the archive, that person could overwrite his/her copy of the archive before everything in the archive is unwound. The moral is to write your archive to a directory not in the tree of your current working directory.

For further information, refer to the IBM OpenExtensions for z/VM: User's Guide , SC24-5727 and the IBM OpenExtensions for z/VM: Command Reference , SC24-5728.


For more questions and answers, go to our archive of questions and answers.