208x Filetype PDF File size 1.72 MB Source: www2.southeastern.edu
HPCOBOL
ReferenceManual
Order Number: AA–Q2G0H–TK
January 2005
This manual provides reference information and syntax for the HP
COBOLprogramming language on its platforms: OpenVMS Alpha,
OpenVMSIndustry Standard 64, OpenVMS VAX, and Tru64 UNIX
Alpha.
Revision/Update Information: This manual supersedes the
CompaqCOBOLReference Manual,
Version 2.8 and the VAX COBOL
Reference Manual, Version 5.4, as well
as the online-only Compaq COBOL
Reference Manual, Version 2.8 and
Version 5.7.
Operating System and Version: OpenVMS I64 Version 8.2
OpenVMSAlphaVersion6.2or higher
OpenVMSVAXVersion6.2 or higher
Tru64 UNIX Version 5.1 or higher
Software Version: HPCOBOLforOpenVMSI64
Version 2.8
HPCOBOLforOpenVMSAlpha
Version 2.8
HPCOBOLforTru64UNIX
Version 2.8
HPCOBOLforOpenVMSVAX
Version 5.7A
Hewlett-Packard Company
Palo Alto, California
© Copyright 2005 Hewlett-Packard Development Company, L.P.
Confidential computer software. Valid license from HP required for possession, use or copying.
Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software
Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government
under vendor’s standard commercial license.
The information contained herein is subject to change without notice. The only warranties for HP
products and services are set forth in the express warranty statements accompanying such products
and services. Nothing herein should be construed as constituting an additional warranty. HP shall
not be liable for technical or editorial errors or omissions contained herein.
Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries
in the United States and other countries.
Motif, UNIX®, and X/Open® are trademarks of The Open Group in the U.S. and/or other countries.
All other product names mentioned herein may be trademarks of their respective companies.
Printed in the US
ZK6296
This manual is available on CD–ROM.
This document was prepared using DECdocument, Version 3.3-1b.
Contents
Preface ............................................................ xiii
1 OverviewoftheCOBOLLanguage
1.1 The COBOL Character Set .................................... 1–1
1.2 Character Strings............................................ 1–3
1.2.1 COBOLWords . . . ........................................ 1–3
1.2.1.1 User-Defined Words .................................... 1–3
1.2.1.2 System-Names ........................................ 1–5
1.2.1.3 Reserved Words ....................................... 1–6
1.2.1.4 Function-Names....................................... 1–10
1.2.2 Literals ................................................ 1–10
1.2.2.1 Numeric Literals ...................................... 1–10
1.2.2.2 Nonnumeric Literals . . . ................................ 1–12
1.2.3 Figurative Constants ...................................... 1–14
1.2.4 PICTURECharacter-Strings ................................ 1–16
1.2.5 Separators .............................................. 1–16
1.3 Source Reference Format ...................................... 1–17
1.3.1 ANSI Format ............................................ 1–18
1.3.2 Terminal Format . ........................................ 1–22
1.4 Sample Entry Format ........................................ 1–23
2 Organization of a COBOL Program
2.1 Program Structure . . . ........................................ 2–2
2.1.1 Division Header . . ........................................ 2–3
2.1.2 Section Header. . . ........................................ 2–4
2.1.3 Paragraph, Paragraph Header, Paragraph-Name . ............... 2–5
2.2 Data Division Entries ........................................ 2–5
2.3 Declaratives ................................................ 2–6
3 Identification Division
PROGRAM-ID .............................................. 3–2
AUTHOR .................................................. 3–4
DATE-COMPILED........................................... 3–5
OPTIONS(Alpha, I64) ........................................ 3–6
iii
4 EnvironmentDivision
4.1 CONFIGURATIONSection .................................... 4–2
SOURCE-COMPUTER........................................ 4–3
OBJECT-COMPUTER ........................................ 4–4
SPECIAL-NAMES ........................................... 4–6
4.2 INPUT-OUTPUTSection . . .................................... 4–20
FILE-CONTROL ............................................ 4–21
ASSIGN ................................................... 4–28
BLOCKCONTAINS ......................................... 4–31
CODE-SET................................................. 4–32
LOCKMODE(Alpha,I64) . .................................... 4–33
ORGANIZATION ............................................ 4–34
PADDINGCHARACTER ...................................... 4–35
RECORDDELIMITER(OpenVMS) .............................. 4–36
RESERVE ................................................. 4–37
I-O-CONTROL . . ............................................ 4–38
5 DataDivision
5.1 Logical Concepts of Data Storage................................ 5–1
5.1.1 Record Description Entries ................................. 5–2
5.1.2 Level-Numbers........................................... 5–3
5.1.3 Multiple Record Description Entries for the Same Data ........... 5–4
5.2 Physical Concepts of Data Storage . . . ............................ 5–5
5.2.1 Categories and Classes of Data . . ............................ 5–6
5.2.2 COBOLStandard Alignment Rules .......................... 5–7
5.2.3 Additional Alignment Rules for Record Allocation ............... 5–7
5.2.4 Alpha and I64 Alignment and Padding ........................ 5–15
5.3 DATADIVISIONGeneral Format and Rules....................... 5–16
FD(File Description) ......................................... 5–20
SD(Sort-Merge File Description) ................................ 5–26
RD(Report Description) . . . .................................... 5–27
Data Description ............................................ 5–30
Report Group Description . .................................... 5–34
Screen Description (Alpha, I64) ................................. 5–38
ACCESSMODE............................................. 5–43
ALTERNATERECORDKEY................................... 5–45
AUTO..................................................... 5–48
BACKGROUND-COLOR(Alpha,I64) ............................ 5–49
BELL . .................................................... 5–50
BLANK ................................................... 5–51
BLANKWHENZERO........................................ 5–52
BLINK(Alpha, I64) .......................................... 5–53
CODE..................................................... 5–54
COLUMNNUMBER ......................................... 5–55
CONTROL ................................................. 5–58
Data-Name................................................. 5–61
DATARECORDS............................................ 5–63
iv
no reviews yet
Please Login to review.