You are on page 1of 10

Compaq COBOL

Reference Manual
Previous

Contents

Index

Appendix C
File Status Values
This appendix summarizes the values that can appear in FILE STATUS data items. The
entry for each statement describes specific causes for each condition.
You may receive different file status values depending upon whether you use the
standard compiler option with the v3 or 85 setting. Table C-1 lists all file status values
in numeric order for the default 85 setting. Table C-2 lists the corresponding file status
values for the v3 and 85 settings.
For more information about the standard compiler option, on a Tru64 UNIX system, see
the COBOL man page. On an OpenVMS Alpha or Windows NT system, invoke the
Compaq COBOL online help file.
Table C-1 I-O File Status Values for the Default -std 85 Flag or /STANDARD =85
Qualifier Option
File Input/Output
File
Access
Status Statements Organization Mode

Meaning

00

All

All

All

Successful

02

REWRITE
WRITE

Ind

All

Created duplicate alternate key

02

READ

Ind

All

Detected alternate duplicate key

04

READ

All

All

Record not size of user's buffer

05

OPEN

All

All

Optional file not present

07

CLOSE
OPEN

All

All

Invalid file organization or device

10

READ

All

Seq

No next logical record or option file not
present (at end)

14

READ

Rel

All

Relative record number too large

or incompatible open mode 90 All All All Record locked by another user (record available) 91 OPEN All All Open is unsuccessful. Rel Ran Record not in file.21 REWRITE Ind Seq Primary key changed after READ 21 WRITE Ind Seq Attempted nonascending key value (invalid key) 22 REWRITE Ind All Duplicate alternate key (invalid key) 22 WRITE Ind. file locked by another access stream 92 DELETE READ REWRITE START WRITE All All Record locked by another user (record not available) . optional file not present (invalid key) 24 WRITE Ind. Rel All Boundary violation or relative record number too large (invalid key) 30 All All All All other permanent errors 34 WRITE Seq Seq Boundary violation 35 OPEN All All File not found 37 OPEN All All Inappropriate device type 38 OPEN All All File previously closed with lock 39 OPEN All All Conflict of file attributes 41 OPEN All All File already opened 42 CLOSE All All File not opened 43 DELETE REWRITE All Seq No previous READ or START 44 REWRITE WRITE All All Invalid record size 46 READ All Seq No valid next record (at end) 47 READ START All All File not open. or incompatible open mode 48 WRITE All All File not open. Rel Ran Duplicate key (invalid key) 23 DELETE READ REWRITE START Ind. or incompatible open mode 49 DELETE REWRITE All All File not open.

00 44 READ fails---no next logical record (EOF detected). or incompatible open mode 95 OPEN All All No file space on device Table C-2 I-O File Status Values for the V3 and 85 Options I-O Error Condition Status Value V3 85 READ successful---record shorter than fixed file attribute. 93 43 OPEN fails---file previously closed with LOCK. 94 42 DELETE or REWRITE fails---previous I-O not successful READ. 25 23 READ successful---record longer than fixed file attribute. 00 07 READ fails---relative key digits exceed relative key. 30 44 CLOSE fails---file not currently open. . 30 04 OPEN on relative or indexed file that is not mass storage. 94 39 OPEN fails---file created with different prime record key. 00 24 OPEN I-O on file that is not mass storage. 94 39 OPEN fails---file currently open. or I-O. 94 39 OPEN fails---file created with different alternate record keys. 94 38 OPEN fails---file created with different organization.93 UNLOCK All All No current record 94 UNLOCK All All File not open. 94 49 OPEN INPUT on a nonoptional file---file not found. 16 10 1 46 1 READ or START fails---optional input file not present. or the Compaq COBOL User Manual for the description of the -std flag. 00 04 CLOSE reel/unit attempted on nonreel/unit device. 94 48 DELETE or REWRITE fails---file not opened I-O. 97 35 1 See the description of the /STANDARD qualifier in the COBOL online HELP file. 00 37 WRITE fails---attempt to write a record of a different size than in the file description. for information about the No Valid Next Record Condition. 15 10 READ fails---no valid next record (already at EOF). 94 41 READ or START fails---file not opened INPUT or I-O. 16 READ NEXT or sequential READ---no valid next record pointer. 30 37 REWRITE fails---attempt to rewrite record of different size. 13 10 READ fails---no next logical record (EOF on OPTIONAL file). 00 14 WRITE fails---relative key digits exceed relative key. EXTEND. 94 47 WRITE fails---file not opened OUTPUT.

