MAGWR -- Write PCIDSK/Text Files to Tape

Writes PCIDSK image database files (image and segment data) and/or text files (EASI procedures, image reports, etc.) to PCI interchange format tape. Tapes created by MAGWR can be used to send information to other EASI/PACE installations, or for archiving on systems with limited backup capabilities.

NOTE: The PCI interchange format written by MAGWR is not compatible with any existing formats. Attempting to read the tape with programs other than MAGRD or MAGREP may fail.

If the PCIDSK database is `FILE' interleaved (that is, the image channels are held on separate files) then MAGWR will only save the PCIDSK header to tape. The image channels are NOT saved. A warning message is printed to inform the user of this.

See Also: MAGRD, MAGREP

PARAMETERS

MAGWR is controlled by the following global parameters:

Name     Prompt                                  Count     Type
FILI     Input File Name                         1-64      Char
FILETYPE File Type: PCIDSK/TEXT                  1-8       Char
MESSAG   File Message                            0-64      Char
STARTFIL Start File on Tape                      0-1       Int

FILI

Specifies the name of the file to be written to tape.

 EASI> FILI = "filespec"

FILETYPE

Specifies the file type. There are two options:

 EASI> FILETYPE = "PCIDSK"          | if file is image database
 EASI> FILETYPE = "TEXT"            | if file is text

MESSAG

Specifies a 0 to 64-character user comment used to help identify the file written to tape.

 EASI> MESSAG = "text"

STARTFIL

Specifies the start file number on tape from which to start to write the file. If STARTFIL is greater than one, the program rewinds the tape and advances to the specified file.

 EASI> STARTFIL = n     | place file after file n-1 on tape
                        | (this becomes the last file on tape)
 EASI> STARTFIL =       | append the file to the end of the last
                        | file on tape
For a tape with no files on it, STARTFIL must be set to 1.

DETAILS

MAGWR writes PCI interchange format tapes, allowing PCIDSK image database and text files, usually EASI procedures, to be written to tape. Unlike the tasks MIH and IMH, MAGWR always transfers a PCIDSK file in its entirety to and from the database. Such tapes can be used to send information to other EASI/PACE installations, or to archive data on systems with limited back-up capabilities (such as UNIX).

Each tape can hold multiple files. Each file on tape consists of a short header followed by the actual data. Files can span tapes, allowing large image files to be stored.

The type of file being written to tape must be specified using FILETYPE. If a PCIDSK image database file is being transferred, FILETYPE must equal "PCIDSK". If a text file is being transferred, FILETYPE must equal "TEXT".

If STARTFIL>0, MAGWR assumes that the user knows exactly where to put the file on tape. MAGWR will locate the position to place the file if 0 < STARTFIL < n+1, where n is the total number of files on tape. A new file written to tape is always the last file on the tape because all files with a file number greater than or equal to STARTFIL will be overwritten by the new file, which is followed two EOFs. If the user is unsure where to put the file, setting STARTFIL= (unspecified) will append the file to the end of file list.

The MESSAG parameter allows the user to assign a 1 to 64-character identifying string to the file stored on tape.

The contents of a tape can be checked using the MAGREP program.

 A TAPE WITH A WRITE-RING MUST BE MOUNTED ON THE TAPE DRIVE
 BEFORE MAGWR CAN BE RUN.  CLEANING THE TAPE HEAD IS RECOMMENDED
 TO MINIMIZE THE CHANCE OF TAPE WRITE ERRORS.

TAPE FORMAT

The general format of an archive tape is shown below. Each file is separated by an EOF mark. Two contiguous EOF marks indicate the end of data of the tape.

                      +--------------+
                      | File Header  |
                      +--------------+
                      | PCIDSK image |
                      | or text File |
                      +--------------+
                      |     EOF      |
                      +--------------+
                      | File Header  |
                      +--------------+
                      | PCIDSK image |
                      | or text File |
                      +--------------+
                      |     EOF      |
                      +--------------+
                             .
                             .
                             .
                      +--------------+
                      | File Header  |
                      +--------------+
                      | PCIDSK image |
                      | or text File |
                      +--------------+
                      |     EOF      |
                      +--------------+
                      |     EOF      |
                      +--------------+
The tape format can span multiple tapes. The user is responsible for correctly labelling the multi-tape set and mounting tapes in proper sequence. MAGWR prompts the user to mount the next tape.

FILE HEADER

The file header allows the creator of the tape to store identifying information in free-form ASCII.

The file header consists of one physical record, 512 bytes in length. It is created and filled with the information provided by the user and MAGWR to describe the file written on the tape. The file header format is described below:

      Type                  Description
    +---------------------------------------------------+
    | A16 | "PCI EASI/PACE   "                          |
    |-----+---------------------------------------------|
    | A8  | File type ("PCIDSK  " or "TEXT    "         |
    |-----+---------------------------------------------|
    | I8  | Sequence number                             |
    |-----+---------------------------------------------|
    | A16 | Time and date of writing (HH:MM  DD-MMM-YY) |
    |-----+---------------------------------------------|
    | A64 | File name (always of form XXXXX.XXX)        |
    |-----+---------------------------------------------|
    | A64 | Comment for the file                        |
    |-----+---------------------------------------------|
    | I8  | Number of records to write (PCIDSK only)    |
    |-----+---------------------------------------------|
    | A328| Blanks                                      |
    +---------------------------------------------------+

DATA RECORDS

Each data file is written to the tape in 8K consecutive blocks. The data format of PCIDSK image file is described in the PCIDSK database manual. For text files, lines of text are separated by <CR> with trailing blanks removed. Zeros are inserted into the rest of the last block, if the file size is not a multiple of 8K.

EXAMPLE

The following steps write two files to the tape. The file types are text and PCIDSK respectively. Their position on tape is specified using parameter STARTFIL.

 EASI>FILI     = "DEMO.EAS"
 EASI>FILETYPE = "TEXT"
 EASI>MESSAG   = "EASI procedure to run a demo for IMAGERY.PIX"
 EASI>STARTFIL = 1      
 EASI>RUN MAGWR
 EASI>FILI     = "IMAGERY.PIX"
 EASI>FILETYPE = "PCIDSK"
 EASI>MESSAG   = "A PCIDSK image file"
 EASI>STARTFIL = 2      
 EASI>RUN MAGWR

About PCI Help Gateway