HP 3000 Manuals

Configuration Section (Cont.) [ Micro Focus COBOL Language Reference ] MPE/iX 5.0 Documentation


Micro Focus COBOL Language Reference

Configuration Section (Cont.) 

Input-Output Section (Cont.) 

General Rules (Cont.).   

Format 1 (Record Sequential Files).   

18.     The MULTIPLE REEL or MULTIPLE UNIT phrase must be specified if it
        is possible or intended that the file can be closed by use of the
        CLOSE REEL or CLOSE UNIT statement.

19.     Records in the file are accessed in the sequence specified by
        predecessor-successor record relationships which are established
        by the execution of WRITE statements when the file is created or
        extended.

20.     For MF only:    Using the LINE ADVANCING FILE phrase causes a
        file suitable for a printer to be produced.  This file will have
        an initial carriage-return character, and each record is written
        with AFTER ADVANCING 1 LINE as the default advancing phrase.  See
        your COBOL System Reference for further details of the format.

21.     For MF only:    The PADDING CHARACTER 
        clause is documentary only .

        For ANS85 only:  If the associated file connector is an external
        file connector, all PADDING CHARACTER clauses in a run unit which
        are associated with that file connector must have the same
        specification.  If data-name-5 is external, it must reference an
        external data item.

22.     For MF only:    The RECORD DELIMITERclause is documentary only.

For MF only:  Format 2 (Line Sequential Files).   

23.     When LINE SEQUENTIAL ORGANIZATIONis specified either implicitly
        or explicitly, the file is treated as consisting of fixed length
        records, each containing one line of data.  The records are
        stored with trailing spaces removed.  The definition of a line of
        data varies among different operating systems.  Some terminate
        line "records " with one or both of the Carriage Return and Line
        Feed characters, and some pad out as fixed length records.  Your
        COBOL system, therefore, always produces files which are
        compatible in this respect with the editor software in any
        operating system.

24.     The LOCK MODE IS clause is documentary only.

Format 3 (Relative Files).   

25.     When access mode is sequential, records in the file are accessed
        in order of ascending relative record numbers of existing records
        in the file.

26.     When access mode is random, the value of the RELATIVE KEY data
        item indicates the record to be accessed.

27.     All records stored in a relative file are uniquely identified by
        relative record numbers, which also specify the record's logical
        ordinal position in the file.  The first logical record has a
        relative record number of 1, and subsequent logical records have
        relative record numbers of 2, 3, 4,....

28.     The data item specified by data-name-5 is used to communicate a
        relative record number between the user and the operating system.

Format 4 (Indexed Files).   

29.     When access mode is sequential, records in the file are accessed
        in order of ascending record key values within a given key of
        reference.

30.     When access mode is random, the value of the record key data item
        indicates the record to be accessed.

31.     The RECORD KEYclause specifies the record key that is the prime
        record key for the file.  The values of the prime record key must
        be unique among records of the file.  This prime record key
        provides an access path to records in an indexed file.

32.     If the file has more than one record description entry,
        data-name-1 need be described only in one of these record
        description entries.  The identical character positions
        referenced by data-name-1 in any one record description entry are
        implicitly referenced as keys for all other record description
        entries of that file.

33.     For ANS85 only:  If the associated file connector is an external
        file connector, all file description entries in the run unit
        which are associated with that file connector must specify the
        same data description entry for data-name-1 with the same
        relative location in the associated record .

34.     The ALTERNATE RECORD KEYclause specifies a record key that is an
        alternative record key for the file.  This alternate record key
        provides an alternative access path to records in an indexed
        file.

35.     The data description of data-name-5  or split-key-name-1 (MF) and
        data-name-8 or split-key-name-2,(MF) as well as of relative
        locations within a record, must be the same as that used when the
        file was created.  The number of alternate keys for the file must
        also be the same as that used when the file was created.  This
        checking is configurable (see your COBOL System Reference for
        details).

36.     The DUPLICATES phrase specifies that the value of the associated
        record key can be duplicated within any of the records in the
        file.  If the DUPLICATES phrase is not specified, the value of
        the associated record key must not be duplicated among any of the
        records in the file.

37.     For duplicate values, the correct duplicate entry must be located
        using sequential reads from the first duplicate entry.

Format 5 (Sort-Merge Files).   

38.     The file-control entry names a sort or merge file and specifies
        the association of the file to a storage medium.

39.     For MF only:    When the SORT STATUSclause is specified, a value
        is placed into the two-character data item specified by
        data-name-2 after the execution of each sort operation.  This
        value indicates the status at completion of the operation .

        The resulting status of the sort operation is indicated by valid
        combinations of status keys 1 and 2.  For explanations of status
        keys 1 and 2 and definitions of status, see the section I/O 
        Status earlier in this chapter .

        The following combinations of status keys are possible.  Status
        key 1=0 and status key 2=0 indicates successful completion.
        Status key 1=3 and status key 2=0 indicates a permanent error.
        If status key 1=9, status key 2 contains an operating system
        error message number.

        The FILE STATUSclause can be used instead of a SORT STATUS
        clause, but is treated as a synonym for it, when specified for a
        SORT or merge file.

40.     The ASSIGN clause is documentary only.

The I-O-CONTROL Paragraph.   

Function.   

