You can enter data at the terminal for an input file in your PL/I program if you do the following:
You can usually use the standard default input file SYSIN because it is a stream file and can be allocated to the terminal.
You are prompted for input to stream files by a colon (:). You will see the colon each time a GET statement is executed in the program. The GET statement causes the system to go to the next line. You can then enter the required data. If you enter a line that does not contain enough data to complete execution of the GET statement, a further prompt, which is a plus sign followed by a colon (+:), is displayed.
By adding a hyphen to the end of any line that is to continue, you can delay transmission of the data to your program until you enter two or more lines.
If you include output statements that prompt you for input in your program, you can inhibit the initial system prompt by ending your own prompt with a colon. For example, the GET statement could be preceded by a PUT statement such as:
PUT SKIP LIST('ENTER NEXT ITEM:');
To inhibit the system prompt for the next GET statement, your own prompt must meet the following conditions:
Under TSO, there is support of an environment variable called TSO_INPUT_OPT to help control the input from a terminal in a more flexible way than the default way described above.
The syntax for the TSO_INPUT_OPT environment variable, which has to be in uppercase, is:
>>-TSO_INPUT_OPT-- =option-------------------------------------><
When specifying the options, which could be in uppercase or lowercase, blanks are not allowed. If more than one option is specified, they have to be separated by a comma. In addition, the syntax of the statement is not checked at the time the command is entered. It is verified when the data set is opened. If the syntax is wrong, the UNDEFINEDFILE condition is raised with the oncode 96.
The options you can specify are:
.-N-. >>-PROMPT--(-+-Y-+-)-------------------------------------------><
.-N-. >>-SAMELINE--(-+-Y-+-)-----------------------------------------><
For more information on how these options will affect your input and output to the terminal, see Example 1 and Example 2 under the SAMELINE option in Chapter 6.
One way to specify this environment variable under TSO is via the PLIXOPT string. For example:
DCL PLIXOPT char(50) var ext static
init('ENVAR("TSO_INPUT_OPT=PROMPT(Y),SAMELINE(Y)")');