You are on page 1of 9

VSAM Return codes

00 - Successful completion

02 - Duplicate key, non unique alt index

04 - Read, wrong length record

05 - Open, File not present

06 - Attempted to WRITE to a file that has been opened for INPUT


- The Record read from the file is longer than the Record area

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 - Directory does not exist

10 - END of File (i.e.., No next logical record exists)

12 - Attempted to OPEN a file that is Already Opened

13 - File not found

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

15 - Too many indexed files open

16 - Too many device files open

17 - Record error: probably zero length

18 - Read part record error: EOF before EOR or file open in wrong mode

19 - Rewrite error: open mode or access mode wrong

20 - Device or resource busy

21 - Sequentially accessed files only. Indicates a sequence error on write or changing


key on rewrite, invalid prime key sequence.

22 - 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

1
VSAM Return codes
23 - RECORD NOT FOUND (when we are trying to access a Record with KEY)
- 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

28 - Out of space condition is raised

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

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.

When we will use this code in our program?


When you don’t know whether file exists are not, first you will open file in I-O mode and
check status code. If it is 35 then open that file for output file. Other wise you will
continue with your logic.

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, and key-position
or file organization.
Other possible causes are:
- Alternate indexes are incorrectly defined (Key length or position, duplicates or
sparse parameters).
- The Recording Mode is Variable or Fixed or not defined the same as when the file
was created

2
VSAM Return codes

- The COLLATING SEQUENCE specified for the indexed file does not match the
actual collating sequence of the external file

40 - Insufficient Virtual Storage

41 - An OPEN operation has been tried on file that is already opened


- A DELETE record was rejected because the file was in an READ mode

