|
HP COBOL Reference Manual
Technical Notes
Format 1
- If there is a library-name phrase, text-name is
tr-name.
On OpenVMS systems, tr-name is defined
as a user-defined name or nonnumeric literal that matches the name of a
text record in library-name.<>
- library-name (or text-name, when there is no
library-name phrase) represents a complete or partial file
specification, defined to be f-name: f-name is a
nonnumeric literal or a COBOL word formed according to the rules for
user-defined names.
- On Alpha and I64 systems, the COBOL command-line qualifier /INCLUDE
(or
-include
) can be used at compile time to set up a search list for the COPY
command. Assume that the following conditions are all true:
- library-name is not used.
- text-name does not include a directory specification.
- /INCLUDE is specified.
Then the compiler searches for the text-name file in the
following order:
- The current working directory when the compiler is invoked
- The directory specified after /INCLUDE (or
-include
)
If more than one directory is specified, they are searched in
left to right order. <>
On Alpha and I64 systems, if library-name is used, and
library-name does not include a directory specification, the
/INCLUDE qualifier causes a search for a .TLB file, in the same search
order. <> The first file encountered that matches the
text-name terminates the search. On Tru64 UNIX, /INCLUDE
(or
-include
) can be used to set up a search list for a text-name without
a directory specification only if library-name is not
specified. <> If the default, /NOINCLUDE, is in effect, a
file without a directory specification is searched for only in the
current default directory at compile time. The pathname(s)
specified with /INCLUDE can be relative or absolute directory
specifications, logical names on OpenVMS Alpha or I64, or environment
variables on Tru64 UNIX.
- If f-name or tr-name is not a literal, the
compiler translates hyphens in the word to underscore characters and
treats it as if it were enclosed in quotation marks.
- When the COPY statement executes, the I/O system:
- Removes leading and trailing spaces and tab characters from
f-name and from tr-name
- Translates lowercase letters to uppercase in f-name and in
tr-name
- The default file type for text-name, when
text-name is f-name, is LIB. For example, COPY
CUSTFILE becomes COPY CUSTFILE.LIB.
- On OpenVMS, the default file type for library-name is TLB.
For example, COPY "ACCOUNTS" OF CUSTLIB becomes COPY "ACCOUNTS" OF
CUSTLIB.TLB.<>
- On all platforms, file names must conform to the rules of the
operating system where compilation occurs. For example:
- On Tru64 UNIX systems:
COPY "/usr/proj/empl/empl_file".
COPY "empl_file" IN "/usr/proj/empl". <>
|
- On OpenVMS systems:
COPY "COPYDIR:EMPL_FILE.LIB".
COPY "EMPL_FILE" IN "EMPLLIB.TLB". <>
|
Format 2 (OpenVMS)
- record-name can be a nonnumeric literal or COBOL word
formed according to the rules for user-defined names. It represents a
complete or partial Oracle CDD/Repository pathname specifying the
Oracle CDD/Repository record description to be copied into the source program.
If record-name is not a literal, the compiler translates
hyphens in the COBOL word to underline characters.
The resultant
pathname must conform to all rules for forming Oracle CDD/Repository pathnames.
- Table 8-1 shows the representation of Oracle CDD/Repository data
types in the HP COBOL compiler. It lists the data types that can
be specified using CDO with the corresponding COBOL data item picture.
Note that COBOL does not have an equivalent specification for some data
types.
Table 8-1 Oracle CDD/Repository Data Types and HP COBOL Equivalents (OpenVMS)
Oracle CDD/Repository Data Type |
HP COBOL Equivalent |
BIT l
|
No equivalent
1
|
SIGNED BYTE l s
|
No equivalent
1
|
UNSIGNED BYTE l s
|
No equivalent
1
|
D_FLOATING s
|
COMP-2 (with /FLOAT=D_FLOAT)
|
D_FLOATING COMPLEX s
|
No equivalent
1
|
DATE
|
No exact equivalent
2
|
F_FLOATING s
|
COMP-1 (with /FLOAT=D_FLOAT or /FLOAT=G_FLOAT)
|
F_FLOATING COMPLEX s
|
No equivalent
1
|
G_FLOATING s
|
COMP-2 (with /FLOAT=G_FLOAT) on Alpha, I64; no equivalent on VAX
|
G_FLOATING COMPLEX s
|
No equivalent
1
|
H_FLOATING s
|
No equivalent
1
|
H_FLOATING COMPLEX s
|
No equivalent
1
|
IEEE S_FLOATING
|
COMP-1 (with /FLOAT=IEEE_FLOAT) on Alpha, I64; no equivalent on VAX
|
IEEE T_FLOATING
|
COMP-2 (with /FLOAT=IEEE_FLOAT) on Alpha, I64; no equivalent on VAX
|
SIGNED LONGWORD l s
|
S9(9) COMP
|
UNSIGNED LONGWORD l s
|
No exact equivalent
3
|
UNSIGNED NUMERIC l s
|
9(m)V9(n)
|
SIGNED NUMERIC LEFT SEPARATE l s
|
S9(m)V9(n) LEADING SEPARATE
|
SIGNED NUMERIC LEFT OVERPUNCHED l s
|
S9(m)V9(n) LEADING
|
SIGNED NUMERIC RIGHT SEPARATE l s
|
S9(m)V9(n) TRAILING SEPARATE
|
SIGNED NUMERIC RIGHT OVERPUNCHED l s
|
S9(m)V9(n) TRAILING
|
SIGNED OCTAWORD l s
|
S9(31) COMP on Alpha, I64; no equivalent on VAX
|
UNSIGNED OCTAWORD l s
|
No exact equivalent
3
|
PACKED NUMERIC l s
|
S9(m)V9(n) COMP-3
|
SIGNED QUADWORD l s
|
S9(18) COMP
|
UNSIGNED QUADWORD l s
|
No exact equivalent
3
|
TEXT m CHARACTERS
|
X(m)
|
UNSPECIFIED m BYTES
|
X(m)
|
VARYING STRING m CHARACTERS
|
No equivalent
1
|
VIRTUAL FIELD
|
Ignored
4
|
SIGNED WORD l s
|
S9(4) COMP
|
UNSIGNED WORD l s
|
No exact equivalent
3
|
POINTER
|
POINTER
|
SEGMENTED STRING
|
No equivalent
1
|
ZONED
|
No equivalent
1
|
1COBOL has no equivalent for this data type. A warning
diagnostic will be issued for such an item that is part of a record
description entry. The compiler will treat that item as if it had been
specified as an alphanumeric data item that occupies that same number
of bytes.
2COBOL has no exact equivalent for this data type. A warning
diagnostic will be issued for such an item that is part of a record
description entry. The compiler will treat that item as if it had been
specified as PIC S9(11)V9(7) COMP. (This gives the item units of
seconds.)
3COBOL has no exact equivalent for this data type. A warning
diagnostic will be issued for such an item that is part of a record
description entry. The compiler will treat that item as if it had been
specified as the corresponding unsigned COMP data type.
4The HP COBOL compiler ignores this data item and all
its phrases.
l The total number of digits in the item.
s The decimal offset to l.
The method for describing the assumed decimal point is different in
the two products. In a COBOL picture, the decimal position is directly
indicated by the symbol V or implied by the symbol P. In CDO, scaled
numbers are specified by two integers: (1) the first integer represents
the total number of decimal digits that the item represents, and (2)
the second integer represents the decimal offset to the first integer.
These are indicated in Table 8-1 by l and s, respectively. For
example, the COBOL data item described by PIC 9(4)V99 is equivalent to
the CDO entry UNSIGNED NUMERIC 6 DIGITS SCALE -2. Similarly, the CDO
entry SIGNED NUMERIC LEFT SEPARATE NUMERIC 6 DIGITS SCALE 2 is
equivalent to the COBOL description PIC S9(6)PP SIGN IS LEADING
SEPARATE. You can also represent digits to the right of the decimal
point in CDO with the FRACTIONS phrase. For example, instead of
UNSIGNED NUMERIC 6 DIGITS SCALE -2, you can also use UNSIGNED NUMERIC 6
DIGITS 2 FRACTIONS.
- One of the primary goals of Oracle CDD/Repository is to describe data in
such a way that data definitions can be shared among many different
processors. Many languages have different semantic interpretations for
the same physical data. Record descriptions in Oracle CDD/Repository must be
able to describe the physical characteristics of data unambiguously. In
other words, the logical view of the data must be separated from the
physical description if different processors are to access the same
record description.
HP COBOL expects numeric literals and
PICTURE character-strings to be obtained from Oracle CDD/Repository in
standard representation. Whether or not a particular COBOL source
program uses the DECIMAL-POINT IS COMMA clause or the CURRENCY SIGN
clause in the SPECIAL-NAMES paragraph, the record description that was
stored in Oracle CDD/Repository must have used the period (.) to represent the
decimal point in numeric literals and PICTURE character-strings, the
comma (,) to represent the comma in PICTURE character-strings, and the
currency symbol ($) to represent the currency symbol in PICTURE
character-strings. When the COBOL source program contains the
DECIMAL-POINT IS COMMA clause, the HP COBOL compiler substitutes
commas for decimal points in numeric literals and PICTURE
character-strings obtained from Oracle CDD/Repository. It substitutes decimal
points for commas in PICTURE character-strings obtained from
Oracle CDD/Repository. When the COBOL source program contains the CURRENCY
SIGN clause, the HP COBOL compiler substitutes the currency
symbol for the currency sign in PICTURE character-strings obtained from
Oracle CDD/Repository. <>
|