HP COBOL II/XL Programmer's Guide : COPYRIGHT NOTICE [ HP COBOL II/XL Programmer's Guide ] MPE/iX 5.0 Documentation
HP COBOL II/XL Programmer's Guide
HP COBOL II/XL Programmer's Guide
Printed in U.S.A.
900 Series HP 3000 Computer Systems
HP Part No. 31500-90002
Edition E0791
Printed July 1991
Notice
The information contained in this document is subject to change without
notice.
HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS
MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard
shall not be liable for errors contained herein or for incidental or
consequential damages in connection with the furnishing, performance or
use of this material.
Hewlett-Packard assumes no responsibility for the use or reliability of
its software on equipment that is not furnished by Hewlett-Packard.
This document contains proprietary information which is protected by
copyright. All rights are reserved. No part of this document may be
photocopied, reproduced, or translated to another language without the
prior written consent of Hewlett-Packard Company.
Copyright (c) 1987, 1988, 1991 by HEWLETT-PACKARD COMPANY
This document contains information which is protected by copyright. All
rights are reserved. Reproduction, adaptation, or translation without
prior written permission is prohibited, except as allowed under the
copyright laws.
Restricted Rights Legend. Use, duplication, or disclosure by the U.S.
Government is subject to restrictions as set forth in subparagraph (c)
(1) (ii) of the Rights in Technical Data and Computer Software clause at
DFARS 252.227-7013 for DOD agencies, and subparagraphs (c) (1) and (c)
(2) of the Commercial Computer Software Restricted Rights clause at FAR
52.227-19 for other agencies.
HEWLETT-PACKARD COMPANY
3000 Hanover Street
Palo Alto, California 94304 U.S.A.
Printing History
New editions are complete version of the manual. Update packages, which
are issued between editions, contain additional and replacement pages to
be merged into the manual by the customer. The dates on the title pages
change only when a new update is published. No information is
incorporated into a reprinting unless it appears as a prior update; the
edition does not change when an update is incorporated.
The software code printed alongside the date indicates the version level
of the software product at the time the manual or update was issued.
Many product updates and fixes do not require manual changes and,
conversely, manual corrections may be done without accompanying product
changes. Therefore, do not expect a one to one correspondence between
product updates and manual updates.
First Edition November 1987 31500A.00.12
Second Edition October 1988 31500A.01.06
Third Edition July 1991 31500A.04.03
Preface
This HP COBOL II/XL Programmer's Guide for the Hewlett-Packard HP COBOL
II/XL programming language is intended for experienced COBOL programmers
who are familiar with the MPE XL file system and HP 3000 subsystems. It
discusses selected HP COBOL II/XL topics in detail and explains statement
interaction where necessary. It does not explain every feature of HP
COBOL II/XL, as the HP COBOL II/XL Reference Manual does.
The following briefly describes each chapter.
Chapter 1 Describes HP COBOL II/XL in terms of its relationship
to COBOL II, ANSI COBOL 1985, ANSI COBOL 1974, and its
environment.
Chapter 2 Describes HP COBOL II/XL in terms of its features.
Chapter 3 Explains structured programming. Tells you how to
design your program for maximum run-time efficiency and
portability.
Chapter 4 Explains how your program can call subprograms and
intrinsics.
Chapter 5 Explains how your program can use files.
Chapter 6 Explains how to compile and link your program.
Chapter 7 Explains how to debug your program.
Additional Documentation
Refer to the following manuals for more information about HP COBOL II/XL:
* HP COBOL II/XL Reference Manual (31500-90001)
* HP COBOL II/XL Quick Reference Guide (31500-90003)
Refer to the following manual for information about migrating HP COBOL
II/V programs to HP COBOL II/XL:
* HP COBOL II/XL Migration Guide (31500-90004)
This manual references the following manuals:
* HP FORTRAN 77 Programmer's Guide (5957-4686)
* KSAM/3000 Reference Manual (30000-90079)
* Using KSAM/XL (32650-90168)
* Using Files: A Guide for New Users of HP 3000 Computer Systems
(30000-90102)
* TurboIMAGE/XL Reference Manual (30391-90001)[REV BEG]
* HP Pascal/XL Reference Manual (31502-90001)
* HP Pascal/XL Programmer's Guide (31502-90002)[REV END]
* HP System Dictionary/XL General Reference Manual (32256-90004)
* HP Screen Management Intrinsic Library Reference Manual
(32424-90002)
* MPE XL Commands Reference Manual (32650-90003)
* MPE XL Intrinsics Reference Manual (32650-90028)[REV BEG]
* MPE XL Error Message Manual, Volume 1 (32650-90066)
* MPE XL Error Message Manual, Volume 2 (32650-90152)[REV END]
* Compiler Library/XL Reference Manual (32650-90029)
* MPE XL System Debug Reference Manual (32650-90013)
* Switch Programming User's Guide (32650-90014)[REV BEG]
* HP Symbolic Debugger/XL User's Guide (31508-90003)[REV END]
* HP TOOLSET/XL Reference Manual (36044-90001)
* HP SQL/XL COBOL Application Programming Guide (36216-90006)
Acknowledgment
At the request of the American National Standards Institute (ANSI), the
following acknowledgment is reproduced in its entirety:
Any organization interested in reproducing the COBOL standard and
specifications in whole or in part, using ideas from this document
as the basis for an instruction manual or for any other purpose, is
free to do so. However, all such organizations are requested to
reproduce the following acknowledgment paragraphs in their entirety
as part of the preface to any such publication (any organization
using a short passage from this document, such as in a book review,
is requested to mention "COBOL" in acknowledgment of the source, but
need not quote the acknowledgment):
COBOL is an industry language and is not the property of any company
or group of companies, or of any organization or group of
organizations.
No warranty, expressed or implied, is made by any contributor or by
the CODASYL Programming Language Committee as to the accuracy and
functioning of the programming system and language. Moreover, no
responsibility is assumed by any contributor, or by the committee,
in connection therewith.
The authors and copyright holders of the copyrighted material used
herein have specifically authorized the use of this material in
whole or in part, in the COBOL specifications. Such authorization
extends to the reproduction and use of COBOL specifications in
programming manuals or similar publications.
FLOW-MATIC (trademark of Sperry Rand Corporation) Programming for
the Univac(R) I and II, Data Automation Systems copyrighted 1958,
1959, by Sperry Rand Corporation; IBM Commercial Translator Form No.
F 28-8013, copyrighted 1959 by IBM, FACT, DSI 27A5260-2760,
copyrighted 1960 by Minneapolis-Honeywell.
Conventions
Notation Description
[REV BEG]
Change bars in the margin show where substantial changes
have been made to this manual since the last
edition.[REV END]
UPPERCASE and Within syntax statements, characters in uppercase must
UNDERLINING be entered in exactly the order shown. Uppercase words
that are underlined are keywords that are always
required when the clause or statement in which they
appear is used in your program. Uppercase words that
are not underlined are optional, and may be included or
omitted. They have no effect on program execution and
serve only to make source program listings more
readable. The following example illustrates this:
[FILE STATUS IS stat-item].
STATUS must be entered, FILE may be either included or
omitted. See also "Underlining in dialog" on the
following page.
italics Within syntax statements, a word in italics represents a
formal parameter, argument, or literal that you must
replace with an actual value. In the following example,
you must replace filename with the name of the file you
want to release:
RELEASE filename
punctuation Within syntax statements, punctuation characters (other
than brackets, braces, vertical parallel lines, and
ellipses) must be entered exactly as shown.
{ } Within syntax statements, when several elements within
braces are stacked, you must select one. In the
following equivalent examples, you select ON or OFF:
{ON }
SETMSG {OFF}
SETMSG {ON }
{OFF}
{| |} Within syntax statements, bars in braces are choice
indicators. One or more of the items within the choice
indicators must be specified, but a single option may be
specified only once.
[ ] Within syntax statements, brackets enclose optional
elements. In the following example, brackets around
,TEMP indicate that the parameter and its delimiter are
not required:
PURGE filename[,TEMP]
When several elements within brackets are stacked, you
can select any one of the elements or none. In the
following equivalent examples, you can select devicename
or deviceclass or neither:
[devicename]
SHOWDEV [deviceclass]
SHOWDEV [devicename ]
[deviceclass]
Underlining in When it is necessary to distinguish user input from
dialog computer output, the input is underlined. See also
underlining on the previous page.
NEW NAME? ALPHA
[ ] ... Brackets followed by a horizontal ellipsis indicate
either that a previous bracketed element may be repeated
zero or more times, or that elements have been omitted
from the description.
[WITH DUPLICATES] ...
The ellipsis shows that the preceding clause may be
repeated indefinitely.
{ } ... Braces followed by a horizontal ellipses indicate either
that the item within braces may be repeated one or more
times, or that elements have been omitted from the
description.
_ Within syntax statements, the space symbol _ shows a
required blank. In the following example, you must
separate modifier and variable with a blank:
SET [(modifier)]_(variable);
<, >, =, <=, These symbols are used in conditional statements to
>=, <> represent the keywords LESS THAN, GREATER THAN, EQUAL
TO, LESS THAN OR EQUAL TO, GREATER THAN OR EQUAL TO, and
NOT EQUAL TO, respectively. Although these symbols
represent keywords, they are not underlined.
; The semicolon is used only to improve readability and is
always optional.
, The comma is used only to improve readability, and is
always optional.
. The period is a terminator or delimiter that is always
required where shown; it must always be entered at the
end of every division name, section name, paragraph
name, and sentence.
^ The caret is occasionally used in examples to represent
an implied decimal point in computer memory.
Shading Features that are part of the 1985 ANSI standard are
shaded. They are accessible through the ANSI85 entry
point.
LG200026_198 In some diagrams and tables, a number appears in the
lower left corner. This number is for HP control
purposes only and should not be interpreted as part of
the diagram or table.
MPE/iX 5.0 Documentation