Consequently. fit test rules are specified only within the Body Group Presentation Rules Table. read a presentation rules table from left to right along the selected row. In addition. DETAIL report groups.1 Organization There is an individual presentation rules table for each of the following types of report groups: REPORT HEADING. and REPORT FOOTING. The applicable rules columns of a presentation rules table are divided into two parts. The first part specifies the rules that apply if the report description contains a PAGE clause. PAGE HEADING. CONTROL HEADING report groups. and CONTROL FOOTING report groups are treated jointly in the Body Group Presentation Rules Table. Columns 1 and 2 of a presentation rules table list all of the permissible combinations of LINE NUMBER and NEXT GROUP clauses for the designated report group type. Therefore.Appendix D Report Writer Presentation Rules and Tables The tables and rules in this appendix specify the following:    The permissible combinations of LINE NUMBER and NEXT GROUP clauses for each type of report group The requirements for the use of these clauses The interpretation that the Report Writer Control System (RWCS) gives to these clauses D. The explanation of the rules named in the applicable rules columns follows:   Upper-limit rules and lower-limit rules: These rules specify the vertical subdivisions of the page within which the RWCS may present the specified report group when the PAGE clause is used. to identify the set of presentation rules that applies to a particular combination of LINE NUMBER and NEXT GROUP clauses. The RWCS applies the fit . Fit test rules: The fit test rules are applicable only to body groups when the PAGE clause is included in the Report Description entry. and the second part specifies the rules that apply if the PAGE clause is omitted. PAGE FOOTING.

they refer to a sequence of LINE NUMBER clauses that consist of the two specified consecutive sequences. The letter A represents one or more absolute LINE NUMBER clauses that appear in consecutive order within the sequence of LINE NUMBER clauses in the Report Group Description entry. The letters NP represent one or more absolute LINE NUMBER clauses that appear in consecutive order within the sequence of LINE NUMBER clauses within the NEXT PAGE phrase appearing in the first. Final LINE-COUNTER setting rules: These rules specify the values that the RWCS places in LINE-COUNTER after presenting report groups.3 LINE NUMBER Clause Sequence Substitutions . 2. For example. and only the first. LINE NUMBER clause. The letter R represents one or more relative LINE NUMBER clauses that appear in consecutive order within the sequence of LINE NUMBER clauses in the Report Group Description entry. Next group rules: The next group rules relate to the proper use of the NEXT GROUP clause. None of the absolute LINE NUMBER clauses may have a NEXT PAGE phrase. D. D. 4. this is determined by the general rules of the LINE NUMBER clause. First print line position rules: The first print line position rules specify where on the page the RWCS presents the first print line of the given report group. When two abbreviations appear together. The presentation rules tables do not specify where on the page the RWCS presents the second and subsequent print lines (if any) of a report group. A R refers to a Report Group Description entry within which the A sequence (defined in rule 1) is immediately followed by the R sequence (defined in rule 2).   test rules to determine whether the designated body group can be presented on the page on which the report is currently positioned. The meaning of the abbreviations used in column 1 is as follows: 1.2 LINE NUMBER Clause Notation Column 1 of the presentation rules table uses a shorthand notation to describe the sequence of LINE NUMBER clauses that may appear in the description of a report group. 5. 3. A blank entry indicates that the clause is absent from the Report Group Description entry.

After page-advance processing. When an absolute NEXT GROUP clause specifies a vertical positioning value that cannot be accommodated on the current page. NP is also permissible.4 Saved-Next-Group-Integer Description Saved-next-group-integer is a data item that is addressable only by the RWCS. and the same presentation rules apply. Figure D-1 REPORT HEADING Group Presentation Rules .Where A R is a permissible sequence in the presentation rules table. and the same presentation rules apply. D. D. the RWCS positions the next body group using the value stored in saved-next-group-integer. the RWCS stores that value in saved-next-groupinteger. Where NP R is a permissible sequence in the presentation rules table. A is also permissible.5 REPORT HEADING Group Presentation Rules Figure D-1 points to the appropriate presentation rules for all permissible combinations of LINE NUMBER and NEXT GROUP clauses in a REPORT HEADING report group.

