Previous Topic Next topic Print topic


RM/COBOL File Status Codes

RM/COBOL file status codes take a 2-digit form in the file status variable, by combining the values of the Status Key 1 and 2 columns, or a 4-character or 11-character extended file status code, which can be retrieved using the C$RERR standard library routine.

RM/COBOL file status codes are always returned when the FILETYPE=21 Compiler directive is in effect. If you set the DIALECT"RM" Compiler directive, this automatically sets FILETYPE=21, thus producing RM/COBOL file status codes.

If you are running under a different dialect or FILETYPE setting, but want to continue to return RM/COBOL file status codes, do the following:
  • Set environment variable COBFSTATCONV to the RM/COBOL setting:
    set COBFSTATCONV=rmstat
  • Set the COBFSTATCONV Compiler directive.
Status Key 1 Status Key 2 Extended File Status Code Description
3 5 9/013 File not found.
3 5 9/188 Filename too large.
3 7 9/035 Incorrect access permission.
3 7 9/037 File access denied.
3 8 9/138 File is closed with lock - cannot open.
3 8 9/210 File is closed with lock.
4 1 9/141 File already open - cannot be opened.
4 2 9/142 File not open - cannot be closed.
4 3 9/143 REWRITE/DELETE not after successful READ
4 6 9/146 No current record defined for sequential read.
4 7 9/147 Wrong open or access mode for READ/ START.
4 8 9/148 Wrong open or access mode for WRITE.
4 9 9/149 Wrong open or access mode for REWRITE/ DELETE.
9 3 9/065 File locked.
9 8 9/071 Bad indexed file format.
9 8 9/139 Record length or key inconsistent.
9 9 9/068 Record is locked.
Previous Topic Next topic Print topic