Transferring Data to the Printer (PRT Operation)
When data (character data only) is assigned to the shared variable, it is printed
and a return code is assigned to the shared variable. A 0 0 return code indicates
the data was printed successfully and a nonzero return code indicates the opera-
tion failed. See Return Codes in this chapter for a description of each return code.
Note: The )OUTSEL OFF command is automatically issued by the system when
doing PRT operations. The )OUTSEL option will return to its previous setting
after the PRT operation has been terminated (PRT termination is discussed next).
CLOSING A DATA FILE OR TERMINATING THE PRINTER OUTPUT
Transferring an empty vector will close the data files or terminate the printer out-
put and a final return code will be issued. A 0 0 return code indicates the file
was closed or printer output was terminated successfully. See Return Codes in
this chapter for a description of each return code. Also, for an IN operation, the
file is closed and a return code is issued if an error occurs due to the device or if
an end-of-file empty vector is returned.
CAUTION
For OUT and ADD operations, if the tape cartridge is removed from the 5100
before a data file is closed, the data in the file will be
unusable.
After a data file has been closed, another data file can be opened by assigning
the information required to open a file to the shared variable. Once the tape and
printer input and output operations are done and the data files are closed or print-
ing is terminated, the variable name being shared should be retracted. How to re-
tract the variable name is discussed next.
RETRACTING THE VARIABLE NAME BEING SHARED
The OSVR function is used to retract a variable name being shared. That is, once
the USVR function has been used successfully, the variable name still exists as
an APL variable, but it cannot be used to transfer data to tape or printer, unless
it is reestablished as a shared variable, The OSVR function is monadic (takes one
argument) and is entered as follows:
where NAME(S) can be the names of up to eight variables. If more than one name
is required, the names must be
in a character matrix with each row representing a
name (see Esrablishing a Shared Variable earlier in this chapter).
The 5100 will respond with a 2 (or a 1 if the left argument for the USVO func-
tion was not a 1 -see Establishing a Variable to be Shared in this chapter) for each
variable name that is successfully retracted and a 0 for each variable name that is
not successfully retracted. Normally, if a variable name cannot be successfully
retracted, it was never properly established as a shared variable.
Note: If the OSVR function is used before a file is closed, the system will auto-
matically close the file.
164
RETURN CODES
c,
Return codes assigned to the shared variable when doing input/output operations
indicate whether or not the operation was successful. If the return code is non-
zero and MSG=OFF was not specified, an error message is also displayed.
Operation of the system does not stop when a nonzero return code is assigned.
Therefore, if you have a user-defined function that is doing input/output opera-
tions, the user-defined function should check the return code that was assigned
to the shared variable to make sure each operation is successful.
Following is a description and/or user's response for each return code and error
message:
Code
00
10
20
30
40
50
60
Error Message
INVALID FILE
INVALID DEVICE
or
INVALID DEVICE NUMBER
INVALID FILE NUMBER
NOT WITH OPEN DEVICE
INVALID PARAMETER
70 WSFULL
8 0 DEVICE NOT OPEN
Description and/or User's Response
Operati on successful.
Device error; the second element
is the error code (see
ERROR eee ddd in Chapter 11 1.
The specified file cannot be used
for input/output operations.
Enter tht? information required to
open the file again, using device
number 1 or 2.
Enter the information required to
open the file again, using a valid
file number.
The specified device is already being
used for input/output operations;
the existing open file must be closed
before another file can be opened.
The information required to open
the file was entered incorrectly;
enter it again, correcting any key-
ing errors.
Use the )ERASE command to erase
any unwanted objects; then enter
the information required to open
the file again.
Open the file.
165
Previous Page Next Page