|
HP COBOL Reference Manual
SYMBOLIC CHARACTERS CARRIAGE-RET ESCAPE ARE 14 28
|
If the IN phrase is not specified, symbol-char represents
the character, in the native character set, that has the ordinal
position specified by char-val.
Note
The ordinal position is one greater than the internal representation of
the character. For example, the character A is in ordinal position 66.
Its internal representation is decimal 65 (hexadecimal 41).
|
If the IN phrase is specified, char-val represents the
character that has the ordinal position specified by the IN
alpha-name phrase.
CLASS Clause
- The CLASS clause relates a name to a specified set of characters
in that clause. class-name can be referenced only in a class
condition. The characters specified by the values of the literals in
this clause define the set of characters of which this
class-name consists.
- The value of each numeric literal specifies the ordinal number of
a character in the native character set. This value must not exceed the
value that represents the number of characters in the native character
set.
- The value of each nonnumeric literal specifies the actual
character in the native character set. If the nonnumeric literal
contains multiple characters, each character in the literal is included
in the set of characters identified by class-name.
- The THROUGH phrase specifies a set of contiguous characters in the
native character set. The first character is first-literal;
the last character is last-literal. The characters specified
by a given THROUGH phrase can be specified in ascending or descending
order.
CURRENCY SIGN Clause
- In the CURRENCY SIGN clause, char specifies the PICTURE
clause currency symbol. It can be any printable character from the
computer character set except:
- 0 through 9
- A, B, C, D, P, R, S, V, X, Z, the lowercase characters a to z, or
the space
- Asterisk (*), plus sign (+), minus sign (-), comma (,), period (.),
semicolon (;), quotation mark ("), equal sign (=), slash (/), left
parenthesis ( ( ), or right parenthesis (
) )
- The CURRENCY SIGN clause cannot contain a symbolic-character or
figurative constant.
- If there is no CURRENCY SIGN clause, the default currency sign used
for the PICTURE clause is the "$" symbol.
On OpenVMS, if you define
the logical name SYS$CURRENCY at DCL command level prior to
compilation, the quoted character string to which you define it will be
the currency string. To do this, prior to compiling the COBOL program,
issue the following DCL command:
$ DEFINE SYS$CURRENCY "quoted-character-string"
|
The COBOL compiler will utilize the first character of this string
as the currency symbol for the program. Subsequently, the system
default value of SYS$CURRENCY can be restored for the process with the
following DCL command:
$ DEASSIGN SYS$CURRENCY <>
|
The default currency sign can also be established based on the
nationality
compiler option, depending on the keyword, as follows:
US (default)
|
The default currency sign and symbol are the dollar sign ($), and
Japanese language support features are disabled.
|
JAPAN
|
The default currency sign and symbol are the Yen sign (¥) (which is
not overridden by a SYS$CURRENCY definition), and Japanese language
support features are enabled, including national character
user-defined-words, data items (PIC N), and literals (N"").
|
CURRENCY SIGN Clause (Alpha, I64)
- To use CURRENCY SIGN IS literal-7, you must compile the
program with the /RESERVED_WORDS=200X qualifier. Without that
qualifier, you can specify only CURRENCY SIGN IS char, and
specify it only once.
- The CURRENCY SIGN IS literal-7 clause specifies a currency
string that is placed into numeric-edited data items when they are used
as receiving items and de-edited from a data item when the data item is
used as a sending item that has a numeric or numeric-edited receiving
item. The clause also determines which symbol shall be used in a
picture character string to specify the presence of this currency
string. This symbol is referred to as the currency symbol.
literal-7 represents the value of the currency string.
If the CURRENCY SIGN clause is specified with the PICTURE SYMBOL
phrase, literal-8 is the currency symbol; if the clause is
specified without the PICTURE SYMBOL phrase, literal-7 is the
currency symbol, and it must be one character in length. If the
currency symbol is a lowercase letter, it is treated as its uppercase
equivalent.
- If the PICTURE SYMBOL phrase is not specified, literal-7
must consist of a single character that is not one of the following:
- 0 through 9
- A, B, C, D, E, N, P, R, S, V, X, Z, or the lowercase equivalents;
or the space
- Asterisk (*), plus sign (+), minus sign (-), comma (,), period (.),
semicolon (;), quotation mark ("), equal sign (=), slash (/), left
parenthesis ( ( ), or right parenthesis (
) )
- If the PICTURE SYMBOL phrase is specified, literal-7 can
have any length and:
- Must contain at least one nonspace character, and
- Can consist of any characters from the computer's character set
except for the digits 0 through 9 and the characters asterisk (*), plus
sign (+), minus sign (-), comma (,), and period (.)
- literal-8 can be any character from the computer's
character set except for the following:
- 0 through 9
- A, B, C, D, E, N, P, R, S, V, X, Z, or the lowercase equivalents;
or the space
- Asterisk (*), plus sign (+), minus sign (-), comma (,), period (.),
semicolon (;), quotation mark ("), equal sign (=), slash (/), left
parenthesis ( ( ), or right parenthesis (
) )
<>
DECIMAL-POINT IS COMMA Clause
- The DECIMAL-POINT IS COMMA clause exchanges the functions of the
comma and period in: (1) the PICTURE clause character-string and (2)
numeric literals.
CURSOR IS Clause (Alpha, I64)
- The CURSOR IS clause specifies the initial position of the cursor
at the start of an ACCEPT (Format 5) statement. If
cursor-position is within an input or update field on the
screen, then the initial cursor position is at the start of that field.
If the CURSOR IS clause is not specified, or if
cursor-position is not within an input or update field on the
screen, the cursor's initial position is at the start of the first
input or update field of the screen. The cursor-position is
updated upon completion of the ACCEPT statement to contain the position
of the cursor when the ACCEPT terminated.
- In the CURSOR IS clause, if cursor-position is four
characters in length, the first two characters represent the line
number, and the second two the column number. If
cursor-position is six characters in length, the first three
characters represent the line number, and the second three the column
number.
CRT STATUS IS Clause (Alpha, I64)
- If the CRT STATUS IS clause is specified, crt-status-code
is updated after every ACCEPT (Format 5) statement. The first two
characters are a termination code that indicates the cause of the
termination of the ACCEPT operation. (The third character is currently
not defined, and is reserved for future use.) The termination codes are
explained in Table 4-1.
Command Line Arguments (Alpha, I64)
- The ARGUMENT-NUMBER and ARGUMENT-VALUE clauses are used to process
command line arguments. The DISPLAY statement is used to select and
modify the values, and the ACCEPT statement is used to retrieve the
values.
Environment Variables and System Logicals (Alpha, I64)
- The ENVIRONMENT-NAME and ENVIRONMENT-VALUE clauses are used to
process environment variables and system logicals. The DISPLAY
statement is used to select and modify the values, and the ACCEPT
statement is used to retrieve the values.
Table 4-1 CRT STATUS Termination Codes (Alpha, I64)
First Character |
Second Character |
Meaning |
`0'
|
`0'
|
Terminator key pressed by the operator; normal completion
|
`0'
|
`1'
|
Auto-skip out of the last field; normal completion
|
`1'
|
x`00'---x`1A'
|
User-defined function key number for F1--F20 and the Find through Next
keys
1
|
`9'
|
x`00'
|
No items falling within the screen
1
|
1The second character contains a hexadecimal value. An
example of how to examine this value is given in the Examples section.
|