Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

CLEARDATA

Clears all data stored by the DATA statement.

Synopsis

CLEARDATA

Arguments

None.

Description

The CLEARDATA statement flushes (clears) all remaining data stored in the input stack by the DATA statement. Following CLEARDATA, the INPUT statement issues a user prompt, rather than automatically receiving data stored by the DATA statement.

Examples

The following example illustrates the use of the CLEARDATA statement:

DATA "New York","Chicago","","Annapolis"
FOR x=1 TO 4
  INPUT cityname
  IF cityname=""
   THEN CLEARDATA
   PROMPT "Missing name: "
   INPUT cityname
  ELSE
   PRINT cityname
NEXT
Copy code to clipboard

See Also