You are on page 1of 5

6.1.8.9.

1 Status key
If the FILE STATUS clause is specified in the FILE-CONTROL entry, a value is placed in the
specified status ey !the t"#-character data ite$ na$ed in the FILE STATUS clause% durin&
e'ecuti#n #f any re(uest #n that file) the value indicates the status #f that re(uest* The value is
placed in the status ey +ef#re e'ecuti#n #f any E,CE-TION.ERROR declarative #r IN/ALI0
1E2.AT EN0 phrase ass#ciated "ith the re(uest*
There are t"# status ey data-na$es* One is descri+ed +y data-na$e-3 in the FILE STATUS
clause #f the FILE-CONTROL entry* This is a t"# character data ite$ "ith the first character
n#"n as status ey 3 and the sec#nd character n#"n as status ey 4* The c#$+inati#ns #f
p#ssi+le values and their $eanin&s are sh#"n in Ta+le 56*
The #ther status ey is descri+ed +y data-na$e-7 in the FILE STATUS clause #f the FILE-
CONTROL entry* 0ata-na$e-7 d#es n#t apply t# 8SA9 files* F#r $#re inf#r$ati#n #n data-
na$e-7, see :FILE STATUS clause: in t#pic 6*4*35*
Table 34. Status key values and meanings
High-
order
digit
Meaning


Low-
order
digit
Meaning


0



























Successful
completion


























0 No further information
2














This file status value only applies to
indexed files ith alternate keys that
allo duplicates.

The input!output statement as
successfully executed" but a duplicate
key as detected. #or a $%&' statement
the key value for the current key of
reference as e(ual to the value of the
same key in the next record ithin the
current key of reference. #or a
$%)$*T% or )$*T% statement" the record
+ust ritten created a duplicate key
value for at least one alternate record
key for hich duplicates are alloed.
4



& $%&' statement as successfully
executed" but the length of the record
being processed did not conform to the
fixed file attributes for that file.
,






&n -.%N statement is successfully
executed but the referenced optional
file is not present at the time the
-.%N statement is executed. The file
has been created if the open mode is
*!- or %/T%N'. This does not apply to
0S&1 se(uential files.








2




#or a 34-S% statement ith the N-
$%)*N'" $%%456N*T" or #-$ $%1-0&4
phrase or for an -.%N statement ith
the N- $%)*N' phrase" the referenced
file as on a non!reel5unit medium.
7












&t end
condition











0





& se(uential $%&' statement as
attempted and no next logical record
existed in the file because the end of
the file had been reached" or the first
$%&' as attempted on an optional input
file that as not present.
4





& se(uential $%&' statement as
attempted for a relative file and the
number of significant digits in the
relative record number as larger than
the si8e of the relative key data item
described for the file.
2

































*nvalid key
condition
































7








& se(uence error exists for a
se(uentially accessed indexed file.
The prime record key value has been
changed by the program beteen the
successful execution of a $%&'
statement and the execution of the next
$%)$*T% statement for that file" or the
ascending re(uirements for successive
record key values ere violated.
2







&n attempt as made to rite a record
that ould create a duplicate key in a
relative file9 or an attempt as made
to rite or rerite a record that ould
create a duplicate prime record key or
a duplicate alternate record key
ithout the '6.4*3&T%S phrase in an
indexed file.
3




&n attempt as made to randomly access
a record that does not exist in the
file" or a ST&$T or random $%&'
statement as attempted on an optional
input file that as not present.
4








&n attempt as made to rite beyond the
externally defined boundaries of a
relative or indexed file. -r" a
se(uential )$*T% statement as
attempted for a relative file and the
number of significant digits in the
relative record number as larger than
the si8e of the relative key data item
described for the file.
3








































.ermanent
error
condition






































0 No further information
4



& permanent error exists because of a
boundary violation9 an attempt as made
to rite beyond the externally!defined
boundaries of a se(uential file.
,


&n -.%N statement ith the *N.6T" *!-"
or %/T%N' phrase as attempted on a
non!optional file that as not present.
2














&n -.%N statement as attempted on a
file that ould not support the open
mode specified in the -.%N statement.
.ossible violations are:

7. The %/T%N' or -6T.6T phrase as
specified but the file ould not
support rite operations.
2. The *!- phrase as specified but
the file ould not support the
input and output operations
permitted.
3. The *N.6T phrase as specified but
the file ould not support read
operations.
;

&n -.%N statement as attempted on a
file previously closed ith lock.
<










The -.%N statement as unsuccessful
because a conflict as detected beteen
the fixed file attributes and the
attributes specified for that file in
the program. These attributes include
the organi8ation of the file
=se(uential" relative" or indexed>" the
prime record key" the alternate record
keys" the code set" the maximum record
si8e" the record type =fixed or
variable>" and the blocking factor.
4













4ogic error
condition












7

&n -.%N statement as attempted for a
file in the open mode.
2

& 34-S% statement as attempted for a
file not in the open mode.
3









#or a mass storage file in the
se(uential access mode" the last
input!output statement executed for the
associated file prior to the execution
of a $%)$*T% statement as not a
successfully executed $%&' statement.

#or relative and indexed files in the
se(uential access mode" the last
input!output statement executed for the









































file prior to the execution of a '%4%T%
or $%)$*T% statement as not a
successfully executed $%&' statement.
4








& boundary violation exists because an
attempt as made to rerite a record to
a file and the record as not the same
si8e as the record being replaced" or
an attempt as made to rite or rerite
a record that as larger than the
largest or smaller than the smallest
record alloed by the $%3-$' *S 0&$?*N@
clause of the associated file!name.
A









& se(uential $%&' statement as
attempted on a file open in the input
or *!- mode and no valid next record
had been established because:

7. The preceding $%&' statement as
unsuccessful but did not cause an
at end condition
2. The preceding $%&' statement caused
an at end condition.
2


The execution of a $%&' statement as
attempted on a file not open in the
input or *!- mode.
;


The execution of a )$*T% statement as
attempted on a file not open in the
*!-" output" or extend mode.
<


The execution of a '%4%T% or $%)$*T%
statement as attempted on a file not
open in the *!- mode.
<
















*mplementor!
defined
condition














0








7. #or multithreading only: & 34-S%
of a 0S&1 or BS&1 file as
attempted on a thread that did not
open the file.

2. )ithout multithreading: #or 0S&1
only: See the information on 0S&1
return codes in the Enterprise
COBOL Programming Guide.
7 #or 0S&1 only: .assord failure.
2 4ogic error.
3

#or all files" except BS&1: $esource
not available.
,

#or all files" except BS&1: *nvalid or
incomplete file information.
A #or 0S&1 file: &n -.%N statement ith











































the -6T.6T phrase as attempted" or an
-.%N statement ith the *!- or %/T%N'
phrase as attempted for an optional
file" but no '' statement as specified
for the file.

#or BS&1 file: &n -.%N statement ith
the -6T.6T phrase as attempted" or an
-.%N statement ith the *!- or %/T%N'
phrase as attempted for an optional
file" but no '' statement as specified
for the file and the 3C4B'&=-##>
run!time option as specified.
2

#or 0S&1 only: -.%N statement execution
successful: #ile integrity verified.
;







-pen failed due to either the invalid
contents of an environment variable
specified in a S%4%3T ... &SS*@N
clause" or failed dynamic allocation.
#or more information about the
conditions under hich this status can
occur" see D&SS*@N clauseD in
topic 4.2.3.