cobol reference

Download Cobol Reference

Post on 20-Feb-2015

161 views

Category:

Documents

2 download

Embed Size (px)

TRANSCRIPT

Language Reference ManualCOBOL-85 Standard ANSI X3.23B

FEBRUARY 2005 REVISIONThe contents of this manual may be revised without prior notice. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the expressed written permission of LegacyJ Corporation. Copyright LegacyJ Corporation 1997, 2005 All Rights Reserved.

Eighth Edition: February, 2005 LegacyJ has made every effort to ensure that this manual is correct and accurate, but reserves the right to make changes without notice at its sole discretion at any time. Copyright LegacyJ Corporation 1998, 2005 All Rights Reserved

LegacyJ PERCobol Language Reference Manual

ii

PrefaceTrademarks PERCobol, LegacyJ Transaction Platform and LegacyJ are trademarks of LegacyJ Corporation. IBM is a registered trademark of International Business Machines Inc. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. TO BE INCLUDED IN THE PREFACE OF THE MANUAL (REQUIRED BY ANSI WHEN USING INFO FROM THE STANDARDS DOCUMENT): 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, express or implied, is made by any contributor or by the CODASYL COBOL 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 materials used herein: FLOW-MATIC (trademark of Sperry Rand Corporation), Programming for the UNIVAC I and II, Data Automation Systems copyrighted 1958, 1959, by Sperry Rand Corporation; IBM Commercial Translater Form No. F 28-8013, copyrighted 1959 by IBM; FACT, DSI 27A5260-2760. Copyrighted 1960 by MinneapolisHoneywell 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.

LegacyJ PERCobol Language Reference Manual

iii

Contents1. 2. 3. 4. SCOPE .................................................................................................................................................................1 NORMATIVE REFERENCES .........................................................................................................................2 INTERNATIONAL STANDARD CONFORMANCE ....................................................................................3 DESCRIPTION TECHNIQUES .......................................................................................................................6 GENERAL FORMATS ...................................................................................................................................................7 Keywords ..............................................................................................................................................................7 Optional words .....................................................................................................................................................7 Operands...............................................................................................................................................................8 Level numbers .......................................................................................................................................................8 Options..................................................................................................................................................................8 Brackets ................................................................................................................................................................8 Braces ...................................................................................................................................................................8 Ellipses..................................................................................................................................................................8 Punctuation...........................................................................................................................................................9 Special characters.................................................................................................................................................9 Meta-terms............................................................................................................................................................9 RULES ......................................................................................................................................................................10 Syntax rules.........................................................................................................................................................10 General rules ......................................................................................................................................................10 Arguments ...........................................................................................................................................................10 Returned values...................................................................................................................................................10 ARITHMETIC EXPRESSIONS .......................................................................................................................................11 Double subscripts ...............................................................................................................................................11 Ellipses................................................................................................................................................................11 Parentheses.........................................................................................................................................................11 NATURAL LANGUAGE TEXT......................................................................................................................................12 HYPHENS IN TEXT ....................................................................................................................................................13 5. REFERENCE FORMAT .................................................................................................................................14 FIXED-FORM REFERENCE FORMAT ...........................................................................................................................16 Sequence numbers...............................................................................................................................................16 Continuation of lines...........................................................................................................................................16 Blank lines ..........................................................................................................................................................17 Comments ...........................................................................................................................................................17 Debugging lines ..................................................................................................................................................18 FREE-FORM REFERENCE FORMAT .............................................................................................................................19 Continuation of lines...........................................................................................................................................19 Blank lines ..........................................................................................................................................................19 Comments ...........................................................................................................................................................19 Debugging lines ..................................................................................................................................................20 LOGICAL CONVERSION .............................................................................................................................................21 6. COMPILER DIRECTING FACILITY.............................................................................................................23 COPY STATEMENT ..................................................................................................................................................25 REPLACE STATEMENT ...........................................................................................................................................30 COMPILER DIRECTIVES .............................................................................................................................................33 General rules ......................................................................................................................................................33

LegacyJ PERCobol Language Reference Manual

iv

Conditional compilation .....................................................................................................................................33 Constant conditional expression......................................................................................................

Recommended

View more >