%STATUS (Return File or Program Status)
%STATUS{(file_name)}
%STATUS returns the most recent value set for the program or file status. %STATUS is set whenever the program status or any file status changes, usually when an error occurs.
If %STATUS is used without the optional file_name parameter, then it returns the program or file status most recently changed. If a file is specified, the value contained in the INFDS *STATUS field for the specified file is returned. The INFDS does not have to be specified for the file.
%STATUS starts with a return value of 00000 and is reset to 00000 before any operation with an 'E' extender specified begins.
%STATUS is best checked immediately after an operation with the 'E' extender or an error indicator specified, or at the beginning of an INFSR or the *PSSR subroutine.
For more information, see File Operations, Result Operations, or Built-in Functions.
- 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)