Configuration Section (Continued) [ Micro Focus COBOL Language Reference ] MPE/iX 5.0 Documentation
Micro Focus COBOL Language Reference
Configuration Section (Continued)
The Special-Names Paragraph (Continued)
General Rules (Continued).
For MF only:
--------------------------------------------------------
| |
| TAB Skip to Vertical WRITE ADVANCING |
| Tabulation Position statement |
| (inserts ASCII |
| X"0B" in the output |
| record as |
| appropriate) |
| |
| PRINTER Printer DISPLAY |
| statement |
| |
| FORMFEED Skip to new page WRITE ADVANCING |
| (inserts ASCII statement |
| X"0C" in the output |
| record as |
| appropriate) |
| |
| COMMAND- LINE Command transfer ACCEPT and |
| DISPLAY |
| statements |
| |
--------------------------------------------------------
For MF and XOPEN only:
--------------------------------------------------------
| |
| ARGUMENT- Command-Line ACCEPT and |
| NUMBER argument number DISPLAY |
| statements |
| |
| ARGUMENT- VALUE Command-Line ACCEPT statement |
| argument value |
| |
| ENVIRONMENT- Environment- DISPLAY |
| NAME variable name statement |
| |
| ENVIRONMENT- Environment- ACCEPT and |
| VALUE variable value DISPLAY |
| statements |
| |
| SYSERR Standard error DISPLAY |
| device statement |
| |
--------------------------------------------------------
For OSVS and VSC2 only: The following table reflects the support for
function names offered by OS/VS COBOL, VS COBOL II and SAA in this COBOL
system.
For OSVS, MF and VSC2 only: Wherever a mnemonic-name is used in a COBOL
program, you can instead use function-name.
Table 4-1 : Function Names Support
----------------------------------------------------------
| | | | | |
| | OSVS | VSC3 | VSC2 | SAA |
| | | Rel | Rel | |
| | | (2) | (3)(4) | |
| | | | | |
----------------------------------------------------------
| | | | | |
| SYSIN | y | y | y | y |
| | | | | |
----------------------------------------------------------
| | | | | |
| SYSIPT | U | U | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| SYSOUT | y | y | y | y |
| | | | | |
----------------------------------------------------------
| | | | | |
| SYSLIST | | | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| SYSLST | U | U | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| SYSPCH | U | U | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| SYSPUNCH | U | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| CONSOLE | y | y | y | y |
| | | | | |
----------------------------------------------------------
| | | | | |
| C01 | y | y | y | y |
| | | | | |
----------------------------------------------------------
| | | | | |
| C02 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C03 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C04 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C05 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C06 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C07 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C08 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C09 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C10 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C11 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| C12 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| S01 | y | y | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| S02 | y | y | y | |
| | | | | |
----------------------------------------------------------
Table 4-1 : Function Names Support (Continued)
----------------------------------------------------------
| | | | | |
| | OSVS | VSC3 | VSC2 | SAA |
| | | Rel | Rel | |
| | | (2) | (3)(4) | |
| | | | | |
----------------------------------------------------------
| | | | | |
| S03 | | U | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| S04 | | U | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| S05 | | U | y | |
| | | | | |
----------------------------------------------------------
| | | | | |
| CSP | y | y | y | y |
| | | | | |
----------------------------------------------------------
| | | | | |
| 1 char rw literal | y | | | |
| | | | | |
----------------------------------------------------------
y documented and accepted by mainframe compilers and the COBOL
system.
U Undocumented but accepted by mainframe compiler.
14. For ANS85 only: The CLASS clauseprovides a means for relating a
name to the specified set of characters listed in that clause.
Class-name-1 can be referenced only in a class condition. The
characters specified by the values of the literals in this clause
define the exclusive set of characters which constitute
class-name-1. The value of each literal specifies :
a. the ordinal number of a character within the native
character set, if the literal is numeric. This value must
not exceed the value which represents the number of
characters in the native character set.
b. the actual character within the native character set, if
the literal is nonnumeric. If the value of the nonnumeric
literal contains multiple characters, each character in
the literal is included in the set of characters
identified by class-name-1.
If the THROUGH phrase is specified, the contiguous characters in
the native character set beginning with the character specified
by the value of literal-4, and ending with the character
specified by the value of literal-5, are included in the set of
characters identified by class-name-1. Additionally, the
contiguous characters specified by a given THROUGH phrase can
specify characters of the native character set in ascending or
descending sequence.
15. All clauses specified in the SPECIAL-NAMES paragraph for a
program also apply to programs contained within that program.
The condition-names specified in the containing program's
SPECIAL-NAMES paragraph can be referenced from any contained
program.
16. The CALL-CONVENTION clause allows you to select one of several
pre-defined parameter passing conventions which allow you to CALL
subprograms written in languages other than COBOL, and which use
different parameter passing conventions. (MF)
17. For MF only: The CONSOLE IS CRTclause causes any ACCEPT or
DISPLAY statement whose operand is not a screen-name, and that
has no phrases specific to a particular format, to be treated as
Format 5. If the CONSOLE IS CRT clause is not present, these
statements are treated as the standard ANSI ACCEPT or DISPLAY.
18. For MF and XOPEN only: The CURSOR IS clause specifies the data
item to contain the cursor address used by the ACCEPT statement.
a. At the start of an ACCEPT statement, if data-name-1
contains a value that is a valid character position on the
screen, that position is used as the initial position for
the cursor. Otherwise, data-name-1 is ignored, and the
initial position for the cursor is the start of the first
input field on the screen. At the end of an ACCEPT
statement, if the position in data-name-1 has been used in
that statement, data-name-1 is updated to show the
position of the cursor at the termination of the ACCEPT
statement.
b. CURSOR IS has no effect on the positioning of fields on
the screen.
c. Data-name-1 must be 4 or 6 characters in length. If
data-name-1 is 4 characters in length, the first two
characters are interpreted as line number, and the second
two as column number. If data-name-1 is 6 characters in
length, the first three characters are interpreted as line
number, and the second three as column number.
d. The clause has no effect if data-name-1 contains an
illegal position (for example, zeros, a nonnumeric value,
or a value that is beyond the bottom of the screen).
e. If data-name-1 contains a valid position that does not
correspond to an input field being accepted by the current
ACCEPT statement, the cursor is positioned to the next
such field or, if there is none, to the first such field.
The ordering of the fields is the order in which their
descriptions appear in the Data Division.
19. For MF and XOPEN only: The CRT STATUSclause specifies a 3-byte
data item, into which a status value is moved after each Format 4
or Format 5 ACCEPT statement.
If the CRT STATUS clause is specified in the SPECIAL-NAMES
paragraph, every Format 4 or 5 ACCEPT statement (as described
later in this chapter) places a value into data-name-2 to
indicate the outcome of the ACCEPT operation. Data-name-2
consists of status keyswhich are set to indicate possible
conditions resulting from the completion of the operation. They
are described below.
For MF and XOPEN only: CRT Status Key1: The first byte of data-name-1
is CRT Status Key 1 and should be described as PICTURE 9 USAGE DISPLAY.
It indicates the condition that caused the termination of the ACCEPT
operation. The possible values are :
" 0 " indicates a terminator key or auto-skip
out of the final field
" 1 " indicates a user-defined function key
" 2 " indicates a COBOL system-defined function
key
" 9 " indicates an error
For MF and XOPEN only: A terminator keyis a key whose purpose is
terminating ACCEPT operations (for example, Enter). A particular
configuration option causes the field-tab key, when used in the final
field of an ACCEPT, to act as a terminator key. Defining function keys
is also a configuration option.
For MF and XOPEN only: A termination that returns a value of "0" is
called a normal termination.
For MF and XOPEN only: If the ACCEPT statement contains an ON
EXCEPTION phrase, any value in CRT Status Key 1, except "0", will cause
the execution of the imperative-statement in that phrase.
For MF and XOPEN only: CRT Status Key 2: The second byte of
data-name-1 is CRT Status Key 2 and contains a code giving further
details of the condition that terminated the ACCEPT operation. Its
format and possible values depend on the value in CRT Status Key 1, as
shown in the following table.
Table 4-2 : Valid Combinations of CRT Status Keys 1 and 2 (MF) (XOPEN)
--------------------------------------------------------
| | | |
| | Key 2 | Meaning |
| Key 1 | | |
| | | |
--------------------------------------------------------
| | | | |
| | Format | Value | |
| | | | |
--------------------------------------------------------
| | | | |
| 0 | PIC 9 | 0 | The operator |
| | DISPLAY | | pressed a |
| | | | terminator key |
| | | | |
--------------------------------------------------------
| | | | |
| 0 | PIC 9 | 1 | Auto-skip out of |
| | DISPLAY | | the last field |
| | | | |
--------------------------------------------------------
| | | | |
| 1 | PIC 99 COMP | 0-127 | The function key |
| | | | number |
| | | | |
--------------------------------------------------------
| | | | |
| 2 | PIC 99 COMP | 0-26 | The function key |
| | | | number |
| | | | |
--------------------------------------------------------
| | | | |
| 9 | PIC 99 COMP | 0 | No items fall |
| | | | within the screen |
| | | | |
--------------------------------------------------------
See your COBOL System Reference for an explanation of function key
numbers.
For MF and XOPEN only: CRT Status Key 3: The third byte of
data-name-1 is CRT Status Key 3 and should be described as PICTURE 99
COMP-X or as PICTURE 99 COMP (with the NOIBMCOMP directive specified).
If CRT Status Key 1 and CRT Status Key 2 are zero, then CRT Status Key 3
contains the raw keyboard code for the key that terminated the ACCEPT
operation. Otherwise, the contents of CRT Status Key 3 are undefined.
For MF and XOPEN only: Where a sequence of keystrokes rather than a
single key has been configured to perform a single function, only the
code for the first keystroke is returned.
Input-Output Section
The FILE-CONTROL Paragraph.
Function.
The FILE-CONTROL paragraph names each file and allows specification of
other file-related information.
General Format.
[FILE-CONTROL. ] { file-control-entry} ...
The FILE-CONTROL Entry.
Function.
The FILE-CONTROLentry names a file and can specify other file-related
information.
For XOPEN only: Although they are a part of the standard COBOL
definition, the RECORD DELIMITER and RESERVE phrases and ellipses in the
ASSIGN clause are explicitly excluded from the X/Open COBOL language
definitions and should not be used in a conforming X/Open COBOL source
program.
General Formats.
Format 1 (Record Sequential Files).
Format 2 (Line Sequential Files) (MF)(XOPEN).
Format 3 (Relative Files).
Format 4 (Indexed Files).
Format 5 (Sort-Merge Files).
Directives.
1. In addition to system directives which provide flagging and modify
the reserved word list, the following directives may impact either
the syntax or semantics described in this section. See your COBOL
System Reference for details.
* ASSIGN - determines how the literal, data-name, of
external-file-reference is evaluated.
* SEQUENTIAL - determines whether files defined as
ORGANIZATION IS SEQUENTIAL are considered LINE SEQUENTIAL
or RECORD SEQUENTIAL.
Syntax Rules.
All Formats (All Files).
1. The SELECT clausemust be specified first in the file control
entry. The clauses which follow the SELECT clause can appear in
any order.
2. Each file described in the Data Division must be named once, and
only once, as file-name in the FILE-CONTROL paragraph. Each file
specified in the file control entry must have a file description
entry in the Data Division.
3. If the ACCESS MODE clause is not specified, the ACCESS MODE IS
SEQUENTIAL clause is implied.
4. For MF only: Data-name-1 can be declared in the Data Division
as an alpha- numeric or group data item long enough to hold the
external name of the file. If it is not explicitly declared
within the program, your COBOL system will declare it implicitly
as an alphanumeric data item long enough to hold the maximum
permissible size of program-name. If data-name-1 occurs in the
FROM option, the data item must be explicitly declared in the Data
Division.
5. For MF only: The NOT OPTIONAL phrase has effect only when the
file is opened input-output.
6. For MF only: External-file-reference, data-name-1, or literal-1
specifies the external name of the file.
If the EXTERNAL or DYNAMIC option is used, literal-1 must not be
specified.
If the DYNAMIC option is used, the word specified for the external
file-name will be interpreted as external-file-reference.
7. Data-name-2 must be defined in the Data Division as a
two-character, alphanumeric data item or a two-character numeric
data item with USAGE DISPLAY (OSVS and VSC2) and must not be
defined in the File, LOCAL-STORAGE(MF) or Communication Sections
of the Data Division.
8. For VSC2 only: Data-name-3 must be defined as a group item of 6
bytes in the Working-Storage or Linkage Section of the Data
Division.
9. For OSVS and VSC2 only: Data-name-4 must be defined in the
Working-Storage Section as an alphanumeric data item.
10. All data-names can be qualified.
For ANS85 only: Format 1 (Record Sequential Files only).
11. Literal-2 must be a one-character nonnumeric literal.
12. Data-name-5 can be qualified. It must be defined in the Data
Division as a one-character data item of category alphanumeric.
It cannot be defined in the Communication, File or Report
Sections of the Data Division.
13. Character-string must not be a reserved word, a user-defined word
that is defined elsewhere or a literal.
Formats 1 and 2 (Record and Line Sequential Files).
14. When the ORGANIZATION clause is not specified, sequential
organization is assumed.
15. For MF only: KEYBOARD means console input.
16. For MF only: DISPLAY means console output.
17. For MF only: PRINTER specifies the system's main printer.
18. For MF only: PRINTER-1 specifies the system's second printer.
Format 3 (Relative Files).
19. If a relative file is to be referenced by a START statement, the
RELATIVE KEY phrase must be specified for that file.
20. Data-name-5 must not be defined in a record description entry
associated with that file-name.
21. The data item referenced by data-name-5 must be defined as an
unsigned integer.
Format 4 (Indexed Files).
22. For MF only: Split-key-name is a concatenation of one or more
data items within a record associated with that file-name. It
can be referenced only in START and READ statements.
23. The data items referenced by data-name-5 and data-name-8 and any
data-names referenced by split-key-name-1 and split-key-name-2
(MF only) must be defined within a record description entry
associated with the file-name.
For OSVS, VSC2 and MF only: Any of these data items can be
defined as any supported data category. However, the key is
still treated as an alphanumeric item for the input and output
statements against the file named in the SELECT clause.
24. Data-name-5 and data-name-8 and any data-names referenced by
split-key-name-1 and split-key-name-2 (MF) cannot describe an
item whose size is variable. See the section The OCCURS Clause
in this chapter.
25. Data-name-8 or split-key-name-2 (MF) cannot reference an item
whose leftmost character position corresponds to the leftmost
character position of an item referenced by data-name-5 or
split-key-name-1(MF) .
26. For VSC2 and OSVS only: If the PASSWORDclause is specified, it
must immediately follow its associated RECORD KEY or ALTERNATE
RECORD KEY
clause.
Format 5 (Sort-Merge Files).
27. Each sort or merge file described in the Data Division must be
named once and once only as file-name in the FILE-CONTROL
paragraph. Each sort or merge file specified in the file control
entry must have a sort-merge file description entry in the Data
Division.
28. Since file-name represents a sort or merge file, only the ASSIGN
clause is permitted to follow file-name in the FILE-CONTROL
paragraph.
General Rules.
All Formats (All Files).
1. The ASSIGN clause specifies the association of the file referenced
by file-name-1 to a storage medium. (See your COBOL System
Reference.) The first assignment takes effect: subsequent
assignments within any one ASSIGN clause are documentary
only.(OSVS, VSC2 and MF)
2. The RESERVEclause allows the user to specify the required number
of input-output areas.
For MF only: The RESERVE clause is documentary only, unless the
COBOL System Reference specific to your operating system indicates
otherwise.
3. The ORGANIZATIONclause specifies the logical structure of a file.
The file organization is established at the time a file is created
and cannot subsequently be changed.
4. When the FILE STATUSclause is specified, a value will be moved by
the Run-Time System into the data item specified by data-name-2
after the execution of every statement that references that file
either explicitly or implicitly. This value indicates the status
of execution of the statement. (See the section I/O Status
earlier in this chapter.)
For MF only: Data-name-3, if specified, is documentary only.
5. For MF only: The PASSWORD clauseis documentary only.
6. For MF only: Use of the reserved word DYNAMIC in an ASSIGN
clause indicates that the value of literal-1 or data-name-1 in
that ASSIGN clause is the specified file's name in the external
file-storage environment.
7. For MF only: Use of the reserved word EXTERNAL in an ASSIGN
clause indicates that external-file-reference identifies the
specified file to the external environment for possible further
mapping to an external file-storage environment-name. (See
your COBOL System Reference for details on setting up
external-file-name for your particular operating environment.)
If external-file-reference contains the character "-", then only
that part of the name following the last "-" is used to identify
the file to the external environment.
8. For MF only: The DISK option without external-file-reference,
data-name-1 or literal-1 and without the FROM option, specifies a
disk file whose name will be given in a VALUE OF FILE-IDclause in
the file description for the file. If that file description
contains no VALUE OF FILE-ID clause, the name of the disk file is
assumed to be the same as file-name-1 (known as the internal
file-name).
9. For MF only: If any of the keywords DISK, KEYBOARD, DISPLAY,
PRINTER or PRINTER-1 are followed by external-file- reference,
data-name-1 or literal-1, that keyword is ignored.
10. For MF only: The DISK option with the FROM option specifies a
disk file whose name on the disk is the value of data-name-1.
However, if when an OPEN statement is executed for that file,
data-name-1 contains all spaces, the name of the disk file
is assumed to be the same as file-name-1 (known as the
internal-file-name).
11. The OPTIONAL phrase applies only to files opened in the INPUT, I/O
or EXTEND mode. Its specification is required for files that are
not necessarily present each time the object program is executed.
For MF only: Formats 1, 3 and 4 (Record Sequential, Relative and Indexed
files).
12. The LOCK MODEclause is an optional clause in the file control
entry and is used to specify the locking technique used for the
file.
If this clause is omitted, opening the file causes it to become
exclusive, with the exception of OPEN INPUT.
When LOCK MODE IS EXCLUSIVE is specified, the run unit acquires a
lock on the whole file when it opens the file.
When LOCK MODE IS AUTOMATIC or LOCK MODE IS MANUAL is specified,
the file that the run unit opens is shareable. Files opened
OUTPUT, and indexed and relative files opened EXTEND are,
however, always exclusive.
13. The ROLLBACKclause requests transaction logging for a file under
those COBOL systems that support that feature. See your COBOL
System Reference for details of how it is implemented in your
system.
If the ROLLBACK clause is specified then WITH LOCK ON MULTIPLE
RECORDS will automatically be in effect.
14. The WITH LOCK ON RECORDclause specifies single record locking for
the file.
The WITH LOCK ON MULTIPLE RECORDS clause specifies multiple
record locking for the file. This clause must be present if
multiple record locking is required.
15. If LOCK MODE IS AUTOMATIC WITH LOCK ON RECORD is specified for a
file, a record lock is acquired by the execution of the READ
statement and is released upon execution of a subsequent I/O
operation on this file, with the exception of a START statement.
If LOCK MODE IS AUTOMATIC WITH LOCK ON MULTIPLE RECORD is
specified for a file, a record lock is acquired by the execution
of the READ statement and is not released until a CLOSE, COMMIT,
ROLLBACK or UNLOCK statement is executed, or until an individual
lock is released by a DELETE statement.
16. If LOCK MODE IS MANUAL WITH LOCK ON RECORD is specified, a lock
is acquired by a READ statement only if it includes the WITH LOCK
phrase, and is released upon execution of a subsequent I/O
operation on this file, with the exception of a START statement.
If LOCK MODE IS MANUAL WITH LOCK ON MULTIPLE RECORDS is
specified, a record lock is acquired by the READ WITH KEPT LOCK
statement and is not released until a CLOSE, COMMIT, ROLLBACK or
UNLOCK statement is executed.
17. When the lock mode is MANUAL or AUTOMATIC, single record locking
is assumed unless the WITH LOCK ON MULTIPLE RECORDS phrase is
included. * If a file is defined as EXTERNAL and the operating
system file-name is assigned by means of a file-name, for
example, by use of either the ASSIGNdirective or keyword, using
data-name-1 in the SELECT/ ASSIGN statement, or using Format 2 of
the VALUE OF phrase of an FD, then the following rules should be
followed:
a. identifier with the same name should be used to contain
the physical file-name in all programs which reference the
file.
b. definition of the identifier which contains the physical
file-name should also contain the EXTERNAL attribute.
No violation of these rules will be detected at compile time,
but, if any program in the run unit violates these rules, the
results at run time will be undefined.
For further details of the effects of record locking, see your
COBOL System Reference.
MPE/iX 5.0 Documentation