The I-O-CONTROL paragraph specifies the points at which rerun is to be
established, the memory area which is to be shared by different files,
and for files with sequential organization the location of files on a
multiple file reel.

For ANS85 only:  The RERUN and MULTIPLE FILE TAPE clauses of the
I-O-CONTROL paragraph are classed as obsolete elements in the ANSI'85
standard and are scheduled to be deleted from the next full revision of
the ANSI Standard.

For MF only:    All dialects within this COBOL implementation fully
support this syntax.  Refer to your COBOL System Reference for details on
using the FLAGSTD directive to detect all occurrences of this syntax .

For XOPEN only:  Although they are a part of the standard COBOL
definition, the RERUN and MULTIPLE FILE TAPE clauses are explicitly
excluded from the X/Open COBOL language definitions and should not be
used in a conforming X/Open COBOL source program.

General Format.   

[]
Syntax Rules. 1. The I-O-CONTROL paragraph is optional. 2. When either the integer-1 RECORDS clause or the integer-2 CLOCK-UNITS clause is specified, character-string must be given in the RERUN clause. 3. In the SAME AREA clause, SORT and SORT-MERGE are equivalent. 4. If the SAME SORT AREA or SAME SORT-MERGE AREA clause is used, at least one of the file-names must represent a sort or merge file. Files that do not represent sort or merge files can also be named in the clause. 5. The two forms of the SAMEclause (SAME AREA, SAME RECORD AREA) are considered separately in the following: More than one SAME clause can be included in a program, subject to the following restrictions: a. A file-name must not appear in more than one SAME AREAclause. b. A file-name must not appear in more than one SAME RECORD AREAclause. c. If one or more file-names of a SAME AREA clause appear in a SAME RECORD AREA clause, all of the file-names in that SAME AREA clause must appear in the SAME RECORD AREA clause. However, additional file-names not appearing in that SAME AREAclause can also appear in that SAME RECORD AREA clause. The rule that only one of the files mentioned in a SAME AREA clause can be open at any one time takes precedence over the rule that all files mentioned in a SAME RECORD AREA clause can be open at any one time. d. A file-name that represents a SORT or MERGE file must not appear in a SAME AREA clause. e. A file-name that represents a sort or merge file must not appear in more than one SAME SORT AREA or SAME SORT-MERGE AREA clause. f. If a file-name that does not represent a sort or merge file appears in a SAME AREAclause and one or more SAME SORT AREA or SAME SORT-MERGE AREA clauses, all of the files named in that SAME AREA clause must be named in that SAME SORT AREA or SAME SORT-MERGE AREA clause(s). 6. The files referenced in the SAME AREA, SAME SORT AREA, SAME SORT-MERGE AREA, or SAME RECORD AREA clause need not all have the same organization or access. 7. For MF only: Character-string must not be a reserved word, a literal or a user-name. 8. The END OF REEL/UNIT clause can only be used if file-name-2 is a sequential file. 9. More than one RERUN clause can be specified for a given file-name-2, subject to the following restrictions: a. When multiple integer-1 RECORD clauses are specified, no two of them can specify the same file-name-2. b. When multiple END OF REEL or END OF UNIT clauses are specified, no two of them can specify the same file-name-2. 10. Only one RERUN clause containing the CLOCK-UNITS clause can be specified. 11. For OSVS and VSC2 only: Each clause in the I-O-CONTROL paragraph may optionally be followed by a period. General Rules. 1. For MF only: The RERUN clause is documentary only . 2. The SAME AREA clause specifies that two or more files that do not represent sort or merge files are to use the same memory area during processing. The area being shared includes all storage area assigned to the files specified. It is not, therefore, valid to have more than one of the files open at the same time. (See Syntax Rule 5c.) 3. The SAME RECORD AREA clause specifies that two or more files are to use the same memory area for processing the current logical record. All of the files can be open at the same time. A logical record in the SAME RECORD AREA is considered as a logical record of each opened output file whose file-name appears in this SAME RECORD AREA clause and of the most recently read input file whose file-name appears in this SAME RECORD AREA clause. This is equivalent to an implicit redefinition of the area; that is, records are aligned on the leftmost character position. 4. For MF only: The APPLYclause is documentary only. 5. For MF only: The MULTIPLE FILE clause is documentary only. 6. If the SAME SORT AREA or SAME SORT-MERGE AREA clause is used, at least one of the file-names must represent a sort or merge file. Files that do not represent sort or merge files can also be named in the clause. This clause specifies that storage is shared as follows: a. The SAME SORT AREA or SAME SORT-MERGE AREA clause specifies a memory area which will be made available for use in sorting or merging each sort or merge file named. Thus any memory area allocated for the sorting or merging of a sort or merge file is available for reuse in sorting or merging any of the other sort or merge files. b. In addition, storage areas assigned to files that do not represent sort or merge files can be allocated as needed for sorting or merging the sort or merge files named in the SAME SORT AREA or SAME SORT-MERGE AREA clause. c. Files other than sort or merge files do not share a storage area. If the user wishes these files to share a storage area, he must also include in the program a SAME AREA or SAME RECORD AREA clause naming these files. d. During the execution of a SORTor MERGEstatement that refers to a sort or merge file named in this clause, any non-sort-merge files named in this clause must not be open.


MPE/iX 5.0 Documentation