Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?


Accepts input and stores it in a variable.


Input data


data Either the name of a variable used to receive the data input, or a quoted string specifying the data.


The Input statement inputs a literal data value. It can interactively receives a data value from the user into a variable, or it can input a specified quoted string.

Input with a variable cannot be used in a program running in background. Program execution is paused until the user indicates the end of data input and submits the data value by pressing the Return key.

Input does not time out.

The ObjectScript READ command provides more extensive support for interactive user input.


The following example illustrates the interactive use of the Input statement:

Println "Type your name, then press Return"
Input namevar
Println "Thanks ",namevar

The following example illustrates the background use of the Input statement:

Println "Here's the name"
Input "Fred"
Println "Thanks "

See Also

  • Basic: Print statement

  • ObjectScript: READ command