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?


Receives data from input buffer.


INPUTIF [@(col[,row])] variable [,length [_]] [:] [format]
           {THEN statements | ELSE statements}

INPUTIF variable,-1  {THEN statements | ELSE statements}


The INPUTIF statement is used to receive data from the input buffer. While it can be used for interactive user input, this usage is not recommended.

INPUT and INPUTIF are similar, with the following differences:

  • INPUTIF does not display a prompt when awaiting user input. INPUT displays a prompt.

  • INPUTIF does not support timeout clause syntax. For this reason, it should not be used for interactive user input in most circumstances. INPUT supports timeout.

  • INPUTIF requires either a THEN clause, an ELSE clause, or both. For INPUT the THEN clause and ELSE clause are optional.

  • INPUTIF takes the THEN clause when the Enter key is pressed without typing user input data. INPUT takes the ELSE clause if length is not -1 and the Enter key is pressed without typing user input data.

For further details on INPUTIF, refer to the INPUT statement.

See Also