When working with ACUCOBOL-GT products and files we soon discover than a file status is defined as a pic x(2). In many cases we can receive extended file status going farther than those two characters.
How can we recover those values and where do they come from?
If you want to recover extended file statuses, you have to use an ACUCOBOL-GT routine called "C$RERR".
USING EXTEND-STAT, TEXT-MESSAGE, STATUS-TYPE
EXTEND-STAT (returned): PIC X(5) or larger; PIC X(7) or larger under VMS
TEXT-MESSAGE (returned): PIC X(n)
STATUS-TYPE (input): Numeric parameter
When do we need to use it and why?
There are several cases, but the most often ones are:
Another way to recover the error is from outside the program, by performing a trace with the runtime option "-x".