Interactive programs that are designed for use at remote terminals might not run successfully if initiated from the ODT. You must design the program somewhat differently if it is to be initiated at an ODT. If the process opens a file with KIND = REMOTE, it is discontinued with an “UNKNOWN FILE/STATION” error. The process should open a file with KIND = ODT instead. A process can determine whether it was initiated from an ODT or a remote terminal by interrogating the SOURCEKIND task attribute.
A process can open a file either at a labeled ODT or at a scratch ODT. A labeled ODT is one that has been assigned a label by the LABEL (Label ODT) system command. A scratch ODT is one that has not been assigned such a label.
To open a file at a labeled ODT, a process should first set the TITLE file attribute to match the label assigned to the ODT. In addition, the NEWFILE file attribute value should be FALSE or else unspecified. If NEWFILE is unspecified, the MYUSE file attribute value should be IN or IO. When the process runs, the system opens the remote file at any ODT with a matching label. If none of the ODTs has a matching label, the process is suspended with a “NO FILE <file title> (SC)” RSVP message. The process resumes execution when an operator uses the LABEL command to label an ODT with the requested file title.
To open a file at a scratch ODT, a process should set the NEWFILE file attribute to TRUE, or leave NEWFILE unspecified and set MYUSE to OUT. The value of the TITLE file attribute makes no difference in this case. If the process was initiated from an ODT, and that ODT is a scratch ODT, the system opens the file at that ODT. Otherwise, the system selects another scratch ODT and opens the file there.
To open a file at a particular ODT, regardless of whether that ODT is labeled or scratch, the process can assign the UNITNO file attribute a value equal to the physical unit number of the ODT. The system opens the file at the requested ODT even if the ODT is labeled and the label does not match the TITLE file attribute. However, note that use of the UNITNO file attribute is restricted on systems running the Security Services for ClearPath MCP at the S2 level; refer to the Security Operations Guide for details.
To open a file at the ODT where the process was initiated, regardless of whether that ODT is labeled or scratch, the process should first read the physical unit number from its own SOURCESTATION or ORGUNIT task attribute value. The process can then assign the physical unit number to the UNITNO file attribute, as described previously.
When a process opens an ODT file, automatic display mode at the ODT is temporarily suspended. However, system commands continue to be available. You can enter text into the ODT file by preceding the text with a GS character. The GS character is also known as the delta character and looks like an upward-pointing triangle. (Do not confuse the GS character with the circumflex character, which resembles an inverted letter V.) Refer to the documentation for your terminal to find out whether your terminal supports the GS character and which key it is mapped to.
You can indicate that there is no more input, and cause an end-of-file condition, by entering the GS character, followed by ?END.
When the process closes the ODT file, the system removes the label from the ODT and resumes Automatic Display mode. You can also resume Automatic Display mode while the ODT file is still open by entering an ADM OK command at the ODT.
An example of a program that uses an ODT file is given in the ORGUNIT description in Monitoring and Controlling Process Status.

