This information must be character data (enclosed in single quotes) and must be
entered with a blank between each parameter, as follows:
IN
or
OUT
- name + or device/file number
ADD
or
PRT
where:
- name is the name of the variable being shared.
- IN specifies that the data is to be transferred from tape into the active
workspace.
- OUT specifies that the data is to be transferred to a tape file.
- ADD specifies that the data is to be transferred to an existing tape file,
following the last record in that data file.
- PRT specifies that the data is to be printed.
Note: When PRT is specified, the only other information that can be speci-
fied is MSG=OFF (which is defined later).
device/file number specifies the tape unit and file number. For example:
1003
-Tape Unit 1
Note: If fewer than four digits are used, tape unit 1 is assumed, and the
value entered represents only the file number.
ID=(file ID) (optional) specifies from 1 to 17 characters enclosed in
parentheses:
For an IN or ADD operation, the entry (file ID) is compared to the file ID in
the file header; the open fails if they do not match.
0 For an OUT file, the entry (file ID) is put in the file ID field of the file header
(see the )LIB command in Chapter 2). If the ID=(file ID) parameter is not
specified, the characters DATA are put in the file ID field.
It is a good practice to give the data files meaningful names; for example, a
file that contains sales data could be named SALES. Also, any blanks within
the 17 characters become part of the file ID.
Note: To do an OUT operation to an existing data file (write new data
over the existing data), the file ID specified must match 1:he existing file
ID for the data file.
160
MSG=OFF (optional) specifies that no error message is to be displayed for
nonzero return codes (see Rerurn Codes in this chapter).
A
or
I
TYPE=or (optional) can only be specified for OUT operations. It specifies the
-i
data format to be used when writing data to tape:
0 When TYPE=A is specified, the APL internal data format is used; that is,
the data is written on tape in the same format that it is stored in, in the
active workspace.
0 When TYPE=I or TYPE=Il is specified, the interchange data format is used.
When the interchange data format is used, only character scalars or vectors
can be
assigned to the variable being shared. Therefore, when storing nu-
meric data or arrays on tape using the interchange data format, the data
must first be changed to a character scalar or vector (see the ip function
in Chapter 4).
The following items apply to an interchange data file that is used by both
the 5100 APL and BASIC languages:
All data items must be separated by commas. For example, the numeric
vector 1 3 5 6 must be
changed to character data, then commas placed in
the blank positions.
Negative signs must be replaced by minus signs.
Enclosing single quotes must be
part of any data that represents character
constants. Also, any embedded quotes in the character constant must be
represented by double quotes.
Note: The 5100 BASIC language accepts only the first 18 characters in
each character constant.
The 5100 BASIC language creates a logical record for each PUT statement
or each row of an array with a MAT PUT statement.
0 When TYPE=12 is specified, the general interchange data format is used; it
is the same as TYPE=) (and TYPE 11) except that the data file can also be
used as a BASIC language source file.
Note: The data format can be
specified only for an OUT operation. For IN
or ADD operations, the data format is specified by the data file type (see
)LIB command in Chapter 2). If the data format is not specified for an OUT
operation, the APL internal data format (TYPE=A) is used.
CAUTION
If the tape cartridge is removed from the 5100 when an OUT or ADD file is
open, the file will be unusable. See Closing a Data File or Terminating the
Printer Output in this chapter for information on how to close a data file.
161
Previous Page Next Page