SYS$INPUT is a process-permanent logical name that denotes the default file or device from which DCL reads input.
In an interactive process, the default value of SYS$INPUT is the terminal. In a command procedure run interactively, the default value of SYS$INPUT is the command procedure file. In a command procedure run as a batch job, the default value of SYS$INPUT is the command procedure file.
If you specify SYS$INPUT as the file specification for a command, you are prompted for the text while still remaining at the DCL level. For example:
$ mail sys$input jdoe Enter your message below. Press CTRL/Z when complete, or CTRL/C to quit: hi there Exit New mail from JDOE $
You can also redefine SYS$INPUT so that an image, invoked by a command procedure, reads input from the terminal or another file. Because DCL always obtains input from the default input stream, DCL ignores a redefinition of SYS$INPUT. The OpenVMS Help Facility offers the following example of an input file for the SORT command:
! PEOPLE.DAT ! A set of data with embedded key qualifiers for the SORT command. ! ! Usage: SORT@PEOPLE.DAT ! /KEY=(POS:10,SIZE:10) sys$input people.out Fred Flintstone 555-1234 Barney Rubble 555-2244 Wilma Flintstone 555-1234 Betty Rubble 555-2244 George Slate 555-8911 Dino Dinosaur 555-1234
Calling SORT@PEOPLE.DAT would therefore produce PEOPLE.OUT that would contain the table above sorted by surname.
The current value of SYS$INPUT can be displayed with the SHOW LOGICAL command. It displays only the device portion of the string. In the example below, SYS$INPUT is defined to a file:
"SYS$INPUT" = "_DSA0:" (LNM$PROCESS_TABLE)
In the example below, SYS$INPUT is defined to a terminal:
"SYS$INPUT" = "_TNA18:" (LNM$PROCESS_TABLE)
SYS$INPUT can be redefined so that an image takes its input from wherever it is redefined to. Most commands, except for those executed inside DCL, invoke images. Because DCL always obtains input from the default input stream, DCL ignores a redefinition of SYS$INPUT. In the following example, SYS$INPUT is redefined to SYS$COMMAND (the terminal) so that the image invoked with the next command (TPU) would use the terminal and not the command procedure file as a source of input.
$ DEFINE/USER_MODE SYS$INPUT SYS$COMMAND $ EDIT/TPU MYFILE.DAT . . .
When the image is finished, SYS$INPUT resumes with the default input stream (the command file).