DATA Statement

The DATA statement stores the specified data for use by subsequent input requests.

Format

DATA expr1, expr2, ...

Parameter(s)

expr

An expression evaluating to the data to be stored.

Description

The DATA statement places one or more values in a first-in-first-out (FIFO) input stack. These values are used as responses to INPUT statements encountered later in the program, in the order in which they are placed in the stack.

The DATA statement is intended to be used when a CHAIN, ENTER, or EXECUTE statement is used to execute another program or a PROC, TCL, or INFO/ACCESS command: the top value on the data stack is used to supply any input which is prompted for. Thus a program which generally prompts the user for values can be called directly, and each of the values can be supplied without user intervention.

Example

The DATA statement may be used in a sequence to save a file item before it is changed in the program. Since the COPY command prompts for an item name to copy to, the DATA statement is used to stack the response to the prompt.

DATA  ID : ".OLD "

EXECUTE "COPY CUSTOMERS " : ID

   .

   .

See Also

Statement and Function Reference