%ERROR (Return Error Condition)
%ERROR returns '1' if the most recent operation with extender 'E' specified resulted in an error condition. This is the same as the error indicator being set on for the operation. Before an operation with extender 'E' specified begins, %ERROR is set to return '0' and remains unchanged following the operation if no error occurs. All operations that allow an error indicator can also set the %ERROR built-in function. The CALLP operation can also set %ERROR.
For examples of the %ERROR built-in function, see Figure 1 and Figure 2.
For more information, see Result Operations or Built-in Functions.
The operations that set %ERROR are:
- ACQ (Acquire)
- ADDDUR (Add Duration)
- ALLOC (Allocate Storage)
- CALL (Call a Program)
- CALLB (Call a Bound Procedure)
- CALLP (Call a Prototyped Procedure or Program)
- CHAIN (Random Retrieval from a File)
- CHECK (Check Characters)
- CHECKR (Check Reverse)
- CLOSE (Close Files)
- COMMIT (Commit)
- DEALLOC (Free Storage)
- DELETE (Delete Record)
- DSPLY (Display Message)
- EXFMT (Write/Then Read Format)
- EXTRCT (Extract Date/Time/Timestamp)
- FEOD (Force End of Data)
- IN (Retrieve a Data Area)
- NEXT (Next)
- OCCUR (Set/Get Occurrence of a Data Structure)
- OPEN (Open File for Processing)
- OUT (Write a Data Area)
- POST (Post)
- READ (Read a Record)
- READC (Read Next Changed Record)
- READE (Read Equal Key)
- READP (Read Prior Record)
- READPE (Read Prior Equal)
- REALLOC (Reallocate Storage with New Length)
- REL (Release)
- RESET (Reset)
- ROLBK (Roll Back)
- SCAN (Scan String)
- SETGT (Set Greater Than)
- SETLL (Set Lower Limit)
- SUBDUR (Subtract Duration)
- SUBST (Substring)
- TEST (Test Date/Time/Timestamp)
- UNLOCK (Unlock a Data Area or Release a Record)
- UPDATE (Modify Existing Record)
- WRITE (Create New Records)
- XLATE (Translate)