HP 3000 Manuals

DATA, INPUT, and PROMPT [ HP Transact Reference Manual ] MPE/iX 5.0 Documentation


HP Transact Reference Manual

DATA, INPUT, and PROMPT 

Transact can perform a number of different data entry functions in
character mode with the use of the DATA, INPUT, and PROMPT verbs.

The DATA and PROMPT verbs will prompt the user for a response to a prompt
string or item name.  Transact will validate the data and prompt the user
again if any errors are detected.  The major difference between the DATA
and PROMPT verbs is the registers that are updated.  The PROMPT verb will
add the item to the list register, whereas the DATA verb will only update
an item already on the list register.  Depending on the modifier used for
each verb, values would also be placed in the data, argument, match,
and/or update registers.  The input value for the DATA and PROMPT verbs
is usually used for subsequent file and data set operations.

The INPUT verb will prompt the user for a response to a prompt string.
The value will be placed in the INPUT register.  The INPUT verb is used
to test a user response.

Special characters that can be entered by the user in response to the
prompt are discussed later in this chapter.  To get additional
information and examples of the DATA, INPUT, and PROMPT verbs, see
Chapter 8.  A discussion of the use of the MATCH modifier with the DATA
and PROMPT verbs follows.

Responding to a MATCH Prompt 

The MATCH modifier, available with the PROMPT, DATA, and LIST verbs,
provides a powerful mechanism for specifying record selection criteria.

The response to a prompt issued by the PROMPT or DATA verb using the
MATCH modifier is set up in the match register.  Transact can use it in
subsequent file or data set accesses.  It provides a mechanism by which
to specify at run time which records to access.

With native language support, the usage of the specified language is
reflected in the relational operators, the connectors, and the range
indicator (such as, "TO").  See "Native Language Support" in Appendix E
for more information.

The response to the prompt can take the following general format:

       {[relation] value1}            {[relation] value2}
       {               } [connector {               } ]...
       {value1 TO value2 }           {value3 TO value4 }

Where:

relation            Is a relational operator for a condition that is
                    other than equal; use one of the following:
                           NE - not equal to (< >)
                           LT - less than (<)
                           LE - less than or equal to (<=)
                           GT - greater than (>)
                           GE - greater than or equal to (>=)

value               A numeric value or a partial string specification.  A
                    string with embedded blanks must be enclosed in
                    quotation marks.

TO                  Specifies a range of values bounded by the value
                    preceding and the value following TO.

connector           A logical connector that is one of the following:

                    AND           Specifies that the record accessed must
                                  contain both the value before and the
                                  value after this operator.

                    OR            Specifies that the record accessed must
                                  contain either the value before or the
                                  value after this operator.

                                  The precedence of these connectors is
                                  AND then OR.

To illustrate this syntax, assume the program contains the following
PROMPT(MATCH) statement:

     PROMPT(MATCH) ITEM1 ("Enter match criteria for ITEM1");

When executed, this statement adds the item name, ITEM1, to the list
register and issues the specified prompt.  It then sets up the match
register with criteria entered by the user.  For example:

     Enter match criteria for ITEM1> GE 500 AND LE 1000 

This response sets up the match register with two criteria, as shown
below:
__________________________________________________________________________
|                                                                        |
|                                                                        |
|                 ITEM1                                  ITEM1           |
|      ( equal to  OR  greater than )  AND   ( less than  OR   equal to )|
|         500                500                  1000             1000  |
|                                                                        |
__________________________________________________________________________

            

To further illustrate this syntax, the following examples are all legal
responses to prompts issued by DATA(MATCH) or PROMPT(MATCH) statements:

> 20 TO 30 

This response sets up the match register to accept any value for the
match item that is between 20 and 30 inclusive.  Note that the following
response gives identical results:

> GE 20 AND LE 30 

The following response sets up the match register to accept either the
value "LAX" or "CGY":

> LAX OR CGY 

This next response sets up the match register to accept values beginning
with "REG" or values beginning with "SAS" and containing the value "CITY"
in any position:

> REG^ OR SAS^ AND CITY^^ 

If you want to include one of the standard delimiters, comma, or equals,
within a value, you must enclose the value in quotes; or you must specify
another delimiter with a SET(DELIMITER) statement.  For example, you
could respond with:

> "San Diego, California" 

This response ensures that the comma is included in the match register
specification.

These examples illustrate how you can set up the match register with
responses to DATA(MATCH) or PROMPT(MATCH) statements.  You can also set
up the match register in your program with SET(MATCH) statements.  Using
SET(MATCH), you can set up only one selection specification at a time,
and you must also make sure the values used in the match criteria are
already in the data register.  For example, the following four statements
place the same criteria in the match register as the response "A OR B" to
the prompt issued by a DATA(MATCH) CREDIT statement.

     LET (CREDIT) = A;
     SET(MATCH) LIST (CREDIT);
     LET (CREDIT) = B;
     SET(MATCH) LIST (CREDIT);



MPE/iX 5.0 Documentation