b. 3. The first print line of the REPORT HEADING report group is presented on the line number specified by the integer of its LINE NUMBER clause. Upper-limit rule: The first line number on which the REPORT HEADING report group can be presented is the line number specified by the HEADING phrase of the PAGE clause. The last line number on which the REPORT HEADING report group can be presented is the line number specified by page-size of the PAGE clause. Lower-limit rules: a. The last line number on which the REPORT HEADING report group can be presented is the line number that is obtained by subtracting 1 from the first-detail-line value of the FIRST DETAIL phrase of the PAGE clause. . First print line position rules: a.REPORT HEADING Group Presentation Rules 1. 2.

b. The sum of the NEXT GROUP integer and the line number on which the final print line of the REPORT HEADING report group is presented must be less than the value of first-detail-line of the FIRST DETAIL phrase of the PAGE clause. The first print line of the REPORT HEADING report group is presented on the line number obtained by adding the contents of its LINECOUNTER (in this case. the RWCS places zero into LINE-COUNTER as the final LINE-COUNTER setting. The NEXT GROUP integer must be greater than the line number on which the final print line of the REPORT HEADING report group is presented. . The REPORT HEADING report group is not presented. After the REPORT HEADING report group is presented. c. Final LINE-COUNTER setting rules: a. the NEXT GROUP integer must be less than the line number specified by first-detail-line of the FIRST DETAIL phrase of the PAGE clause. LINE-COUNTER is unaffected by the processing of a nonprintable report group. e. the final LINECOUNTER setting is the line number on which the final print line of the REPORT HEADING report group was presented. NEXT GROUP NEXT PAGE signifies that the REPORT HEADING report group will appear by itself on the first page of the report. d. the RWCS places the sum of these two items into LINE-COUNTER as the final LINE-COUNTER setting:  The NEXT GROUP integer  The line number on which the final print line of the REPORT HEADING report group was presented c. After the REPORT HEADING report group is presented. 4. b. the RWCS places the NEXT GROUP integer into LINE-COUNTER as the final LINE-COUNTER setting. The RWCS processes no other report group while positioned at the first page of the report. After the REPORT HEADING report group is presented. Next group rules: a. 5. In addition.b. zero) to the integer of the first LINE NUMBER clause. d. The first print line of the REPORT HEADING report group is presented on the line number obtained by adding the integer of the first LINE NUMBER clause and the value obtained by subtracting 1 from the heading-line value of the HEADING phrase of the PAGE clause. After the REPORT HEADING report group is presented. c.

Otherwise. Lower-limit rule: The last line number on which the PAGE HEADING report group can be presented is the line number obtained by subtracting 1 from the first-detail-line value of the FIRST DETAIL phrase of the PAGE clause. 2.6 PAGE HEADING Group Presentation Rules Figure D-2 shows the appropriate presentation rules for all permissible combinations of LINE NUMBER and NEXT GROUP clauses in a PAGE HEADING report group. the first line number on which the PAGE HEADING report group can be presented is the line number specified by the HEADING phrase of the PAGE clause. First print line position rules: . 3. then the first line number on which the PAGE HEADING report group can be presented is one greater than the final LINE-COUNTER setting established by the REPORT HEADING.D. Upper-limit rule: If a REPORT HEADING report group has been presented on the page on which the PAGE HEADING report group is to be presented. Figure D-2 PAGE HEADING Group Presentation Rules Table PAGE HEADING Group Presentation Rules 1.

then the sum of the following two items defines the line number on which the first print line of the PAGE HEADING report group is presented:  The final LINE-COUNTER setting established by the REPORT HEADING report group  The integer of the first LINE NUMBER clause of the PAGE HEADING report group Otherwise. The first print line of the PAGE HEADING report group is presented on the line number specified by the integer of its LINE NUMBER clause. the sum of the following two items defines the line number on which the first print line of the PAGE HEADING report group is presented:   The integer of the first LINE NUMBER clause of the PAGE HEADING report group The value obtained by subtracting 1 from the heading-line value of the HEADING phrase of the PAGE clause c.a. b. 4. Final LINE-COUNTER setting rules: a. Previous Next Contents Index . b. The final LINE-COUNTER setting is the line number on which the final print line of the PAGE HEADING report group was presented. If a REPORT HEADING report group has been presented on the page on which the PAGE HEADING report group is to be presented. The PAGE HEADING report group is not presented. LINE-COUNTER is unaffected by the processing of a nonprintable report group.