File Status Keys
Return Codes for Data Files & VSAM
This document provides a summary of the two-byte File-Status-Key (sometimes referred to as file return code or file status code) with a brief narrative for each code. For the COBOL environment if the FILE STATUS clause is specified in the FILE-CONTROL entry, a value is placed in the specified status key (the 2-character data item named in the FILE STATUS clause) during execution of any request on that file. The value indicates the status of that request. The value is placed in the status key before execution of any EXCEPTION/ERROR declarative or INVALID KEY/AT END phrase associated with the request.
The following tables contain file-status-key content that may be set by Micro Focus COBOL (Mainframe Express or Net Express) or an IBM Mainframe System (MVS, OS/390 or ZOS).
We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.
Copyright © 1987-2016
All Rights Reserved
The ANS/85 standard provides for a two-byte File-Status-Key. The first character of the File-Status-Key is known as status-key-1 and defines a group or category. The second character is known as status-key-2 additional detail.
Note: If status-key-1 is a nine (9) then status-key-2 is "implementor-defined". Many vendors take advantage of the x"00' to x'FF' (or 0-255) binary value. Therefore, the file status key may not always be a numeric value that is easy to display.
The combinations of possible values and their meanings are shown below with some comments where vendor additions or extensions may occur.
|Description by Group|
| || |
|0||Successful Completion or non-terminal condition that may be acceptable to continue processing. Refer to the section for Status-Key-1 being equal to "0" for additional information based on Status-Key-2.|
|1||End of File, attempting to read beyond the end of the file. Refer to the section for Status-Key-1 being equal to "1" for additional information based on Status-Key-2.|
|2||Invalid Key, an attemprt to access a file failed because the requested key is not available for processing. The error may be caused by an invalid key or the sequence of processing for a valid key. Refer to the section for Status-Key-1 being equal to "2" for additional information based on Status-Key-2.|
|3||Permanent Error, usually caused by a limit in the logical processing or a difference in the logical file definitions and the physical file. Refer to the section for Status-Key-1 being equal to "3" for additional information based on Status-Key-2.|
|4||Logic Error, a program is attempting a file access function in an improper sequence or beyond the capabilities of the physical file functions. Refer to the section for Status-Key-1 being equal to "4" for additional information based on Status-Key-2.|
|9||Implementor Defined, Many vendors take advantage of the x"00' to x'FF' (or 0-255) binary value. Therefore, the file status-key-2 may not always be a numeric value that is easy to display. Refer to the section for Status-Key-1 being equal to "9" for additional information based on Status-Key-2.|
The first character of the File-Status-Key is known as status-key-1; the second character is known as status-key-2. The combinations of possible values and their meanings are shown below.
1 & 2
|02||Indexed files only. Possible causes:
For a READ statement the key value for the current key is equal to the value of that same key in the next record in the current key of reference.
For a WRITE or REWRITE statement the record just written created a duplicate key value for at least one alternate record key for which duplicates are allowed.
|04||The length of the record being processed does not conform to the fixed file attributes for that file.|
|05||The referenced optional file is not present at the time the OPEN statement is executed.|
|06||Attempted to write to a file that has been opened for input.|
|07||Sequential files only. For an OPEN or CLOSE statement with the REEL/UNIT phrase the referenced file is a non-reel/unit medium.|
|08||Attempted to read from a file opened for output.|
|09||No room in directory or directory does not exist.|
|10||No next logical record exists. You have reached the end of the file.|
|12||Attempted to open a file that is already open.|
|13||File not found.
Also, check to see if the path to the file concerned exists (Micro Focus).
|14||Relative files only. The number of significant digits in the relative record number is larger than the size of the relative key data item described for that file.
Too many files open simultaneously (Micro Focus).
|15||Too many indexed files open (Micro Focus).|
|16||Too many device files open (Micro Focus).|
|17||Record error: probably zero length (Micro Focus).|
|18||Read part record error: EOF before EOR or file open in wrong mode (Micro Focus).|
|19||Rewrite error: open mode or access mode wrong (Micro Focus).|
|20||Device or resource busy (Micro Focus).|
|21||Sequentially accessed files only. Indicates a sequence error. The ascending key requirements of successive record key values has been violated or the prime record key value has been changed by a COBOL program between successful execution of a READ statement and execution of the next REWRITE statement for that file.|
|22||Indexed and relative files only. Indicates a duplicate key condition. Attempt has been made to store a record that would create a duplicate key in the indexed or relative file OR a duplicate alternate record key that does not allow duplicates.|
|23||Indicates no record found. An attempt has been made to access a record, identified by a key, and that record does not exist in the file. Alternatively a START or READ operation has been tried on an optional input file that is not present.|
|24||Relative and indexed files only. Indicates a boundary violation. Possible causes:
Attempting to write beyond the externally defined boundaries of a file.
Attempting a sequential WRITE operation has been tried on a relative file, but the number of significant digits in the relative record number is larger than the size of the relative key data item described for the file.
|30||The I/O statement was unsuccessfully executed as the result of a boundary violation for a sequential file or as the result of an I/O error, such as a data check parity error, or a transmission error.|
|32||Too many Indexed files opened. This can also happen when a sequential file is open for input and an attempt is made to open the same file for output.(Run Time System (RTS) message by Micro Focus).|
|34||The I/O statement failed because of a boundary violation. This condition indicates that an attempt has been made to write beyond the externally defined boundaries of a sequential file.|
|35||An OPEN operation with the I-O, INPUT, or EXTEND phrases has been tried on a non-OPTIONAL file that is not present. Trying to open a file that does not exist.
May need to map the COBOL file name to the physical file name. (Micro Focus, refer to the ASSIGN(EXTERNAL) directive).
|37||An OPEN operation has been tried on a file which does not support the open mode specified in the OPEN statement.|
|38||An OPEN operation has been tried on a file previously closed with a lock.|
|39||A conflict has been detected between the actual file attributes and the attributes specified for the file in the program.
This is usually caused by a conflict with record-length, key-length, key-position or file organization.
Other possible causes are:
1. Alternate indexes are incorrectly defined (Key length or position, duplicates or sparse parameters).
2. The Recording Mode is Variable or Fixed or not defined the same as when the file was created.
3. For files with variable-length records the minimum and maximum record lengths for the actual file may not match the minimum and maximum record lengths used by the program
|41||An OPEN operation has been tried on file already opened.|
|42||A CLOSE operation has been tried on file already closed.|
|43||Files in sequential access mode. The last I/O statement executed for the file, before the execution of a DELETE or REWRITE statement, was not a READ statement.|
|44||A boundary violation exists. Possible causes:
Attempting to WRITE or REWRITE a record that is larger than the largest, or smaller than the smallest record allowed by the RECORD IS VARYING clause of the associated file.
Attempting to REWRITE a record to a file and the record is not the same size as the record being replaced.
|45||An attempt has been made to REWRITE a record to a file, and the record is not the same size as the record being replaced.
(Micro Focus) For line sequential files this refers to the physical size of the record, that is after space removal, tab compression and null insertion. In this case, the physical size of the new record is allowed to be smaller than that of the record being replaced.
|46||A sequential READ operation has been tried on a file open in the INPUT or I-O mode but no valid next record has been established.|
|47||A READ or START operation has been tried on a file not opened INPUT or I-O.|
|48||A WRITE operation has been tried on a file not opened in the OUTPUT, I-O or EXTEND mode or on a file open I-O in the sequential access mode.|
|49||A DELETE or REWRITE operation has been tried on a file that is not opened I-O.|
The first character of the File-Status-Key is known as status-key-1. If status-key-1 is equal to 9 then status-key-2 is a one byte, binary value as defined in the following table.
|9000||00||No further information.|
|9001||01||Insufficient buffer space. Could also indicate an out of memory situation.|
|9002||02||File not open when access tried.|
|9003||03||Serial mode error.|
|9004||04||Illegal file name.
Micro Focus, the COBOL file name may not be mapped to a fully qualified PC file name. Check the ASSIGN(EXTERNAL) directive and possible environment variable setting for the COBOL file name.
|9005||05||Illegal device specification.|
|9006||06||Attempt to write to a file opened for input.|
|9007||07||Disk space exhausted.|
|9008||08||Attempt to input from a file opened for output.|
|9009||09||No room in directory or directory does not exist.|
|9010||0A||File name not supplied.|
|9012||0C||Attempt to open a file that is already open.|
|9013||0D||File not found.|
|9014||0E||Too many files open simultaneously.|
|9015||0F||Too many indexed files open.|
|9016||10||Too many device files open.|
|9017||11||Record error, probable cause is zero record length.|
|9018||12||Read partial record error: EOF before EOR or file open in wrong mode.
This can also be cause when a physical line sequential file (ASCII/Text) is being read as a sequential file and the directive SEQUENTIAL(LINE) is not set (Micro Focus).
|9019||13||Rewrite error: open mode or access mode wrong.|
|9020||14||Device or resource busy.|
|9021||15||File is a directory.|
|9022||16||Illegal or impossible access mode for OPEN.|
|9023||17||Illegal or impossible access mode for CLOSE.|
|9024||18||Disk I/O error.
Attempting to read a LINE SEQUENTIAL file as a SEQUENTIAL file(Micro Focus).
|9025||19||Operating system data error.|
|9026||1A||Block I/O error.|
|9027||1B||Device not available.|
|9028||1C||No space on device.|
|9029||1D||Attempt to delete open file.|
|9030||1E||File system is read only.|
|9031||1F||Not owner of file.|
|9032||20||Too many indexed files, or no such process.|
|9033||21||Physical I/O error.|
|9034||22||Incorrect mode or file descriptor.|
|9035||23||Attempt to access a file with incorrect permission.|
|9036||24||File already exists.|
|9037||25||File access denied.|
|9038||26||Disk not compatible.|
|9039||27||File not compatible.|
|9040||28||Language initialization not set up correctly.|
|9041||29||Corrupt index file.|
|9042||2A||Attempt to write on broken pipe.|
|9043||2B||File information missing for indexed file.
(Micro Focus) This could indicate the filename.IDX is missing.
|9044||2C||Attempt to open an NLS file using an incompatible program.|
|9045||2D||Indexed structure overflow. (Could indicate that you have reached the maximum number of duplicate keys.)|
|9066||42||Attempt to add duplicate record key to indexed file.|
|9067||43||Indexed file not open.|
|9069||45||Illegal argument to ISAM module.|
|9070||46||Too many indexed files open.|
|9071||47||Bad indexed file format.|
|9072||48||End of indexed file.|
|9073||49||No record found in indexed file.|
|9074||4A||No current record in indexed file.|
|9075||4B||Indexed data file name too long.|
|9076||4C||Internal ISAM module failure.|
|9077||4D||Illegal key description in indexed file.|
|9081||51||Key already exists in indexed file.|
|9090||5A||User does not have appropriate access permissions to the file (ANS74 and usually RM/COBOL).|
|9092||5C||A PUT for update or an ERASE was issued without a previous GET for update.|
|9100||64||Invalid file operation.|
|9101||65||Illegal operation on an indexed file.|
|9102||66||Sequential file with non-integral number of records.|
|9104||68||Null file name used in a file operation.|
|9105||69||Memory allocation error.|
|9124||7C||Connection to remote system is failing.
(Micro Focus) This could indicate a File Name is mapped to use Fileshare and the Fileshare Server has not been started.
|9125||7D||Connection to remote system file server is failing (Micro Focus)|
|9129||81||Attempt to access record zero of relative file.|
|9135||87||File must not exist.|
|9138||8A||File closed with lock - cannot be opened.|
|9139||8B||Record length or key data inconsistency.|
|9141||8D||File already open - cannot be opened.|
|9142||8E||File not open - cannot be closed.|
|9143||8F||REWRITE/DELETE in sequential mode not preceded by successful READ.|
|9146||92||No current record defined for sequential read.|
|9147||93||Wrong open mode or access mode for READ/START.|
|9148||94||Wrong open mode or access mode for WRITE. This can be caused by issuing a read after the end-of-file has been reached during sequential processing.|
|9149||95||Wrong open mode or access mode for REWRITE/ DELETE.|
|9150||96||Program abandoned at user request.|
|9151||97||Random read on sequential file.|
|9152||98||REWRITE on file not opened I-O.|
|9158||9E||Attempt to REWRITE to a line-sequential file.|
|9159||9F||Malformed line sequential-file.|
|9161||A1||File header not found.|
|9173||AD||Called program not found.|
|9180||B4||End-of-file marker error.|
|9182||B6||Console input or console output open in wrong direction.|
|9183||B7||Attempt to open line sequential file for I-O.|
|9188||BC||File name too large.|
|9193||C1||Error in variable length count.|
|9194||C2||File size too large.|
|9195||C3||DELETE/REWRITE not preceded by a READ.|
|9196||C4||Record number too large in relative or indexed file.|
|9210||D2||File is closed with lock.|
|9213||D5||Too many locks.|
|9218||DA||Malformed MULTIPLE REEL/UNIT file.|
|9219||DB||Operating system shared file limit exceeded.|
This document provides a summary of the two-byte File-Status-Key (sometimes referred to as file return code or file status code). This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.
In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives.
The documentation and software were developed and tested on systems that are configured for a SimoTime environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.
SimoTime Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SimoTime Services or Technologies please send an e-mail to: email@example.com or call 415 883-6565. We appreciate hearing from you.
Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Enterprises. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Enterprises.
SimoTime Enterprises makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Enterprises shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.
This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.
Note: A SimoTime License is required for the items to be made available on a local system or server.
The following links may be to the current server or to the Internet.
Explore the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
Explore the Assembler Connection for more examples of mainframe Assembler programming techniques and sample code.
Explore How to Obtain and Display the File Status after attempting to access a data file or VSAM data set.
Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.
The following links will require an internet connection.
A good place to start is The SimoTime Home Page via Internet Connect for access to white papers, program examples and product information.
Explore The Micro Focus Web Site via Internet Connect for more information about products and services available from Micro Focus.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
This document was created and is copyrighted and maintained by SimoTime Technologies.
If you have any questions, suggestions, comments or feedback please call or send an e-mail to: firstname.lastname@example.org
We appreciate hearing from you.
Founded in 1987, SimoTime Technologies is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems.
Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
|File Status Keys, Return Codes for Data File and VSAM|
|Copyright © 1987-2016
All Rights Reserved
|When technology complements business|