How parse processes responses
- All of the new data entered is parsed before the scan of the original command is resumed.
- Unless otherwise stated in the command syntax definition, the new operand must be entered as it is entered in the original command. See Defining command operand syntax for exceptions to this rule.
- In general, a user can enter additional operands along with the
data prompted for. It must be kept in mind, however, that all of
the new data entered is parsed before the scan of the material in
the original command buffer is resumed.
Positional operands must occur first in the string of operands, and they must be in a specific order. Therefore, a problem could occur in a situation where a command is entered followed by two positional operands and a keyword, and the first positional operand is not valid. The Parse Service Routine issues a prompt for the first positional operand. When the user at the terminal reenters that first positional operand, it would be incorrect to enter additional keywords along with it. The additional keywords would be scanned before the second positional operand and an error condition would result when the Parse Service Routine returned to the original command buffer and found a positional operand.
Note: If the operand prompted for is within a subfield, only operands valid within that subfield can be entered along with the operand prompted for. - In general, a null response is acceptable only for optional operands. However, if the user enters
a null response for an optional operand that has a default, parse
inserts the default. If a prompt for a required operand is answered
by a null response from the terminal, parse reissues the prompt message.
The Parse Service Routine continues prompting until a correct operand is entered.
The terminal user can request termination by entering an attention.
Parse always accepts a null response to a prompt for a password, whether or not the dsname or userid operands are required. The program that invokes the Parse Service Routine must ensure that the correct password was entered if one was required, by checking the password pointed to by the PDE returned by the Parse Service Routine.
- If a required operand which can be entered in the form of a list
is missing, or if it was entered as a single operand (not as a list),
and that single operand is incorrect, parse will not accept a list
after the prompt. The user at the terminal must enter a single operand.
If, however, the item was entered as a list but an item within the list is incorrect, the Parse Service Routine accepts one or more operands after the prompt. The Parse Service Routine considers these newly entered operands to be part of the original list. Operands that are not valid in the list cannot be entered from the terminal in response to this prompt.
If the last item in a list is found to be not valid, parse only accepts one operand after a prompt.
- If the Parse Service Routine determines that an operand is not valid, the not valid portion of the operand is indicated in the error message. The remainder of the operand is not yet parsed. The user must reenter as much of the incorrect operand as was indicated in the error message. For example, this can occur if a dsname operand or userid operand is entered with blanks between the dsname or userid and the password. The dsname or userid can be not valid but the password is still good and will be parsed after a new dsname or userid is entered in response to the prompt.
Although the Parse Service Routine always attempts to obtain syntactically correct operands before returning to the calling routine, this is not always possible. The terminal user could have requested that no prompt messages be sent to the terminal, or the command being parsed could have come from a procedure. In these cases, the Parse Service Routine issues an error message and returns a code to the calling routine indicating that a correct command could not be obtained. Any second-level messages that would ordinarily be appended to the request for new data are appended to the error message.