Enterprise COBOL for Z/OS V4.2 Language Reference File Data
Enterprise COBOL for z/OS
Language Reference
Version4Release2
SC23-8528-01
Enterprise COBOL for z/OS
Language Reference
Version4Release2
SC23-8528-01 Note! Before using this information and the product it supports, be sure to read the general information under “Notices” on page 625.
Second Edition (August 2009) This edition applies to Version 4 Release 2 of IBM Enterprise COBOL for z/OS (program number 5655-S71) and to all subsequent releases and modifications until otherwise indicated in new editions. Make sure that you are using the correct edition for the level of the product. You can order publications online at www.ibm.com/shop/publications/order/, or order by phone or fax. IBM Software Manufacturing Solutions takes publication orders between 8:30 a.m. and 7:00 p.m. Eastern Standard Time (EST). The phone number is (800)879-2755. The fax number is (800)445-9269. You can also order publications through your IBM representative or the IBM branch office that serves your locality. © Copyright International Business Machines Corporation 1991, 2009. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents
Tables ...... xi TALLY...... 24 WHEN-COMPILED ...... 24 Preface ...... xiii XML-CODE ...... 24 XML-EVENT ...... 25 About this information ...... xiii XML-NAMESPACE...... 31 How to read the syntax diagrams...... xiii XML-NNAMESPACE ...... 32 IBM extensions ...... xvi XML-NAMESPACE-PREFIX ...... 33 Obsolete language elements ...... xvi XML-NNAMESPACE-PREFIX ...... 34 DBCS notation ...... xvii XML-NTEXT ...... 35 Acknowledgment ...... xvii XML-TEXT ...... 35 Accessing softcopy documentation and support Literals ...... 36 information...... xviii Alphanumeric literals ...... 36 Summary of changes ...... xviii Numeric literals ...... 40 || Version 4 Release 2 (August 2009) .....xviii DBCS literals ...... 40 Version 4 Release 1 (December 2007) ....xviii National literals ...... 42 How to send your comments ...... xix PICTURE character-strings ...... 44 Accessibility ...... xx Comments...... 45 Interface information ...... xx Keyboard navigation ...... xx Accessibility of this information ...... xx Chapter 4. Separators ...... 47 || IBM and accessibility ...... xx Rules for separators ...... 47
Part 1. COBOL language structure . . 1 Chapter 5. Sections and paragraphs . . 51 Sentences, statements, and entries ...... 51 Entries ...... 51 Chapter 1. Characters ...... 3 Clauses ...... 52 Sentences ...... 52 Chapter 2. Character sets and code Statements...... 52 pages...... 5 Phrases ...... 52 Character encoding units ...... 5 Single-byte code pages ...... 6 Chapter 6. Reference format .....53 EBCDIC DBCS code pages...... 6 Sequence number area...... 53 Unicode UTF-16 ...... 7 Indicator area...... 53 AreaA...... 54 Chapter 3. Character-strings ...... 9 Division headers...... 54 COBOL words with single-byte characters ....9 Section headers ...... 54 User-defined words with DBCS characters ....10 Paragraph headers or paragraph names ....54 User-defined words...... 10 Level indicators (FD and SD) or level-numbers System-names ...... 12 (01and77)...... 55 Function-names ...... 12 DECLARATIVES and END DECLARATIVES . . 55 Reserved words ...... 12 End program, end class, and end method Figurative constants ...... 13 markers ...... 55 Special registers ...... 15 AreaB...... 55 ADDRESS OF ...... 17 Entries, sentences, statements, clauses ....56 DEBUG-ITEM ...... 17 Continuation lines ...... 56 JNIENVPTR ...... 18 AreaAorAreaB...... 58 LENGTH OF ...... 18 Level-numbers ...... 58 LINAGE-COUNTER ...... 20 Comment lines ...... 58 RETURN-CODE ...... 20 Compiler-directing statements ...... 59 SHIFT-OUT and SHIFT-IN ...... 21 Debugging lines ...... 59 SORT-CONTROL ...... 21 Pseudo-text ...... 59 SORT-CORE-SIZE ...... 22 Blank lines ...... 59 SORT-FILE-SIZE ...... 22 SORT-MESSAGE ...... 23 Chapter 7. Scope of names ...... 61 SORT-MODE-SIZE ...... 23 Types of names ...... 61 SORT-RETURN ...... 23 External and internal resources ...... 63
© Copyright IBM Corp. 1991, 2009 iii Resolution of names ...... 64 Part 4. Environment division . . . 113 Names within programs ...... 64 Names within a class definition ...... 65 Chapter 15. Configuration section . . 115 Chapter 8. Referencing data names, SOURCE-COMPUTER paragraph...... 116 OBJECT-COMPUTER paragraph ...... 117 copy libraries, and procedure division SPECIAL-NAMES paragraph ...... 118 names ...... 67 ALPHABET clause ...... 121 Uniqueness of reference ...... 67 SYMBOLIC CHARACTERS clause ...... 123 Qualification ...... 67 CLASS clause ...... 124 Identical names ...... 68 CURRENCY SIGN clause ...... 124 References to COPY libraries ...... 68 DECIMAL-POINT IS COMMA clause .....126 References to procedure division names ....68 || XML-SCHEMA clause ...... 126 References to data division names ...... 69 | Environment variable contents for an XML Condition-name ...... 72 || schema file ...... 126 Index-name ...... 73 REPOSITORY paragraph ...... 127 Index data item ...... 73 General rules ...... 129 Subscripting ...... 73 Identifying and referencing a class .....129 Reference modification ...... 76 Function-identifier ...... 79 Chapter 16. Input-Output section . . . 131 Data attribute specification ...... 80 FILE-CONTROL paragraph...... 132 SELECT clause ...... 136 Chapter 9. Transfer of control .....81 ASSIGN clause ...... 136 Assignment name for environment variable . . 138 Chapter 10. Millennium Language Environment variable contents for a QSAM file 138 Extensions and date fields ...... 83 Environment variable contents for a Millennium Language Extensions syntax ....83 line-sequential file ...... 140 Terms and concepts...... 84 Environment variable contents for a VSAM file 140 Date field ...... 84 RESERVE clause ...... 141 Nondate ...... 85 ORGANIZATION clause ...... 141 Century window ...... 85 File organization ...... 142 PADDING CHARACTER clause ...... 144 RECORD DELIMITER clause ...... 144 Part 2. COBOL source unit ACCESS MODE clause ...... 145 structure ...... 87 File organization and access modes .....145 Access modes ...... 146 Chapter 11. COBOL program structure 89 Relationship between data organizations and access modes ...... 146 Nested programs ...... 91 RECORD KEY clause ...... 147 Conventions for program-names ...... 92 ALTERNATE RECORD KEY clause ...... 148 RELATIVE KEY clause ...... 149 Chapter 12. COBOL class definition PASSWORD clause ...... 149 structure ...... 95 FILE STATUS clause ...... 150 I-O-CONTROL paragraph ...... 151 Chapter 13. COBOL method definition RERUN clause ...... 153 structure ...... 99 SAME AREA clause ...... 154 SAME RECORD AREA clause ...... 155 SAME SORT AREA clause ...... 156 Part 3. Identification division . . . 101 SAME SORT-MERGE AREA clause ...... 156 MULTIPLE FILE TAPE clause ...... 156 Chapter 14. Identification division . . 103 APPLY WRITE-ONLY clause ...... 157 PROGRAM-ID paragraph ...... 106 CLASS-ID paragraph ...... 109 Part 5. Data division ...... 159 General rules ...... 109 Inheritance ...... 109 Chapter 17. Data division overview 161 FACTORY paragraph ...... 110 OBJECT paragraph ...... 110 File section ...... 162 METHOD-ID paragraph ...... 110 Working-storage section ...... 163 Method signature ...... 110 Local-storage section ...... 164 Method overloading, overriding, and hiding . . 110 Linkage section...... 165 Optional paragraphs ...... 111 Data units ...... 165 iv Enterprise COBOL for z/OS V4.2 Language Reference File data ...... 165 Character-string representation ...... 215 Program data ...... 166 Data categories and PICTURE rules .....216 Method data ...... 166 PICTURE clause editing ...... 223 Factory data ...... 166 Simple insertion editing ...... 224 Instance data ...... 166 Special insertion editing ...... 224 Data relationships ...... 166 Fixed insertion editing ...... 224 Levels of data ...... 167 Floating insertion editing ...... 225 Levels of data in a record description entry . . 167 Zero suppression and replacement editing. . . 227 Special level-numbers ...... 169 REDEFINES clause ...... 228 Indentation ...... 169 REDEFINES clause considerations .....230 Classes and categories of group items ....169 REDEFINES clause examples ...... 230 Classes and categories of data ...... 170 Undefined results ...... 231 Category descriptions ...... 172 RENAMES clause ...... 231 Alignment rules ...... 174 SIGN clause ...... 234 Character-string and item size ...... 175 SYNCHRONIZED clause ...... 236 Signed data ...... 176 Slack bytes ...... 238 Operational signs ...... 176 Slack bytes within records ...... 238 Editing signs ...... 176 Slack bytes between records ...... 240 USAGE clause ...... 241 Chapter 18. Data division--file Computational items ...... 243 description entries ...... 177 DISPLAY phrase ...... 245 DISPLAY-1 phrase ...... 246 File section ...... 182 FUNCTION-POINTER phrase ...... 246 EXTERNAL clause ...... 182 INDEX phrase ...... 246 GLOBAL clause ...... 183 NATIONAL phrase ...... 247 BLOCK CONTAINS clause ...... 183 OBJECT REFERENCE phrase ...... 247 RECORD clause ...... 185 POINTER phrase ...... 248 Format 1 ...... 185 PROCEDURE-POINTER phrase ...... 249 Format 2 ...... 186 NATIVE phrase ...... 250 Format 3 ...... 186 VALUE clause ...... 250 LABEL RECORDS clause ...... 187 Format 1 ...... 250 VALUE OF clause ...... 188 Format 2 ...... 252 DATA RECORDS clause ...... 188 Format 3 ...... 255 LINAGE clause...... 188 LINAGE-COUNTER special register .....190 RECORDING MODE clause ...... 190 Part 6. Procedure division.....257 CODE-SET clause ...... 191 Chapter 20. Procedure division Chapter 19. Data division--data structure ...... 261 description entry ...... 193 Requirements for a method procedure division . . 262 Format 1 ...... 193 The procedure division header ...... 263 Format 2 ...... 194 The USING phrase ...... 264 Format 3 ...... 194 RETURNING phrase ...... 266 Level-numbers ...... 194 References to items in the linkage section . . . 266 BLANK WHEN ZERO clause ...... 196 Declaratives ...... 267 DATE FORMAT clause ...... 196 Procedures ...... 268 Semantics of windowed date fields .....197 Arithmetic expressions ...... 269 Restrictions on using date fields ...... 198 Arithmetic operators ...... 270 EXTERNAL clause ...... 201 Arithmetic with date fields ...... 272 GLOBAL clause ...... 202 Conditional expressions ...... 275 JUSTIFIED clause ...... 202 Simple conditions ...... 275 GROUP-USAGE clause ...... 203 Class condition ...... 275 OCCURS clause ...... 204 Condition-name condition ...... 277 Fixed-length tables ...... 205 Relation conditions ...... 279 ASCENDING KEY and DESCENDING KEY General relation conditions ...... 279 phrases ...... 206 Data pointer relation conditions ...... 288 INDEXED BY phrase ...... 207 Procedure-pointer and function-pointer relation Variable-length tables...... 208 conditions ...... 289 OCCURS DEPENDING ON clause .....209 Object-reference relation conditions .....290 PICTURE clause ...... 211 Sign condition ...... 291 Symbols used in the PICTURE clause ....211 Switch-status condition ...... 292
Contents v Complex conditions ...... 292 REMAINDER phrase ...... 352 Negated simple conditions ...... 293 SIZE ERROR phrases ...... 352 Combined conditions...... 293 END-DIVIDE phrase ...... 353 Abbreviated combined relation conditions . . . 295 ENTRY statement ...... 354 Statement categories ...... 298 USING phrase ...... 354 Imperative statements ...... 298 EVALUATE statement ...... 355 Conditional statements ...... 300 END-EVALUATE phrase ...... 356 Delimited scope statements...... 301 Determining values ...... 356 Explicit scope terminators ...... 301 Comparing selection subjects and objects . . . 357 Implicit scope terminators ...... 302 Executing the EVALUATE statement ....358 Compiler-directing statements ...... 302 EXIT statement ...... 359 Statement operations ...... 302 EXIT METHOD statement ...... 360 CORRESPONDING phrase ...... 302 EXIT PROGRAM statement ...... 361 GIVING phrase...... 304 GOBACK statement ...... 362 ROUNDED phrase ...... 304 GO TO statement ...... 363 SIZE ERROR phrases ...... 304 Unconditional GO TO ...... 363 Arithmetic statements ...... 306 Conditional GO TO ...... 363 Arithmetic statement operands ...... 306 Altered GO TO ...... 364 Data manipulation statements ...... 307 MORE-LABELS GO TO ...... 364 Input-output statements ...... 308 IF statement ...... 366 Common processing facilities ...... 308 END-IF phrase ...... 366 Transferring control ...... 367 Chapter 21. Procedure division Nested IF statements ...... 367 statements ...... 315 INITIALIZE statement ...... 368 REPLACING phrase ...... 369 ACCEPT statement ...... 316 INITIALIZE statement rules ...... 369 Data transfer ...... 316 INSPECT statement ...... 371 System date-related information transfer . . . 318 TALLYING phrase (formats 1 and 3) ....374 DATE, DATE YYYYMMDD, DAY, DAY REPLACING phrase (formats 2 and 3) ....375 YYYYDDD, DAY-OF-WEEK, and TIME....318 BEFORE and AFTER phrases (all formats) . . . 376 ADD statement...... 321 CONVERTING phrase (format 4)...... 377 ROUNDED phrase ...... 323 Data flow ...... 378 SIZE ERROR phrases ...... 323 Comparison cycle ...... 379 CORRESPONDING phrase (format 3) ....323 Example of the INSPECT statement .....379 END-ADD phrase ...... 324 INVOKE statement ...... 381 ALTER statement ...... 325 USING phrase ...... 383 Segmentation considerations ...... 325 BY VALUE phrase...... 383 CALL statement ...... 327 RETURNING phrase ...... 384 USING phrase ...... 329 ON EXCEPTION phrase...... 385 BY REFERENCE phrase ...... 330 NOT ON EXCEPTION phrase ...... 385 BY CONTENT phrase ...... 330 END-INVOKE phrase ...... 385 BY VALUE phrase...... 331 Interoperable data types for COBOL and Java 386 RETURNING phrase ...... 332 Miscellaneous argument types for COBOL and ON EXCEPTION phrase...... 333 Java ...... 387 NOT ON EXCEPTION phrase ...... 333 MERGE statement ...... 389 ON OVERFLOW phrase...... 333 ASCENDING/DESCENDING KEY phrase . . 390 END-CALL phrase ...... 334 COLLATING SEQUENCE phrase...... 391 CANCEL statement ...... 335 USING phrase ...... 392 CLOSE statement ...... 337 GIVING phrase...... 393 Effect of CLOSE statement on file types . . . 338 OUTPUT PROCEDURE phrase ...... 393 COMPUTE statement...... 341 MERGE special registers...... 394 ROUNDED phrase ...... 342 Segmentation considerations ...... 394 SIZE ERROR phrases ...... 342 MOVE statement ...... 395 END-COMPUTE phrase ...... 342 Elementary moves...... 396 CONTINUE statement ...... 343 Moves involving file record areas...... 401 DELETE statement ...... 344 Group moves ...... 401 Sequential access mode ...... 344 MULTIPLY statement...... 403 Random or dynamic access mode .....345 ROUNDED phrase ...... 405 END-DELETE phrase...... 345 SIZE ERROR phrases ...... 405 DISPLAY statement ...... 346 END-MULTIPLY phrase ...... 405 DIVIDE statement ...... 349 OPEN statement ...... 406 ROUNDED phrase ...... 352 vi Enterprise COBOL for z/OS V4.2 Language Reference General rules ...... 408 OUTPUT PROCEDURE phrase ...... 455 Label records ...... 408 SORT special registers ...... 456 OPEN statement notes ...... 409 Segmentation considerations ...... 456 PERFORM statement ...... 412 START statement ...... 457 Basic PERFORM statement ...... 412 KEY phrase ...... 457 END-PERFORM ...... 414 INVALID KEY phrases ...... 458 PERFORM with TIMES phrase ...... 414 END-START phrase ...... 458 PERFORM with UNTIL phrase ...... 415 Indexed files ...... 458 PERFORM with VARYING phrase .....416 Relative files...... 459 Varying identifiers...... 417 STOP statement ...... 460 Varying two identifiers ...... 418 STRING statement...... 461 Varying three identifiers ...... 420 ON OVERFLOW phrases ...... 463 Varying more than three identifiers .....420 END-STRING phrase ...... 463 Varying phrase rules ...... 421 Data flow ...... 464 READ statement ...... 422 SUBTRACT statement ...... 466 KEY IS phrase ...... 423 ROUNDED phrase ...... 468 AT END phrases ...... 423 SIZE ERROR phrases ...... 468 INVALID KEY phrases ...... 424 CORRESPONDING phrase (format 3) ....469 END-READ phrase ...... 424 END-SUBTRACT phrase ...... 469 Multiple record processing ...... 424 UNSTRING statement ...... 470 Sequential access mode ...... 424 DELIMITED BY phrase ...... 472 Random access mode...... 427 INTO phrase ...... 473 Dynamic access mode ...... 427 POINTER phrase ...... 473 READ statement notes: ...... 428 TALLYING IN phrase ...... 473 RELEASE statement ...... 429 ON OVERFLOW phrases ...... 473 RETURN statement ...... 431 END-UNSTRING phrase ...... 474 AT END phrases ...... 432 Data flow ...... 474 END-RETURN phrase ...... 432 Example of the UNSTRING statement ....476 REWRITE statement ...... 433 WRITE statement ...... 478 INVALID KEY phrases ...... 434 ADVANCING phrase...... 480 END-REWRITE phrase ...... 434 END-OF-PAGE phrases ...... 481 Reusing a logical record ...... 434 INVALID KEY phrases ...... 482 Sequential files ...... 434 END-WRITE phrase ...... 483 Indexed files ...... 434 WRITE for sequential files ...... 483 Relative files...... 435 WRITE for indexed files ...... 485 SEARCH statement ...... 436 WRITE for relative files ...... 485 Serial search ...... 437 XML GENERATE statement ...... 487 Binary search ...... 439 Nested XML GENERATE or XML PARSE Search statement considerations ...... 441 statements ...... 492 AT END and WHEN phrases ...... 442 Operation of XML GENERATE ...... 492 NEXT SENTENCE...... 442 Format conversion of elementary data ....493 END-SEARCH phrase ...... 442 Trimming of generated XML data .....494 SET statement ...... 443 XML element name and attribute name Format 1: SET for basic table handling ....443 formation...... 495 Format 2: SET for adjusting indexes .....444 XML PARSE statement ...... 496 Format 3: SET for external switches .....445 Nested XML GENERATE or XML PARSE Format 4: SET for condition-names .....446 statements ...... 500 Format 5: SET for USAGE IS POINTER data Control flow...... 501 items ...... 446 Format 6: SET for procedure-pointer and Part 7. Intrinsic functions .....503 function-pointer data items ...... 447 Format 7: SET for USAGE OBJECT REFERENCE data items ...... 449 Chapter 22. Intrinsic functions ....505 SORT statement ...... 450 Specifying a function ...... 505 ASCENDING KEY and DESCENDING KEY Function definition and evaluation .....506 phrases ...... 451 Types of functions ...... 506 DUPLICATES phrase ...... 452 Rules for usage...... 507 COLLATING SEQUENCE phrase...... 453 Arguments ...... 508 USING phrase ...... 453 Examples...... 510 INPUT PROCEDURE phrase ...... 454 ALL subscripting ...... 510 GIVING phrase...... 454 Function definitions ...... 512
Contents vii ACOS ...... 516 Object code listing...... 556 ANNUITY ...... 516 Storage map listing ...... 556 ASIN ...... 517 COPY statement ...... 556 ATAN...... 517 SUPPRESS phrase ...... 559 CHAR...... 517 REPLACING phrase ...... 559 COS...... 518 Replacement and comparison rules .....560 CURRENT-DATE ...... 518 DELETE statement ...... 563 DATE-OF-INTEGER ...... 520 EJECT statement ...... 564 DATE-TO-YYYYMMDD ...... 520 ENTER statement ...... 565 DATEVAL...... 521 INSERT statement ...... 565 DAY-OF-INTEGER ...... 522 READY or RESET TRACE statement .....566 DAY-TO-YYYYDDD ...... 523 REPLACE statement ...... 566 DISPLAY-OF ...... 524 Continuation rules for pseudo-text .....568 FACTORIAL...... 525 Comparison operation ...... 568 INTEGER ...... 526 REPLACE statement notes ...... 569 INTEGER-OF-DATE ...... 526 SERVICE LABEL statement...... 570 INTEGER-OF-DAY ...... 527 SERVICE RELOAD statement ...... 570 INTEGER-PART ...... 527 SKIP statements ...... 570 LENGTH ...... 528 TITLE statement ...... 571 LOG...... 529 USE statement ...... 572 LOG10 ...... 529 EXCEPTION/ERROR declarative...... 572 LOWER-CASE ...... 530 Precedence rules for nested programs ....574 MAX...... 530 LABEL declarative...... 574 MEAN ...... 531 DEBUGGING declarative ...... 576 MEDIAN ...... 532 MIDRANGE...... 532 Appendix A. IBM extensions .....579 MIN...... 533 MOD...... 534 Appendix B. Compiler limits .....591 NATIONAL-OF ...... 534 NUMVAL ...... 535 NUMVAL-C ...... 536 Appendix C. EBCDIC and ASCII ORD...... 538 collating sequences ...... 595 ORD-MAX ...... 539 EBCDIC collating sequence...... 595 ORD-MIN ...... 539 US English ASCII code page ...... 598 PRESENT-VALUE ...... 540 RANDOM ...... 540 Appendix D. Source language RANGE ...... 541 debugging...... 603 REM...... 542 Debugging lines ...... 603 REVERSE...... 542 Debugging sections ...... 603 SIN...... 543 DEBUG-ITEM special register ...... 604 SQRT...... 543 Activate compile-time switch ...... 604 STANDARD-DEVIATION ...... 544 Activate object-time switch ...... 604 SUM...... 544 TAN...... 545 UNDATE...... 545 Appendix E. Reserved words ....605 UPPER-CASE ...... 546 VARIANCE ...... 546 Appendix F. ASCII considerations. . . 619 WHEN-COMPILED ...... 547 Environment division ...... 619 YEAR-TO-YYYY ...... 548 OBJECT-COMPUTER and SPECIAL-NAMES YEARWINDOW ...... 549 paragraphs ...... 619 FILE-CONTROL paragraph...... 620 Part 8. Compiler-directing I-O-CONTROL paragraph ...... 620 Data division ...... 620 statements ...... 551 FD Entry: CODE-SET clause ...... 621 Data description entries ...... 621 Chapter 23. Compiler-directing Procedure division ...... 621 statements ...... 553 BASIS statement ...... 553 Appendix G. Industry specifications 623 CBL (PROCESS) statement ...... 554 *CONTROL (*CBL) statement ...... 554 Notices ...... 625 Source code listing ...... 556 viii Enterprise COBOL for z/OS V4.2 Language Reference Programming interface information ...... 626 Related COBOL publications ...... 657 Trademarks ...... 626 Other related publications ...... 657
Glossary ...... 629 Index ...... 659
List of resources ...... 657 Enterprise COBOL for z/OS ...... 657
Contents ix x Enterprise COBOL for z/OS V4.2 Language Reference Tables
1. Basic COBOL character set ...... 3 34. Exponentiation size error conditions 305 2. DEBUG-ITEM subfield contents .....18 35. How the composite of operands is 3. XML events and associated special register determined ...... 306 contents ...... 26 36. File status key values and meanings 309 4. Separators ...... 47 37. Sequential files and CLOSE statement 5. Meanings of environment names ....120 phrases ...... 339 6. Types of files ...... 132 38. Indexed and relative file types and CLOSE 7. Classes and categories of group items 170 statement phrases ...... 339 8. Class, category, and usage of elementary 39. Line-sequential file types and CLOSE data items ...... 171 statement phrases ...... 339 9. Classes and categories of functions ....171 40. Meanings of key letters for sequential file 10. Classes and categories of literals .....171 types ...... 339 11. Where national group items are processed as 41. Treatment of the content of data items 377 groups ...... 204 42. Interoperable Java and COBOL data types 386 12. PICTURE clause symbol meanings ....212 43. Interoperable COBOL and Java array and 13. Numeric types ...... 217 String data types ...... 387 14. Data categories ...... 223 44. COBOL miscellaneous argument types and 15. SYNCHRONIZE clause effect on other corresponding Java types ...... 388 language elements...... 236 45. COBOL literal argument types and 16. Relation test references for condition-names 254 corresponding Java types ...... 388 17. Binary and unary operators ...... 270 46. Valid and invalid elementary moves 399 18. Valid arithmetic symbol pairs ...... 271 47. Moves involving date fields ...... 401 19. Results of using date fields in addition 272 48. Availability of a file ...... 409 20. Results of using date fields in subtraction 273 49. Permissible statements for sequential files 410 21. Storing arithmetic results that involve date 50. Permissible statements for indexed and fields when ON SIZE ERROR is specified . 274 relative files ...... 410 22. Valid forms of the class condition for 51. Permissible statements for line-sequential different types of data items ...... 277 files ...... 410 23. Relational operators and their meanings 280 52. Sending and receiving fields for format-1 24. Comparisons involving data items and SET statement ...... 444 literals ...... 282 53. Sending and receiving fields for format-5 25. Comparisons involving figurative constants 283 SET statement ...... 447 26. Comparisons for index-names and index 54. Character positions examined when data items ...... 287 DELIMITED BY is not specified .....475 27. Comparisons with date fields ...... 288 55. Meanings of environment-names in 28. Permissible comparisons for USAGE SPECIAL NAMES paragraph ...... 485 POINTER, NULL, and ADDRESS OF ...289 56. Table of functions ...... 513 29. Logical operators and their meanings 292 57. Execution of debugging declaratives ....577 30. Combined conditions—permissible element 58. IBM extension language elements ....579 sequences ...... 294 59. Compiler limits ...... 591 31. Logical operators and evaluation results of 60. EBCDIC collating sequence ...... 595 combined conditions ...... 294 61. ASCII collating sequence ...... 598 32. Abbreviated combined conditions: 62. Reserved words ...... 605 permissible element sequences .....297 33. Abbreviated combined conditions: unabbreviated equivalents ...... 298
© Copyright IBM Corp. 1991, 2009 xi xii Enterprise COBOL for z/OS V4.2 Language Reference Preface
About this information
This information describes the COBOL language supported by IBM® Enterprise COBOL for z/OS®, referred to in this information as Enterprise COBOL.
See the IBM Enterprise COBOL for z/OS Programming Guide for information and examples that will help you write, compile, and debug programs and classes. How to read the syntax diagrams
Use the following description to read the syntax diagrams in this document: v Read the syntax diagrams from left to right, from top to bottom, following the path of the line. The >>--- symbol indicates the beginning of a syntax diagram. The ---> symbol indicates that the syntax diagram is continued on the next line. The >--- symbol indicates that the syntax diagram is continued from the previous line. The --->< symbol indicates the end of a syntax diagram. Diagrams of syntactical units other than complete statements start with the >--- symbol and end with the ---> symbol. v Required items appear on the horizontal line (the main path).
Format