42 - A CLOSE operation has been tried on file that is 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(i.e.., 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.
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 - Sequential Read without positioning i.e.., 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 - Reading file 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
- A file opens in 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

72 - You attempted to access only the data portion of the VSAM cluster

88 - A request was issued for which VSAM was not properly positioned. This error code
is almost always the result of lost positioning that is due to a previous logical error.

90 - Open error code. An uncorrectable I/O error occurred while VSAM was Reading or
Writing a catalog record

3
VSAM Return codes

91 - Don’t have authorization for VSAM dataset

92 - A duplicate open was rejected by a system which does or not allow the external file
to be opened twice.
- A DELETE FILE was rejected because the file was in an open mode

93 - VSAM Resource Not Available i.e,


- An open was rejected because file lock conflicts with another user
Possible reasons:
- An OPEN WITH LOCK was attempted on a file which is already open.
- An OPEN without lock was attempted and the file is already open WITH LOCK.
- The file could not be opened because another file in the same area is currently open.

94 - Sequential read after end of file or no file position indicator for sequential request

96 - Changing the Prime Key or Key of Reference when making an update

97 - OPEN OK, FILE INTEGRITY VERIFIED

When we will use this in our programs?


We use this code whenever we open the file, if status code is 00 or 97 we will precede
with our logic, other wise, and call error routine. Usually, it may come when file was not
closed.
For example
IF WS-FILE-STATUS NOT = '00' AND '97'
PERFORM ERROR-ROUTINE
END-IF.

98 - Open failed due to either the invalid contents of an environment variable specified
in a SELECT ... ASSIGN clause, or failed dynamic allocation.
For more information about the conditions under which this status can occur see the
"ASSIGN clause"

99 - Abnormal termination (This is an internal processing error)

4
VSAM Return codes

VSAM Logical error codes:


These codes indicate VSAM errors. They appear on the JOB log.

004(04):
Read past end of file
008(08):
You attempted to store a record with a Duplicate Key, or there is a duplicate record for an
alternate index with the unique key option.
012(0C):
You attempted to store a record out of Ascending Key Sequence in Skip-Sequential
Mode; record had a Duplicate Key; for Skip-Sequential processing your GET, PUT, and
POINT Requests are not referencing records in Ascending Sequence; or, for Skip-
Sequential Retrieval, the key requested is lower than the previous key requested. For
Shared Resources, buffer pool is full.
016(10)
Record not found.

020(14)
Record already held in exclusive control by another requester.
024(18)
Record resides on a volume that cannot be mounted.

028(1C)
Data set cannot be extended because VSAM can't allocate additional Direct-Access
Storage Space. Either there is not enough space left to make the secondary allocation or
you attempted to increase the size of a data set while processing SHROPT=4 and
DISP=SHR.

036(24)
Key Ranges were specified for the data set when it was defined but no range was
specified that includes the record to be inserted.

040(28)
Insufficient Virtual Storage to complete the request.

044(2A)
Work area too small

064(40)
All available strings are in use.

068(44)
You attempted to use a type of processing (Output or Control-Interval Processing) that
was not specified when the data set was opened.

5
VSAM Return codes

074(4A)
Trying to use keys on ESDS or RRDS.

076(4C)
You issued an Addressed or Control-Interval PUT to add to a Key-Sequenced data set, or
issued a Control-Interval put to a Relative Record data set.

080(50)
Trying to delete from ESDS.

084(54)
Using OPTCODE=LOC for a PUT.

088(58)
You issued a Sequential GET request without having caused VSAM to be positioned for
it, or you changed from Addressed Access to Keyed Access without causing VSAM to be
positioned for Keyed-Sequential Retrieval; there was no Sequential PUT insert for a
Relative Record data set, or you attempted an illegal switch between forward and
backward processing.

092(5C)
A PUT for update or an ERASE was issued without a previous GET for update, or a
PUTIX was issued without a previous GETIX.

096(60)
Changing the Prime Key or Key of Reference when making an update.

100(64)
Trying to change record length.

104(68)
The RPL options are either invalid or conflicting.

108(6C)
RECLEN specified was larger than the maximum allowed, equal to 0, or smaller than the
sum of the length and the displacement of the key field; RECLEN was not equal to record
(SLOT) size specified for a Relative Record data set.

112(70)
Invalid key length.

16(74)
Trying to update an empty dataset.

120(78)
Request was submitted by the wrong task.

6
VSAM Return codes

132(84)
An attempt was made in Locate Mode to retrieve a Spanned Record.

136(88)
You attempted an Addressed GET of a Spanned record in a Key-Sequenced data set.

140(8C)
Inconsistent Spanned record.

144(90)
Invalid pointer (no associated base record) in an Alternate Index.

148(94)
Maximum number of Alternate Index pointers exceeded.

152(98)
Not enough buffers available.

156(9C)
Invalid control interval.

192(C0)
Invalid Relative Record number in a RRDS dataset.

196(C4)
Addressed access to a Relative Record (RRDS) dataset is not allowed.

200(C8)
Addressed Access or Generic Backward processing by Key thru a path is not allowed.

204(CC)
Attempting a PUT in backward mode.

252(FC)
Record mode processing is not allowed for a Linear data set.

7
VSAM Return codes

VSAM Open error codes

136(88)
Not enough Virtual-Storage Space is available for Work Areas, Control Blocks, or
Buffers.

144(90)
An uncorrectable I/O error occurred while VSAM was Reading or Writing a catalog
record.

148(94)
No record for the data set to be opened was found in the available catalog(s) or an
unidentified error occurred while VSAM was searching the catalog.

152(98)
Security Verification failed; the password specified in the Access-Method Control Block
for a specified level of access does not match the password in the catalog for that level of
access.

164(A4)
An uncorrectable I/O error occurred while VSAM was Reading the Volume Label.

168(A8)
The data set is not available for the type of processing you specify, or an attempt was
made to open a Reusable data set with the Reset option while another user had the data
set.

176(B0)
An error occurred while VSAM was attempting to fix a page of Virtual storage in Real
storage.

180(B4)
A VSAM catalog specified in JCL either does not exist or is not open, and no record for
the data set to be opened was found in any other catalog.

184(B8)
An uncorrectable I/O error occurred while VSAM was completing an I/O request.

188(BC)
The data set indicated by the Access-Method Control Block is not of the type that may be
specified by an Access-Method Control Block.

192(C0)
An unusable data set was opened for output.

8
VSAM Return codes

232(E8)
Reset was specified for a no reusable data set and the data set is not empty.

236(EC)
A permanent Staging error occurred in MSS (Acquire).

244(F4)
The Volume containing the Catalog Recovery area was not mounted and verified for
output processing.

VSAM Special codes:

301 - There was insufficient memory available to initiate a sort or merge process.

302 - Fewer than three intermediate files were available to begin a SORT statement.
The sort procedure cannot begin unless it is able to create at least 3 intermediate
files.

303 - A record read from a MERGE file or SORT USING file was not long enough to
include all the keys.

304 - Too many out of sequence records were passed to the sort process. Use the B
Runtime Command Operation to increase the memory available to sort; or divide
the records to be sorted into several files, sort the several files, and merge the
resulting files.

305 - A SORT or MERGE statement was attempted while a sort or merge process was
already active.

306 - A RELEASE or RETURN statement was attempted and no sort or merge was
active.

307 - A RELEASE or RETURN statement was attempted for a sort or merge description
other than the one currently being sorted or merged.

308 - A RELEASE statement was attempted in an OUTPUT PROCEDURE, or a


RETURN statement was attempted in an INPUT PROCEDURE.

309 - A RETURN statement was attempted in an OUTPUT PROCEDURE after the


at end condition was returned on the sort or merge file.

310 - An application I/O statement was attempted on a file currently opened as a sort or
merge USING or GIVING

You might also like