Environment Division [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Language Reference for the Series 700 and 800
Environment Division
General Description
The Environment Division specifies a standard method of expressing those
aspects of a data processing problem that are dependent upon the physical
characteristics of a specific computer.
________________________________________________________________________
|(ANS85) |
|The Environment Division is optional in a COBOL source program. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|If the program includes an Environment Division, the Environment |
|Division header is optional only if it is the first division in the |
|program. |
________________________________________________________________________
Configuration Section
The Configuration Section is located in the Environment Division of a
source program. The Configuration Section deals with the characteristics
of the source computer and the object computer. This section also
provides a means for specifying the currency sign, choosing the decimal
point, relating implementor-names to user-specified mnemonic-names,
relating alphabet-names to character sets or collating sequences, and
relating class-names to sets of characters.
________________________________________________________________________
|(ANS85) (OSVS) |
|The Configuration Section is optional in the Environment Division of a|
|COBOL source program. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|The CONFIGURATION SECTION header is optional only if it is the first |
|statement in the program. |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
|The Configuration Section must not be stated in a program which is |
|contained directly or indirectly within another program. |
| |
|The entries explicitly or implicitly stated in the Configuration |
|Section of a program which contains other programs apply to each |
|contained program. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|If a file is defined as EXTERNAL and the operating system file name is|
|initialized or modified by reference to an identifier use of the |
|ASSIGN (DYNAMIC) compiler directive or the DYNAMIC keyword in the |
|SELECT/ASSIGN statement or the VALUE OF FILE-ID phrase in the |
|FD, then the identifier containing the file name must also be |
|EXTERNAL. |
________________________________________________________________________
The general format of the Configuration Section is shown below:
General Format
The Source-Computer Paragraph
Function
The SOURCE-COMPUTER paragraph identifies the computer upon which the
program is to be compiled. It is optional. (ANS85) (OSVS)
General Format
Syntax Rules
1. Source-computer-name must be one COBOL word defined by the user.
________________________________________________________________________
|(ANS85) (OSVS) |
| |
| |
| |
|2. The SOURCE-COMPUTER paragraph can consist of only the |
| SOURCE-COMPUTER header. |
| |
________________________________________________________________________
General Rules
1. The source-computer-name provides a means for identifying
equipment configuration, in which case the computer-name and its
implied configuration are specified by the user. The
SOURCE-COMPUTER paragraph is used for documentary purposes only.
2. The WITH DEBUGGING MODE phrase is used to enable debugging code,
in accordance with Standard ANSI COBOL Debug. (See the section
Environment Division in COBOL Debug in the chapter Debug and
Interactive Debugging.)
The Object-Computer Paragraph
Function
The OBJECT-COMPUTER paragraph identifies the computer on which the
program is to be executed. It is optional. (ANS85) (OSVS)
________________________________________________________________________
|(ANS85) |
|The MEMORY SIZE clause is classed as an obsolete element in the |
|ANSI'85 standard and is scheduled to be deleted from the next full |
|revision of the ANSI Standard. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|All dialects within this COBOL implementation support the memory size |
|clause for documentary purposes only. Refer to your COBOL System |
|Reference for details on using the FLAGSTD directive to detect |
|occurrences of this syntax. |
________________________________________________________________________
________________________________________________________________________
|(XOPEN) |
|Although it is a part of the standard COBOL definition, the Memory |
|Size clause is 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 Rule
Object-computer-name must be one COBOL word defined by the user.
General Rules
1. The computer-name provides a means for identifying equipment
configuration, in which case the computer-name and its implied
configurations are specified by the user. The configuration
definition contains specific information concerning the memory
size. The computer-name and the MEMORY SIZE clause are used for
documentary purposes only.
2. If the PROGRAM COLLATING SEQUENCE clause is not specified, the
NATIVE collating sequence is used. The Appendix Character Sets
and Collating Sequences lists both the full ASCII and EBCDIC
collating sequences. Either can be chosen as the NATIVE
collating-sequence by use of the COBOL directive, NATIVE. (See
your COBOL System Reference for details.)
3. If the PROGRAM COLLATING SEQUENCE clause is specified, the program
collating sequence is the collating sequence associated with the
alphabet-name specified in that clause.
4. The program collating sequence established in the OBJECT-COMPUTER
paragraph is used to determine the truth value of any nonnumeric
comparisons:
a. Explicitly specified in relation conditions (see the
section "Relation Condition" later in this chapter).
b. Explicitly specified in condition-name conditions; see the
section "Condition-Name Condition (Conditional Variable)"
later in this chapter.
5. The PROGRAM COLLATING SEQUENCE clause is also applied to any
nonnumeric merge or sort keys unless the COLLATING SEQUENCE phrase
of the respective SORT or MERGE statement is specified. (See
Chapter 5 , File Input and Output.)
6. The PROGRAM COLLATING SEQUENCE clause has no effect on the
ordering of indexed files (see Chapter 5 , File Input and
Output).
7. The PROGRAM COLLATING SEQUENCE clause applies only to the program
in which it is specified.
8. The SEGMENT-LIMIT clause is documentary only. (See the chapter
Segmentation.)
The Special-Names Paragraph
Function
The SPECIAL-NAMES paragraph provides a means for specifying the currency
sign, choosing the decimal point, specifying symbolic-characters, (ANS85)
relating implementor-names to user-specified mnemonic-names, relating
alphabet-names to character sets or collating sequences, and relating
class-names to sets of characters. You can select one of several
pre-defined parameter passing conventions. Enhancements to the CALL
statement and the PROCEDURE DIVISION statement allow these parameter
passing conventions to be used in inter-program communication.
General Format
Syntax Rules
1. Mnemonic-names can be any COBOL user-defined word and at least one
constituent character must be alphabetic.
2. Function-name refers to a system device or function used by your
COBOL system.
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
|Function-name refers to an external switch if its name is one of |
|UPSI-0 through UPSI-7. |
________________________________________________________________________
3. If function-name references an external switch or the SWITCH-n or
SWITCH (MF) option is used, the associated mnemonic-name can not
be specified anywhere except in (ANS85) the SET statement.
(ANS85) At least one condition name should be associated with it.
No condition name is required. (ANS85)
4. If function-name does not reference an external switch, the
associated mnemonic name can be specified only in the ACCEPT,
DISPLAY, SEND or WRITE statements. A condition name cannot be
associated with such an implementor-name.
5. The literals specified in the literal phrase of the alphabet-
name-1 clause:
a. If numeric, must be unsigned integers and must have a value
within the range of one (1) through the maximum number of
characters in the native character set.
________________________________________________________________________
|(MF) |
|The lowest valid values for numeric literals in the ALPHABET clause |
|are sensitive to the ALPHASTART directive. See your COBOL System |
|Reference for details. |
________________________________________________________________________
b. If nonnumeric and associated with a THROUGH or ALSO phrase,
must each be one character in length.
________________________________________________________________________
|(MF) (VSC2) |
| |
| |
| |
|c. Cannot be specified as floating-point literals or DBCS literals. |
| |
________________________________________________________________________
6. If the literal phrase of the alphabet-name-1 clause is specified,
a given character must not be specified more than once in an
alphabet-name clause.
7. The words THRU and THROUGH are equivalent.
________________________________________________________________________
|(MF) |
| |
| |
| |
|8. The words STANDARD-1 and ASCII are equivalent. |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|9. The reserved word IS is never required in the SPECIAL-NAMES |
| paragraph. |
| |
|10. The literals specified in the literal-4 phrase: |
| |
| |
| a. If numeric, must be unsigned integers and must have a |
| value within the range of one through the maximum number |
| of characters in the native character set. |
| |
| b. If nonnumeric and associated with a THROUGH phrase, must |
| each be one character in length. |
| |
| c. Cannot be specified as floating point or DBCS literals. (MF)|
| (VSC2) |
| |
|11. Literal-1, ... literal-5 must not specify a symbolic-character |
| figurative constant. |
| |
|12. The same symbolic-character-1 must appear only once in a SYMBOLIC|
| CHARACTERS clause. |
| |
|13. The relationship between each symbolic-character-1 and the |
| corresponding integer-1 is by position in the SYMBOLIC CHARACTERS|
| clause. The first symbolic-character-1 is paired with the first |
| integer-1, the second symbolic- character-1 is paired with |
| the second integer-1; and so on throughout the SYMBOLIC |
| CHARACTERS clause; the division into IS or ARE phrases is |
| documentary. |
| |
| The lowest valid value for integer-1 is sensitive to the |
| SYMBSTART directive. See your COBOL System Reference for details.|
| (MF) |
| |
|14. There must be a one-to-one correspondence between occurrences of |
| symbolic-character-1 and occurrences of integer-1, both within |
| each IS or ARE phrase and within the entire SYMBOLIC CHARACTERS |
| clause. |
| |
|15. The ordinal position specified by integer-1 must exist in the |
| native character set. If the IN phrase is specified, the |
| ordinal position must exist in the character set named by |
| alphabet-name-2; alphabet-name-2 must be described in an ALPHABET|
| clause. |
| |
|16. Literal-6 must not be a figurative constant. |
| |
________________________________________________________________________
________________________________________________________________________
|(OSVS) (VSC2) |
| |
| |
| |
|17. The clauses in the SPECIAL-NAMES paragraph can appear in any |
| order. |
| |
________________________________________________________________________
________________________________________________________________________
|(MF) |
| |
| |
| |
|18. Literal-7 must be an unsigned integer in the range 0 to |
| 65535. |
| |
________________________________________________________________________
________________________________________________________________________
|(MF) (VSC2) |
| |
| |
| |
|19. Data-name-1 of the CURSOR IS clause must be declared in the |
| Working-Storage section of the program. |
| |
|20. The CRT STATUS clause specifies a data item into which a status |
| value is moved after each Format 4 or 5 ACCEPT statement. |
| |
|21. Data-name-2 must be described in the Working-Storage section and |
| must be three bytes long. |
| |
|22. The CURSOR IS clause specifies the data item to contain the cursor|
| address as used by the ACCEPT statement. |
| |
________________________________________________________________________
General Rules
1. External switches are set at run-time by the operator and the
setting can be determined in the program by testing the associated
condition-names.
2. If mnemonic-name is associated with an external switch, the status
of that switch can be altered by execution of a Format 1 SET
statement (see the section "The SET Statement" in this
chapter).
3. The alphabet-name-1 clause provides a means for relating a name to
a specified character code set and/or collating sequence. When
alphabet-name-1 is referenced in the PROGRAM COLLATING SEQUENCE
clause (see the section "The Object-Computer Paragraph" in
this chapter) or the COLLATING SEQUENCE phrase of a SORT or MERGE
statement (see "The SORT Statement" or "The MERGE Statement"
in the chapter File Input and Output), the alphabet-name-1
clause specifies a collating sequence. When alphabet-name-1 is
referenced in a CODE-SET clause in a file description entry (see
"The File Description - The Complete Entry Skeleton" in the
chapter File Input and Output), the alphabet-name clause specifies
a character code set.
a. If the STANDARD-1 or ASCII (MF) phrase is specified, the
character code set or collating sequence identified is the
American Standard Code for Information Interchange, as
defined in American National Standard X3.4-1968.
________________________________________________________________________
|(ANS85) |
|If the STANDARD-2 phrase is specified, the character code set |
|identified is the International Reference Version of the ISO 7-bit |
|code, as defined in International Standard 646, 7-bit Coded Character |
|Set for Information Processing Interchange. |
________________________________________________________________________
b. If the NATIVE phrase is specified, the native character
code set or native collating sequence is used. The native
code set is ASCII, as defined in ANSI publication
X3.4-1968.
________________________________________________________________________
|(MF) |
|The native collating sequence is either ASCII or EBCDIC, as specified |
|by the COBOL directive, NATIVE. (See your COBOL System Reference for |
|details.). See the appendix Character Sets and Collating Sequences |
|for details of the ASCII code-set and the ASCII and EBCDIC collating |
|sequences and their correspondence. |
________________________________________________________________________
________________________________________________________________________
|(MF) (VSC2) |
| |
| |
| |
|c. If the EBCDIC phrase is specified the character code set or |
| collating sequence identified is EBCDIC. |
| |
________________________________________________________________________
d. If the literal phrase is specified, the alphabet-name-1 can
not be referenced in a CODE-SET clause (see the section The
CODE-SET Clause in Chapter 5 , File Input and Output). The
character code set and/or collating sequence identified is
that defined according to the following rules:
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,
starting with the leftmost character, is assigned
successive ascending positions in the collating
sequence being specified.
2. The order in which the literals appear in the ALPHABET
clause specifies, in ascending sequence, the ordinal
number of the character within the collating sequence
being specified.
3. Any characters within the native collating sequence,
which are not explicitly specified in the literal
phrase, assume a position, in the collating sequence
being specified, greater than any of the explicitly
specified characters. The relative order within the
set of these unspecified characters is unchanged from
the native collating sequence.
4. If a character code-set is being specified, for each
character within the native character set that is not
specified by the literal-1 phrase the implementor
defines the ordinal number within the character
code-set being specified.
5. If the THROUGH phrase is specified, the set of
contiguous characters in the native character set
beginning with the character specified by the value of
literal-1, and ending with the character specified by
the value of literal-2, is assigned a successive
ascending position in the collating sequence being
specified. In addition, the set of contiguous
characters specified by a given THROUGH phrase can
specify characters of the native character set in
either ascending or descending sequence.
6. If the ALSO phrase is specified, the characters of the
native character set specified by the value of
literal-1, and literal-3 are assigned to the same
position in the collating sequence being specified , or
in the character code set that is used to represent the
data. (ANS85)
4. The character that has the highest ordinal position in the program
collating sequence is associated with the figurative constant
HIGH-VALUE except when this figurative constant is specified as a
literal in the SPECIAL-NAMES paragraph. (ANS85) If more than one
character has the highest position in the program collating
sequence, the last character specified is associated with the
figurative constant HIGH-VALUE.
5. The character that has the lowest ordinal position in the program
collating sequence is associated with the figurative constant
LOW-VALUE except when this figurative constant is specified as a
literal in the SPECIAL-NAMES paragraph. (ANS85) If more than one
character has the lowest position in the program collating
sequence, the first character specified is associated with the
figurative constant LOW-VALUE.
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
| |
| |
| |
|6. Floating-point literals can not be used in a user-specified |
| collating sequence. |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|7. When specified as literals in the SPECIAL-NAMES paragraph, the |
| figurative constants HIGH-VALUE and LOW-VALUE are associated with |
| those characters having the highest and lowest positions, |
| respectively, in the native collating sequence. |
| |
|8. The SYMBOLIC CHARACTERS clause is used to define user-defined |
| words that can be used like figurative constants. If the IN |
| phrase is not specified, symbolic-character-1 represents the |
| character whose ordinal position in the native character set is |
| specified by integer-1. If the IN phrase is specified, integer-1 |
| specifies the ordinal position of the character that is |
| represented in the character set named by alphabet-name-2. |
| |
|9. The internal representation of symbolic-character-1 is the |
| internal representation of the character that is represented in |
| the native character set. |
| |
________________________________________________________________________
10. Literal-6 which appears in the CURRENCY SIGN IS literal clause is
used in the PICTURE clause to represent the currency symbol. The
literal is limited to a single character and must not be one of the
following characters.
* digits 0 thru 9;
* uppercase alphabetic characters A, B, C, D, L, P, R, S, V, X,
Z, or the space;
________________________________________________________________________
|C and R are allowed (MF) |
________________________________________________________________________
________________________________________________________________________
|L is allowed (ANS85) |
________________________________________________________________________
________________________________________________________________________
|E can not be used in programs that include external floating point |
|data items (OSVS) (VSC2) (MF) |
________________________________________________________________________
________________________________________________________________________
|G can not be used in programs with DBCS data items or literals (VSC2) |
|(MF) |
________________________________________________________________________
________________________________________________________________________
|lowercase alphabetic characters a through z, (ANS85) |
________________________________________________________________________
________________________________________________________________________
|(except e, f, g, h, i, j, k, m, n, o, q, t, u, w, y); (MF) |
________________________________________________________________________
* special characters *, +, -, ,, ., ;, (, ), ", / or =.
If this clause is not present, only the currency sign defined in the
COBOL character set is used in the PICTURE clause.
11. The DECIMAL-POINT IS COMMA clause means that the function of comma
and period are exchanged in the character-string of the PICTURE
clause and in numeric literals.
________________________________________________________________________
|(MF) |
| |
| |
| |
|12. If the NUMERIC SIGN clause is specified, the default for signed |
| numeric items is for the sign to be stored as a trailing separate|
| character. |
| |
________________________________________________________________________
13. If function-name does not reference an external switch, it can be
selected from the following list:
(MF)
------------------------------------------------------------------------------------------
| |
| TAB Skip to Vertical Tabulation WRITE ADVANCING statement |
| Position (inserts ASCII |
| X"0B" in the output record |
| as appropriate) |
| |
| PRINTER Printer DISPLAY statement |
| |
| FORMFEED Skip to new page (inserts WRITE ADVANCING statement |
| ASCII X"0C" in the output |
| record as appropriate) |
| |
| COMMAND-LINE Command transfer ACCEPT and DISPLAY |
| statements |
| |
------------------------------------------------------------------------------------------
(MF) (XOPEN)
------------------------------------------------------------------------------------------
| |
| ARGUMENT-NUMBER Command-Line argument number ACCEPT and DISPLAY |
| statements |
| |
| ARGUMENT-VALUE Command-Line argument value ACCEPT statement |
| |
| ENVIRONMENT-NAME Environment- variable name DISPLAY statement |
| |
| ENVIRONMENT-VALUE Environment- variable value ACCEPT and DISPLAY |
| statements |
| |
| SYSERR Standard error device DISPLAY statement |
| |
------------------------------------------------------------------------------------------
________________________________________________________________________
|(OSVS) (VSC2) |
|The following table reflects the support for function names offered by|
|OS/VS COBOL, VS COBOL II and SAA in this COBOL system. |
________________________________________________________________________
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
|Wherever a mnemonic-name is used in a COBOL program, you can instead |
|use function-name. |
________________________________________________________________________
Table 3-1. Function Names Support
---------------------------------------------------------------------
| | | | | |
| | OSVS | VSC2 Rel | VSC2 Rel | SAA |
| | | (2) | (3) | |
| | | | | |
---------------------------------------------------------------------
| | | | | |
| 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 | |
| | | | | |
---------------------------------------------------------------------
Table 3-1. Function Names Support (cont.)
---------------------------------------------------------------------
| | | | | |
| | OSVS | VSC2 Rel | VSC2 Rel | SAA |
| | | (2) | (3) | |
| | | | | |
---------------------------------------------------------------------
| | | | | |
| C11 | y | y | y | |
| | | | | |
---------------------------------------------------------------------
| | | | | |
| C12 | y | y | y | |
| | | | | |
---------------------------------------------------------------------
| | | | | |
| S01 | y | y | y | |
| | | | | |
---------------------------------------------------------------------
| | | | | |
| S02 | y | y | y | |
| | | | | |
---------------------------------------------------------------------
| | | | | |
| 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.
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|14. The CLASS clause provides 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. |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
|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.
________________________________________________________________________
|(MF) |
| |
| |
| |
|16. The CALL-CONVENTION clause allows the user 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. |
| |
|17. The CONSOLE IS CRT clause 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. |
| |
________________________________________________________________________
________________________________________________________________________
|(MF) (XOPEN) |
| |
| |
| |
|18. 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 (see General Rule 4), 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 their descriptions appear in the Data |
| Division. |
| |
|19. The CRT STATUS clause specifies a 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 1 or 2 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 keys which are set to indicate possible |
| conditions resulting from the completion of the operation. They |
| are described below. |
| |
________________________________________________________________________
________________________________________________________________________
|(MF) (XOPEN) |
| |
|CRT Status Key 1: 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 |
| |
| |
|A terminator key is a key whose purpose is terminating ACCEPT |
|operations (for example, Enter). There is a configuration option that|
|causes the field-tab key, when used in the final field of an ACCEPT, |
|to act as a terminator key also. Defining function keys is also a |
|configuration option. |
________________________________________________________________________
__________________________________________________________________________________
|(XOPEN) (MF) |
|A termination that returns a value of "0" is a normal termination. |
| |
|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. |
| |
|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 3-2. Valid Combinations of CRT Status Keys 1 and 2 |
| |
|---------------------------------------------------------------- |
|| | | | |
|| Key 1 | Key 2 | Meaning | |
|| | | | |
|---------------------------------------------------------------- |
|| | | | |
|| | Format Value | | |
|| | | | |
|| 0 | PIC 9 0 | The operator pressed a | |
|| | DISPLAY | terminator key | |
|| | | | |
|| 0 | PIC 9 1 | Auto-skip out of the last | |
|| | DISPLAY | 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. |
| |
|CRT Status Key 3: The third byte of data-name-1 is CRT Status Key 3. |
|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. |
| |
|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. |
__________________________________________________________________________________
MPE/iX 5.0 Documentation