0% found this document useful (0 votes)
17 views1,106 pages

COB64 Programming Guide

The document is the Programming Guide for IBM's Enterprise COBOL for z/OS version 6.4, detailing its features, coding techniques, and best practices. It includes comprehensive chapters on program structure, data handling, file processing, and internationalization. The guide emphasizes the importance of using the correct edition and checking for updates regularly due to the continuous delivery model.

Uploaded by

rupesh waghdhare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1,106 pages

COB64 Programming Guide

The document is the Programming Guide for IBM's Enterprise COBOL for z/OS version 6.4, detailing its features, coding techniques, and best practices. It includes comprehensive chapters on program structure, data handling, file processing, and internationalization. The guide emphasizes the importance of using the correct edition and checking for updates regularly due to the continuous delivery model.

Uploaded by

rupesh waghdhare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1106

Enterprise COBOL for z/OS

6.4

Programming Guide

IBM

SC27-8714-03
Note
Before using this information and the product it supports, be sure to read the general information under
“Notices” on page 973.

Fourth edition (28 June 2024 update)


This edition applies to Version 6.4 of IBM® Enterprise COBOL for z/OS® (program number 5655-EC6) 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 view or download softcopy publications free of charge in the Enterprise COBOL for z/OS library. Because
Enterprise COBOL for z/OS supports the continuous delivery (CD) model and publications are updated to document the
features delivered under the CD model, it is a good idea to check for updates once every two months.
It is our intention to update the product documentation for this release periodically, without updating the order number.
If you need to uniquely refer to the version of your product documentation, refer to the order number with the date of
update.
© Copyright International Business Machines Corporation 1991, 2024.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
Contents

Tables.................................................................................................................xxi

Preface............................................................................................................. xxix
About this information.............................................................................................................................xxix
How this information will help you.................................................................................................... xxix
Abbreviated terms..............................................................................................................................xxix
Comparison of commonly used terms................................................................................................xxx
How to read syntax diagrams............................................................................................................ xxxi
How examples are shown................................................................................................................. xxxii
Additional documentation and support................................................................................................ xxxiii
Summary of changes............................................................................................................................. xxxiii
Enterprise COBOL for z/OS 6.4 with PTFs installed........................................................................ xxxiii
Enterprise COBOL for z/OS 6.4........................................................................................................ xxxiv
How to send your comments..................................................................................................................xxxv

Part 1. Coding your program.................................................................................. 1

Chapter 1. Structuring your program...........................................................................................................3


Identifying a program............................................................................................................................. 3
Identifying a program as recursive...................................................................................................4
Marking a program as callable by containing programs.................................................................. 4
Setting a program to an initial state................................................................................................. 4
Changing the header of a source listing........................................................................................... 5
Describing the computing environment.................................................................................................5
Example: FILE-CONTROL entries..................................................................................................... 6
Specifying the collating sequence.................................................................................................... 7
Defining symbolic characters........................................................................................................... 8
Defining a user-defined class........................................................................................................... 8
Defining files to the operating system.............................................................................................. 8
Describing the data.............................................................................................................................. 11
Using data in input and output operations.....................................................................................11
Comparison of WORKING-STORAGE and LOCAL-STORAGE......................................................... 14
Using data from another program.................................................................................................. 16
Processing the data.............................................................................................................................. 17
How logic is divided in the PROCEDURE DIVISION.......................................................................18
Declaratives.................................................................................................................................... 21

Chapter 2. Using data................................................................................................................................ 23


Using variables, structures, literals, and constants............................................................................ 23
Using variables................................................................................................................................23
Using data items and group items..................................................................................................24
Using literals................................................................................................................................... 25
Using constants...............................................................................................................................26
Using figurative constants.............................................................................................................. 26
Assigning values to data items.............................................................................................................26
Examples: initializing data items....................................................................................................28
Initializing a structure (INITIALIZE).............................................................................................. 31
Assigning values to elementary data items (MOVE)...................................................................... 32
Assigning values to group data items (MOVE)............................................................................... 33
Assigning arithmetic results (MOVE or COMPUTE)........................................................................ 34

iii
Assigning input from a screen or file (ACCEPT)............................................................................. 35
Displaying values on a screen or in a file (DISPLAY)........................................................................... 35
Displaying data on the system logical output device.....................................................................36
Using WITH NO ADVANCING..........................................................................................................37
Using intrinsic functions (built-in functions)....................................................................................... 38
Using tables (arrays) and pointers....................................................................................................... 39
Storage and its addressability..............................................................................................................39

Chapter 3. Working with numbers and arithmetic.................................................................................... 43


Defining numeric data.......................................................................................................................... 43
Displaying numeric data.......................................................................................................................45
Controlling how numeric data is stored...............................................................................................46
Formats for numeric data.....................................................................................................................47
Examples: numeric data and internal representation................................................................... 49
Data format conversions...................................................................................................................... 51
Conversions and precision..............................................................................................................52
Sign representation of zoned and packed-decimal data.................................................................... 53
Checking for incompatible data (numeric class test)..........................................................................53
Performing arithmetic.......................................................................................................................... 55
Using COMPUTE and other arithmetic statements........................................................................55
Using arithmetic expressions......................................................................................................... 56
Using numeric intrinsic functions................................................................................................... 56
Using math-oriented callable services...........................................................................................58
Using date callable services........................................................................................................... 59
Examples: numeric intrinsic functions........................................................................................... 60
Fixed-point contrasted with floating-point arithmetic........................................................................62
Examples: fixed-point and floating-point evaluations...................................................................63
Using currency signs............................................................................................................................ 64
Example: multiple currency signs.................................................................................................. 65

Chapter 4. Handling tables........................................................................................................................ 67


Defining a table (OCCURS)................................................................................................................... 67
Nesting tables.......................................................................................................................................69
Example: subscripting.................................................................................................................... 70
Example: indexing...........................................................................................................................70
Referring to an item in a table..............................................................................................................70
Subscripting.................................................................................................................................... 71
Indexing.......................................................................................................................................... 72
Putting values into a table....................................................................................................................73
Loading a table dynamically........................................................................................................... 73
Initializing a table (INITIALIZE)..................................................................................................... 73
Assigning values when you define a table (VALUE)....................................................................... 74
Example: PERFORM and subscripting............................................................................................76
Example: PERFORM and indexing.................................................................................................. 77
Creating variable-length tables (DEPENDING ON)............................................................................. 78
Loading a variable-length table...................................................................................................... 80
Assigning values to a variable-length table................................................................................... 80
Complex OCCURS DEPENDING ON..................................................................................................... 81
Example: complex ODO.................................................................................................................. 81
Effects of change in ODO object value........................................................................................... 82
Searching a table.................................................................................................................................. 84
Doing a serial search (SEARCH)......................................................................................................85
Doing a binary search (SEARCH ALL)............................................................................................. 86
Sorting a table...................................................................................................................................... 87
Processing table items using intrinsic functions................................................................................. 87
Example: processing tables using intrinsic functions....................................................................88
Working with unbounded tables and groups.......................................................................................88
Example: Using unbounded tables for parsing XML documents...................................................89

iv
Chapter 5. Selecting and repeating program actions............................................................................... 91
Selecting program actions................................................................................................................... 91
Coding a choice of actions.............................................................................................................. 91
Coding conditional expressions......................................................................................................95
Repeating program actions.................................................................................................................. 99
Choosing inline or out-of-line PERFORM....................................................................................... 99
Coding a loop................................................................................................................................ 100
Looping through a table................................................................................................................101
Executing multiple paragraphs or sections................................................................................. 101

Chapter 6. Handling strings.....................................................................................................................103


Joining data items (STRING)............................................................................................................. 103
Example: STRING statement....................................................................................................... 104
Splitting data items (UNSTRING).......................................................................................................105
Example: UNSTRING statement.................................................................................................. 106
Manipulating null-terminated strings................................................................................................ 108
Example: null-terminated strings................................................................................................ 108
Referring to substrings of data items................................................................................................ 109
Reference modifiers..................................................................................................................... 110
Example: arithmetic expressions as reference modifiers........................................................... 111
Example: intrinsic functions as reference modifiers................................................................... 111
Tallying and replacing data items (INSPECT)....................................................................................112
Examples: INSPECT statement....................................................................................................112
Converting data items (intrinsic functions)....................................................................................... 113
Changing case (UPPER-CASE, LOWER-CASE)............................................................................. 114
Transforming to reverse order (REVERSE)...................................................................................114
Converting to numbers (NUMVAL, NUMVAL-C, NUMVAL-F)........................................................115
Converting from one code page to another................................................................................. 116
Converting to hexadecimal or bit data (HEX-OF, BIT-OF)........................................................... 116
Converting from hexadecimal or bit data (HEX-TO-CHAR, BIT-TO-CHAR).................................117
Evaluating data items (intrinsic functions)........................................................................................ 117
Evaluating single characters for collating sequence................................................................... 118
Finding the largest or smallest data item.................................................................................... 118
Finding the length of data items...................................................................................................120
Finding the date of compilation....................................................................................................121

Chapter 7. Processing data in an international environment................................................................. 123


Unicode and the encoding of language characters........................................................................... 124
Using national data (Unicode) in COBOL........................................................................................... 125
Defining national data items........................................................................................................ 126
Using national literals................................................................................................................... 126
COBOL statements and national data..........................................................................................127
Intrinsic functions and national data........................................................................................... 130
Using national-character figurative constants.............................................................................132
Defining national numeric data items.......................................................................................... 132
National groups.............................................................................................................................133
Converting to or from national (Unicode) representation........................................................... 134
Using national groups................................................................................................................... 137
Storage of character data............................................................................................................. 139
Comparing national (UTF-16) data.............................................................................................. 140
Using UTF-8 data (Unicode) in COBOL.............................................................................................. 142
Defining UTF-8 data items............................................................................................................142
Using UTF-8 literals...................................................................................................................... 144
COBOL statements and UTF-8 data items...................................................................................145
Intrinsic functions support for UTF-8 data items........................................................................ 146
Db2 considerations.......................................................................................................................147
Using UTF-8-character figurative constants................................................................................147

v
Reference modifiers and UTF-8 data items.................................................................................148
UTF-8 groups................................................................................................................................ 149
Converting to or from UTF-8 (Unicode) representation.............................................................. 150
Comparing UTF-8 data................................................................................................................. 151
Processing UTF-8 data using UTF-16 (national) data types.............................................................153
Using intrinsic functions to process UTF-8 encoded data...........................................................153
Processing Chinese GB 18030 data.................................................................................................. 157
Coding for use of DBCS support.........................................................................................................158
Defining DBCS data.......................................................................................................................158
Using DBCS literals....................................................................................................................... 159
Testing for valid DBCS characters................................................................................................ 159
Processing alphanumeric data items that contain DBCS data....................................................160

Chapter 8. Processing files...................................................................................................................... 161


File organization and input-output devices.......................................................................................161
Choosing file organization and access mode.................................................................................... 162
Format for coding input and output............................................................................................. 163
Allocating files.................................................................................................................................... 164
Checking for input or output errors................................................................................................... 165

Chapter 9. Processing QSAM files........................................................................................................... 167


Defining QSAM files and records in COBOL....................................................................................... 167
Establishing record formats......................................................................................................... 168
Setting block sizes........................................................................................................................ 174
Coding input and output statements for QSAM files.........................................................................176
Opening QSAM files...................................................................................................................... 177
Dynamically creating QSAM files..................................................................................................177
Adding records to QSAM files.......................................................................................................178
Updating QSAM files..................................................................................................................... 178
Writing QSAM files to a printer or spooled data set.....................................................................178
Closing QSAM files........................................................................................................................179
Handling errors in QSAM files............................................................................................................ 179
Working with QSAM files.................................................................................................................... 180
Defining and allocating QSAM files.............................................................................................. 180
Retrieving QSAM files................................................................................................................... 182
Ensuring that file attributes match your program....................................................................... 183
Using striped extended-format QSAM data sets......................................................................... 185
Allocation of buffers for QSAM files............................................................................................. 186
Accessing z/OS UNIX files using QSAM.............................................................................................186
Processing QSAM ASCII files on tape................................................................................................187

Chapter 10. Processing VSAM files......................................................................................................... 189


VSAM files...........................................................................................................................................190
Defining VSAM file organization and records.................................................................................... 191
Specifying sequential organization for VSAM files...................................................................... 192
Specifying indexed organization for VSAM files...........................................................................192
Specifying relative organization for VSAM files........................................................................... 193
Specifying access modes for VSAM files......................................................................................194
Defining record lengths for VSAM files.........................................................................................195
Coding input and output statements for VSAM files......................................................................... 196
File position indicator................................................................................................................... 198
Opening a file (ESDS, KSDS, or RRDS)......................................................................................... 198
Reading records from a VSAM file................................................................................................ 201
Updating records in a VSAM file................................................................................................... 201
Adding records to a VSAM file...................................................................................................... 202
Replacing records in a VSAM file..................................................................................................203
Deleting records from a VSAM file............................................................................................... 203
Closing VSAM files........................................................................................................................ 203

vi
Handling errors in VSAM files............................................................................................................ 204
Protecting VSAM files with a password............................................................................................. 204
Example: password protection for a VSAM indexed file..............................................................205
Working with VSAM data sets under z/OS and z/OS UNIX............................................................... 205
Defining VSAM files.......................................................................................................................205
Creating alternate indexes........................................................................................................... 206
Allocating VSAM files....................................................................................................................208
Sharing VSAM files through RLS...................................................................................................209
Allocation of record areas for VSAM files.......................................................................................... 211
Improving VSAM performance...........................................................................................................211
Extended addressability support.......................................................................................................212

Chapter 11. Processing line-sequential files.......................................................................................... 215


Defining line-sequential files and records in COBOL........................................................................ 215
Describing the structure of a line-sequential file........................................................................ 215
Control characters in line-sequential files...................................................................................216
Allocating line-sequential files.......................................................................................................... 216
Coding input-output statements for line-sequential files................................................................ 217
Opening line-sequential files....................................................................................................... 217
Reading records from line-sequential files..................................................................................218
Adding records to line-sequential files........................................................................................ 218
Closing line-sequential files......................................................................................................... 219
Handling errors in line-sequential files............................................................................................. 219

Chapter 12. Sorting and merging files.....................................................................................................221


Sort and merge process..................................................................................................................... 222
Describing the sort or merge file....................................................................................................... 222
Describing the input to sorting or merging........................................................................................ 223
Example: describing sort and input files for SORT...................................................................... 223
Coding the input procedure............................................................................................................... 224
Describing the output from sorting or merging................................................................................. 225
Coding the output procedure.............................................................................................................225
Example: coding the output procedure when using DFSORT..................................................... 226
Restrictions on input and output procedures....................................................................................227
Defining sort and merge data sets.....................................................................................................227
Sorting variable-length records......................................................................................................... 227
Requesting the sort or merge............................................................................................................ 228
Setting sort or merge criteria....................................................................................................... 229
Example: sorting with input and output procedures................................................................... 230
Choosing alternate collating sequences...................................................................................... 231
Preserving the original sequence of records with equal keys..................................................... 231
Determining whether the sort or merge was successful.................................................................. 231
Stopping a sort or merge operation prematurely.............................................................................. 232
Improving sort performance with FASTSRT...................................................................................... 232
FASTSRT requirements for JCL.................................................................................................... 232
FASTSRT requirements for sort input and output files................................................................233
Checking for sort errors with NOFASTSRT........................................................................................ 234
Controlling sort behavior................................................................................................................... 235
Changing DFSORT defaults with control statements.................................................................. 236
Allocating storage for sort or merge operations.......................................................................... 236
Allocating space for sort files....................................................................................................... 237
Using checkpoint/restart with DFSORT............................................................................................. 237
Using COBOL user exit routines with DFSORT.................................................................................. 237
Sorting under CICS.............................................................................................................................238
CICS SORT application restrictions..............................................................................................238

Chapter 13. Handling errors.................................................................................................................... 241


Requesting dumps............................................................................................................................. 241

vii
Handling errors in joining and splitting strings..................................................................................242
Handling errors in arithmetic operations.......................................................................................... 242
Example: checking for division by zero........................................................................................ 243
Handling errors in input and output operations................................................................................ 243
Using the end-of-file condition (AT END).....................................................................................246
Coding ERROR declaratives..........................................................................................................246
Using file status keys.................................................................................................................... 247
Example: file status key................................................................................................................248
Using VSAM status codes (VSAM files only)................................................................................ 248
Example: checking VSAM status codes....................................................................................... 249
Coding INVALID KEY phrases.......................................................................................................250
Example: FILE STATUS and INVALID KEY................................................................................... 251
Handling errors when calling programs............................................................................................ 251
Writing routines for handling errors...................................................................................................252

Part 2. Compiling and debugging your program...................................................253

Chapter 14. Compiling under z/OS..........................................................................................................255


Compiling with JCL.............................................................................................................................255
Using a cataloged procedure........................................................................................................256
Writing JCL to compile programs................................................................................................. 260
Compiling under TSO......................................................................................................................... 262
Example: ALLOCATE and CALL for compiling under TSO............................................................ 263
Example: CLIST for compiling under TSO.................................................................................... 264
Starting the compiler from an assembler program........................................................................... 264
Defining compiler input and output................................................................................................... 266
Data sets used by the compiler under z/OS.................................................................................267
Defining the source code data set (SYSIN).................................................................................. 269
Defining a compiler-option data set (SYSOPTF).......................................................................... 270
Specifying source libraries (SYSLIB)............................................................................................ 270
Defining the output data set (SYSPRINT).................................................................................... 271
Directing compiler messages to your terminal (SYSTERM).........................................................271
Creating object code (SYSLIN or SYSPUNCH)............................................................................. 271
Defining an associated-data file (SYSADATA)..............................................................................272
Defining the Java-source output file (SYSJAVA)..........................................................................272
Defining the debug data set (SYSDEBUG)....................................................................................272
Defining the library-processing output file (SYSMDECK)............................................................ 273
Specifying compiler options under z/OS........................................................................................... 273
Specifying compiler options in the PROCESS (CBL) statement...................................................274
Example: specifying compiler options using JCL........................................................................ 275
Example: specifying compiler options under TSO.......................................................................275
Compiler options and compiler output under z/OS..................................................................... 275
Compiling multiple programs (batch compilation)........................................................................... 276
Example: batch compilation.........................................................................................................277
Specifying compiler options in a batch compilation....................................................................278
Example: precedence of options in a batch compilation............................................................ 278
Example: LANGUAGE option in a batch compilation...................................................................279
Correcting errors in your source program......................................................................................... 280
Generating a list of compiler messages....................................................................................... 281
Messages and listings for compiler-detected errors................................................................... 281
Format of compiler diagnostic messages.................................................................................... 281
Severity codes for compiler diagnostic messages.......................................................................282

Chapter 15. Compiling under z/OS UNIX................................................................................................ 283


Setting environment variables under z/OS UNIX.............................................................................. 283
Specifying compiler options under z/OS UNIX..................................................................................284
Compiling and linking with the cob2 command................................................................................ 285

viii
Creating a DLL under z/OS UNIX.................................................................................................. 286
Example: using cob2 to compile and link under z/OS UNIX....................................................... 286
cob2 syntax and options...............................................................................................................287
cob2 input and output files.......................................................................................................... 289
Compiling using scripts...................................................................................................................... 290

Chapter 16. Compiling, linking, and running OO applications............................................................... 291


Compiling, linking, and running OO applications under z/OS UNIX................................................. 291
Compiling OO applications under z/OS UNIX.............................................................................. 291
Preparing OO applications under z/OS UNIX...............................................................................292
Example: compiling and linking a COBOL class definition under z/OS UNIX............................. 293
Running OO applications under z/OS UNIX................................................................................. 293
Compiling, linking, and running OO applications in JCL or TSO/E.................................................... 295
Compiling OO applications in JCL or TSO/E.................................................................................295
Preparing and running OO applications in JCL or TSO/E............................................................. 296
Example: compiling, linking, and running an OO application using JCL..................................... 297
Using Java SDKs for z/OS...................................................................................................................298
Object-oriented syntax, and Java 6 or later.................................................................................299

Chapter 17. Compiling, linking, and running non-OO COBOL applications that interoperate with
Java..................................................................................................................................................... 301
Building non-OO applications that interoperate with Java...............................................................301
Introducing the COBPROD application..............................................................................................302
Preparing to compile, bind, and run non-OO COBOL applications that interoperate with Java......303
Step 1: Compiling user COBOL programs..........................................................................................303
Step 2: Running the cjbuild utility to build a DLL of Java stub programs......................................... 304
Step 3: Linking COBOL programs.......................................................................................................307
Step 4: Building Java programs......................................................................................................... 308
Example: COBPROD application - building and running................................................................... 308
Sample JCL for building and running the COBPROD application......................................................314
Example: COBOL-calls-Java application - building and running...................................................... 321
Sample JCL for building and running the COBOL-calls-java application..........................................324
Troubleshooting................................................................................................................................. 329
AMODE considerations for running non-OO COBOL/Java interoperable applications.................... 330
cjbuild command reference .............................................................................................................. 330

Chapter 18. Compiling, binding, and running COBOL AMODE 64 applications..................................... 335
Compiling and binding AMODE 64 programs under z/OS................................................................. 335
DLL considerations.............................................................................................................................336
Compiling and binding AMODE 64 programs under z/OS UNIX....................................................... 336
Running COBOL AMODE 64 applications.......................................................................................... 337
Specifying COBOL only runtime options............................................................................................337

Chapter 19. COBOL compiler and runtime options................................................................................ 339


COBOL compiler options....................................................................................................................339
Option settings for 85 COBOL Standard conformance................................................................343
Conflicting compiler options........................................................................................................ 344
ADATA........................................................................................................................................... 345
ADV................................................................................................................................................346
AFP................................................................................................................................................ 346
APOST/QUOTE.............................................................................................................................. 347
ARCH............................................................................................................................................. 347
ARITH............................................................................................................................................349
AWO.............................................................................................................................................. 350
BLOCK0......................................................................................................................................... 350
BUFSIZE........................................................................................................................................351
CICS.............................................................................................................................................. 352
CODEPAGE.................................................................................................................................... 353

ix
COMPILE....................................................................................................................................... 355
CONDCOMP...................................................................................................................................356
COPYLOC.......................................................................................................................................356
COPYRIGHT.................................................................................................................................. 357
CURRENCY.................................................................................................................................... 358
DATA..............................................................................................................................................359
DBCS............................................................................................................................................. 360
DECK............................................................................................................................................. 360
DEFINE..........................................................................................................................................360
DIAGTRUNC.................................................................................................................................. 362
DISPSIGN......................................................................................................................................362
DLL................................................................................................................................................ 363
DUMP............................................................................................................................................ 365
DYNAM.......................................................................................................................................... 366
EXIT...............................................................................................................................................367
EXPORTALL................................................................................................................................... 369
FASTSRT........................................................................................................................................369
FLAG..............................................................................................................................................369
FLAGSTD....................................................................................................................................... 370
HGPR.............................................................................................................................................372
INITCHECK................................................................................................................................... 373
INITIAL......................................................................................................................................... 374
INLINE.......................................................................................................................................... 375
INTDATE........................................................................................................................................375
INVDATA........................................................................................................................................376
JAVAIOP........................................................................................................................................379
LANGUAGE....................................................................................................................................381
LINECOUNT...................................................................................................................................381
LIST............................................................................................................................................... 382
LP...................................................................................................................................................383
MAP............................................................................................................................................... 384
MAXPCF........................................................................................................................................ 385
MDECK.......................................................................................................................................... 386
NAME.............................................................................................................................................387
NSYMBOL...................................................................................................................................... 387
NUMBER........................................................................................................................................388
NUMCHECK................................................................................................................................... 388
NUMPROC..................................................................................................................................... 392
OBJECT......................................................................................................................................... 393
OFFSET..........................................................................................................................................393
OPTFILE........................................................................................................................................ 394
OPTIMIZE..................................................................................................................................... 395
OUTDD.......................................................................................................................................... 396
PARMCHECK................................................................................................................................. 397
PGMNAME.....................................................................................................................................398
QUALIFY........................................................................................................................................400
RENT............................................................................................................................................. 401
RMODE.......................................................................................................................................... 402
RULES............................................................................................................................................403
SEQUENCE.................................................................................................................................... 405
SERVICE........................................................................................................................................ 405
SMARTBIN.................................................................................................................................... 406
SOURCE.........................................................................................................................................407
SPACE............................................................................................................................................408
SQL................................................................................................................................................ 408
SQLCCSID......................................................................................................................................409
SQLIMS......................................................................................................................................... 410
SSRANGE...................................................................................................................................... 411

x
STGOPT......................................................................................................................................... 412
SUPPRESS.....................................................................................................................................413
TERMINAL.....................................................................................................................................413
TEST.............................................................................................................................................. 414
THREAD.........................................................................................................................................418
TRUNC...........................................................................................................................................419
TUNE............................................................................................................................................. 421
VBREF........................................................................................................................................... 422
VLR................................................................................................................................................ 422
VSAMOPENFS............................................................................................................................... 424
WORD............................................................................................................................................ 425
XMLPARSE.................................................................................................................................... 425
XREF..............................................................................................................................................426
ZONECHECK..................................................................................................................................427
ZONEDATA.................................................................................................................................... 428
ZWB...............................................................................................................................................431
COBOL runtime options..................................................................................................................... 431
Specifying COBOL runtime options.............................................................................................. 432
VSAM dynamic access read option VSAMDYNAMICDIR............................................................. 434
Disabling COBOL runtime options report option DISABLEUOPTREPORT...................................434
Building IGZUOPT and IGZQUOPT runtime option control block............................................... 435
JCL samples for COBOL IGZUOPT runtime options.................................................................... 435
COBOL runtime options report.....................................................................................................435

Chapter 20. Compiler-directing statements........................................................................................... 439

Chapter 21. Debugging............................................................................................................................443


Debugging with source language.......................................................................................................444
Tracing program logic................................................................................................................... 444
Finding and handling input-output errors....................................................................................445
Validating data.............................................................................................................................. 445
Moving, initializing or setting uninitialized data...........................................................................445
Generating information about procedures.................................................................................. 446
Debugging using compiler options.................................................................................................... 447
Finding coding errors....................................................................................................................448
Finding line sequence problems.................................................................................................. 448
Checking for invalid COBOL data or invalid COBOL programs.....................................................449
Checking for valid ranges............................................................................................................. 449
Selecting the level of error to be diagnosed................................................................................ 450
Finding program entity definitions and references......................................................................452
Listing data items..........................................................................................................................452
Using the debugger............................................................................................................................ 453
Getting listings................................................................................................................................... 453
Example: short listing................................................................................................................... 455
Example: SOURCE and NUMBER output......................................................................................458
Example: MAP output................................................................................................................... 459
Reading LIST output..................................................................................................................... 464
Example: XREF output: data-name cross-references................................................................. 483
Example: OFFSET compiler output.............................................................................................. 487
Example: VBREF compiler output................................................................................................ 488
Example: conditional compilation output....................................................................................488
Suppressing information in CEEDUMP processing (IGZ1OPT).........................................................489
Generating a report of COBOL programs...........................................................................................490

Part 3. Targeting COBOL programs for certain environments............................... 493

Chapter 22. Developing COBOL programs for CICS............................................................................... 495

xi
Coding COBOL programs to run under CICS..................................................................................... 495
Getting the system date under CICS............................................................................................497
Calling to or from COBOL programs............................................................................................. 497
Determining the success of ECI calls...........................................................................................498
Compiling with the CICS option......................................................................................................... 499
Separating CICS suboptions.........................................................................................................500
Integrated CICS translator........................................................................................................... 500
Using the separate CICS translator................................................................................................... 501
CICS reserved-word table..................................................................................................................502
Handling errors by using CICS HANDLE............................................................................................ 503
Example: handling errors by using CICS HANDLE....................................................................... 504

Chapter 23. Programming for a Db2 environment................................................................................. 505


Db2 coprocessor................................................................................................................................ 505
Using the separate Db2 precompiler.................................................................................................506
Coding SQL statements......................................................................................................................506
Using SQL INCLUDE with the Db2 coprocessor...........................................................................507
Using character data in SQL statements......................................................................................507
Using national decimal data in SQL statements.......................................................................... 508
Using national group items in SQL statements............................................................................508
Using binary items in SQL statements......................................................................................... 509
Determining the success of SQL statements............................................................................... 509
Compiling with the SQL option.......................................................................................................... 509
Separating Db2 suboptions.......................................................................................................... 510
COBOL and Db2 CCSID determination.............................................................................................. 510
Code-page determination for string host variables in SQL statements...................................... 511
Programming with the SQLCCSID or NOSQLCCSID option......................................................... 512
Differences in how the Db2 precompiler and coprocessor behave..................................................513
Choosing the DYNAM or NODYNAM compiler option........................................................................515

Chapter 24. Developing COBOL programs for IMS................................................................................. 517


IMS SQL coprocessor......................................................................................................................... 517
Coding SQLIMS statements............................................................................................................... 518
Using SQLIMS INCLUDE with the IMS SQL coprocessor............................................................. 518
Using character data in SQLIMS statements............................................................................... 518
Using binary items in SQLIMS statements...................................................................................519
Determining the success of SQLIMS statements........................................................................ 519
Compiling with the SQLIMS option.................................................................................................... 519
Separating IMS suboptions.......................................................................................................... 520
Compiling and linking COBOL programs for running under IMS.......................................................520
Using object-oriented COBOL and Java under IMS.......................................................................... 521
Calling a COBOL method from a Java application under IMS..................................................... 521
Building a mixed COBOL-Java application that starts with COBOL............................................ 522
Writing mixed-language IMS applications................................................................................... 522

Chapter 25. Running COBOL programs under z/OS UNIX......................................................................525


Running in z/OS UNIX environments.................................................................................................525
Setting and accessing environment variables...................................................................................526
Setting environment variables that affect execution...................................................................527
Runtime environment variables................................................................................................... 527
Example: setting and accessing environment variables............................................................. 528
Calling UNIX/POSIX APIs.................................................................................................................. 528
Accessing main program parameters under z/OS UNIX................................................................... 530
Example: accessing main program parameters under z/OS UNIX............................................. 530

Chapter 26. Developing AMODE 64 programs........................................................................................533


Pointer data items with AMODE 64 programs...................................................................................533
Compiler limits with AMODE 64 support...........................................................................................534

xii
CALL statement with AMODE 64 support......................................................................................... 534
Using compiler options to compile AMODE 64 programs.................................................................534
Other AMODE 64 considerations....................................................................................................... 535

Chapter 27. Developing COBOL programs in the mixed AMODE Language Environment.....................537
COBOL programs in AMODE 31 interacting with Java programs in AMODE 64............................... 537
Application calls between COBOL programs in AMODE 31 and Java programs in AMODE 64..537
Building the mixed AMODE COBOL/Java interoperability application .......................................538
Running the mixed AMODE COBOL/Java interoperability program............................................538
Examples for mixed AMODE COBOL/Java interoperability application .....................................539
Other considerations and restrictions..........................................................................................540
COBOL applications with mixed AMODE 31 and AMODE 64 programs........................................... 540
Dynamic call between AMODE 31 and AMODE 64 programs..................................................... 540
COBOL runtime option AMODE3164........................................................................................... 541
Other considerations and restrictions..........................................................................................542

Part 4. Structuring complex applications............................................................ 543

Chapter 28. Using subprograms..............................................................................................................545


Main programs, subprograms, and calls........................................................................................... 545
Ending and reentering main programs or subprograms................................................................... 546
Transferring control to another program........................................................................................... 547
Making static calls........................................................................................................................ 548
Making dynamic calls................................................................................................................... 548
AMODE switching..........................................................................................................................550
Performance considerations of static and dynamic calls............................................................552
Making both static and dynamic calls.......................................................................................... 552
Examples: static and dynamic CALL statements.........................................................................553
Calling nested COBOL programs.................................................................................................. 554
Making recursive calls........................................................................................................................557
Calling to and from object-oriented programs.................................................................................. 557
Using procedure and function pointers............................................................................................. 557
Deciding which type of pointer to use..........................................................................................559
Calling alternate entry points....................................................................................................... 560
Making programs reentrant............................................................................................................... 560

Chapter 29. Sharing data.........................................................................................................................563


Passing data....................................................................................................................................... 563
Describing arguments in the calling program.............................................................................. 565
Describing parameters in the called program............................................................................. 566
Testing for OMITTED arguments.................................................................................................. 567
Coding the LINKAGE SECTION.......................................................................................................... 567
Coding the PROCEDURE DIVISION for passing arguments..............................................................568
Grouping data to be passed......................................................................................................... 568
Handling null-terminated strings................................................................................................. 568
Using pointers to process a chained list...................................................................................... 569
Passing return-code information....................................................................................................... 571
Using the RETURN-CODE special register................................................................................... 572
Using PROCEDURE DIVISION RETURNING . . ............................................................................ 572
Specifying CALL . . . RETURNING................................................................................................. 572
Sharing data by using the EXTERNAL clause.................................................................................... 572
Sharing files between programs (external files)............................................................................... 573
Example: using external files....................................................................................................... 573
Accessing main program parameters under z/OS.............................................................................576
Example: accessing main program parameters under z/OS....................................................... 576

Chapter 30. Creating a DLL or a DLL application.................................................................................... 579

xiii
Dynamic link libraries (DLLs)............................................................................................................. 579
Compiling programs to create DLLs...................................................................................................580
Linking DLLs........................................................................................................................................581
Example: sample JCL for a procedural DLL application....................................................................581
Using CALL identifier with DLLs......................................................................................................... 583
Search order for DLLs in the z/OS UNIX file system.................................................................... 584
Using DLL linkage and dynamic calls together.................................................................................. 584
Using procedure or function pointers with DLLs..........................................................................585
Calling DLLs from non-DLLs......................................................................................................... 585
Example: calling DLLs from non-DLLs..........................................................................................586
Using COBOL DLLs with C/C++ programs..........................................................................................587
Using DLLs in OO COBOL applications...............................................................................................588

Chapter 31. Preparing COBOL programs for multithreading..................................................................589


Multithreading.................................................................................................................................... 589
Choosing THREAD to support multithreading................................................................................... 590
Transferring control to multithreaded programs.............................................................................. 591
Ending multithreaded programs........................................................................................................591
Processing files with multithreading................................................................................................. 592
File-definition (FD) storage.......................................................................................................... 592
Serializing file access with multithreading.................................................................................. 593
Example: usage patterns of file input and output with multithreading...................................... 593
Handling COBOL limitations with multithreading............................................................................. 594

Chapter 32. Using user-defined functions.............................................................................................. 597


Structuring user-defined functions................................................................................................... 597
Coding user-defined function definitions.......................................................................................... 597
Compiling user-defined function definitions.....................................................................................598
Invoking user-defined functions........................................................................................................598
Specifying external names for user-defined functions..................................................................... 599
Link-editing user-defined functions.................................................................................................. 599
Passing arguments BY CONTENT to user-defined functions............................................................599

Chapter 33. Using function prototypes................................................................................................... 601


Function prototype example..............................................................................................................601
Function prototype with external name............................................................................................ 601
Function prototype best practices.....................................................................................................602
Language standard considerations....................................................................................................603

Part 5. Using COBOL for Web Services................................................................ 605

Chapter 34. Web Services interface .......................................................................................................607

Chapter 35. Processing JSON input ....................................................................................................... 609


Parsing JSON documents ..................................................................................................................609
How to match JSON names that are not valid COBOL data names to data items .......................... 610
Preventing data items from being populated by the JSON PARSE statement ................................ 610
Handling JSON arrays........................................................................................................................ 611
Parsing JSON anonymous arrays.......................................................................................................612
Handling JSON null values.................................................................................................................614
JSON PARSE example........................................................................................................................ 615

Chapter 36. Producing JSON output ...................................................................................................... 619


Generating JSON anonymous arrays.................................................................................................619
Generating JSON null values............................................................................................................. 621

Chapter 37. Processing XML input.......................................................................................................... 623

xiv
XML parser in COBOL......................................................................................................................... 624
Accessing XML documents................................................................................................................ 625
Parsing XML documents.....................................................................................................................625
Writing procedures to process XML............................................................................................. 627
XML events....................................................................................................................................629
Transforming XML text to COBOL data items.............................................................................. 634
Parsing XML documents with validation...................................................................................... 634
Parsing XML documents one segment at a time..........................................................................637
Handling splits using the XML-INFORMATION special register.................................................. 639
The encoding of XML documents.......................................................................................................640
XML input document encoding.....................................................................................................641
Parsing XML documents encoded in UTF-8.................................................................................644
Handling XML PARSE exceptions.......................................................................................................645
How the XML parser handles errors.............................................................................................647
Handling encoding conflicts......................................................................................................... 648
Terminating XML parsing................................................................................................................... 649
XML PARSE examples........................................................................................................................ 649
Example: parsing a simple document..........................................................................................649
Example: program for processing XML........................................................................................ 650
Example: parsing an XML document that uses namespaces...................................................... 654
Example: parsing an XML document one segment at a time...................................................... 658
Example: parsing XML documents with validation......................................................................660

Chapter 38. Producing XML output......................................................................................................... 663


Generating XML output...................................................................................................................... 663
Controlling the encoding of generated XML output.......................................................................... 668
Handling XML GENERATE exceptions................................................................................................668
Example: generating XML.................................................................................................................. 669
Enhancing XML output....................................................................................................................... 673
Example: enhancing XML output..................................................................................................674

Part 6. Developing object-oriented programs......................................................677

Chapter 39. Writing object-oriented programs.......................................................................................679


Example: accounts............................................................................................................................. 680
Defining a class.................................................................................................................................. 682
CLASS-ID paragraph for defining a class..................................................................................... 683
REPOSITORY paragraph for defining a class............................................................................... 684
WORKING-STORAGE SECTION for defining class instance data................................................685
Example: defining a class............................................................................................................. 686
Defining a class instance method...................................................................................................... 686
METHOD-ID paragraph for defining a class instance method.................................................... 687
INPUT-OUTPUT SECTION for defining a class instance method................................................ 688
DATA DIVISION for defining a class instance method................................................................ 688
PROCEDURE DIVISION for defining a class instance method.................................................... 689
Overriding an instance method.................................................................................................... 690
Overloading an instance method................................................................................................. 690
Coding attribute (get and set) methods....................................................................................... 691
Example: defining a method.........................................................................................................692
Defining a client..................................................................................................................................694
REPOSITORY paragraph for defining a client.............................................................................. 695
DATA DIVISION for defining a client............................................................................................ 695
Comparing and setting object references....................................................................................696
Invoking methods (INVOKE)........................................................................................................ 697
Creating and initializing instances of classes.............................................................................. 701
Freeing instances of classes.........................................................................................................703
Example: defining a client............................................................................................................ 703

xv
Defining a subclass............................................................................................................................ 704
CLASS-ID paragraph for defining a subclass............................................................................... 705
REPOSITORY paragraph for defining a subclass......................................................................... 705
WORKING-STORAGE SECTION for defining subclass instance data..........................................706
Defining a subclass instance method.......................................................................................... 706
Example: defining a subclass (with methods)............................................................................. 706
Defining a factory section.................................................................................................................. 707
WORKING-STORAGE SECTION for defining factory data........................................................... 708
Defining a factory method............................................................................................................ 709
Example: defining a factory (with methods)................................................................................ 711
Wrapping procedure-oriented COBOL programs.............................................................................. 715
Structuring OO applications...............................................................................................................715
Examples: COBOL applications that run using the java command............................................. 716

Chapter 40. Communicating with Java methods....................................................................................719


Accessing JNI services...................................................................................................................... 719
Handling Java exceptions.............................................................................................................720
Managing local and global references......................................................................................... 721
Java access controls.....................................................................................................................723
Sharing data with Java....................................................................................................................... 723
Coding interoperable data types in OO COBOL and Java............................................................ 723
Declaring arrays and strings for Java........................................................................................... 724
Manipulating Java arrays..............................................................................................................726
Manipulating Java strings.............................................................................................................728
Example: J2EE client written in COBOL............................................................................................ 731
Example: invoking Java from a batch COBOL program.....................................................................734

Part 7. COBOL/Java interoperability outside of the object-oriented (OO) COBOL


framework.....................................................................................................739

Chapter 41. Making an existing program callable from Java................................................................. 741

Chapter 42. Calling static Java methods from COBOL........................................................................... 745

Chapter 43. Using Java-compatible array types in COBOL.................................................................... 747


Byte arrays and general group parameters....................................................................................... 747
Array update semantics and restrictions in Java-interoperable applications................................. 748

Chapter 44. Accessing COBOL WORKING-STORAGE data items from Java......................................... 749

Chapter 45. Handling errors in Java-interoperable COBOL applications.............................................. 751

Chapter 46. AMODE considerations........................................................................................................753

Part 8. Specialized processing............................................................................755

Chapter 47. Interrupts and checkpoint/restart...................................................................................... 757


Setting checkpoints............................................................................................................................757
Designing checkpoints..................................................................................................................758
Testing for a successful checkpoint............................................................................................. 758
DD statements for defining checkpoint data sets....................................................................... 758
Messages generated during checkpoint...................................................................................... 760
Restarting programs...........................................................................................................................760
Requesting automatic restart.......................................................................................................760
Requesting deferred restart......................................................................................................... 761
Formats for requesting deferred restart...................................................................................... 761
Resubmitting jobs for restart........................................................................................................762

xvi
Example: restarting a job at a specific checkpoint step.............................................................. 762
Example: requesting a step restart.............................................................................................. 762
Example: resubmitting a job for a step restart............................................................................ 763
Example: resubmitting a job for a checkpoint restart................................................................. 763

Chapter 48. Using zlib compression from a COBOL program.................................................................765

Part 9. Improving performance and productivity.................................................769

Chapter 49. Tuning your program........................................................................................................... 771


Using an optimal programming style.................................................................................................771
Using structured programming.................................................................................................... 772
Factoring expressions...................................................................................................................772
Using symbolic constants.............................................................................................................772
Choosing efficient data types............................................................................................................ 772
Choosing efficient computational data items.............................................................................. 773
Using consistent data types......................................................................................................... 773
Making arithmetic expressions efficient...................................................................................... 773
Making exponentiations efficient................................................................................................. 774
Using VOLATILE clauses efficiently..............................................................................................774
Handling tables efficiently................................................................................................................. 774
Optimization of table references..................................................................................................775
Optimizing your code......................................................................................................................... 776
Optimization..................................................................................................................................776
Choosing compiler features to enhance performance......................................................................777
Performance-related compiler options........................................................................................778
Evaluating performance............................................................................................................... 782
Running efficiently with CICS, IMS, or VSAM.................................................................................... 783
Choosing static or dynamic calls....................................................................................................... 783

Chapter 50. Simplifying coding............................................................................................................... 785


Eliminating repetitive coding............................................................................................................. 786
Example: using the COPY statement........................................................................................... 786
Using Language Environment callable services................................................................................ 787
Sample list of Language Environment callable services............................................................. 788
Calling Language Environment services...................................................................................... 789
Example: Language Environment callable services.................................................................... 790
Using the format 2 SORT statement to sort a table.......................................................................... 791

Appendix A. Intermediate results and arithmetic precision.................................793


Terminology used for intermediate results.............................................................................................794
Example: calculation of intermediate results......................................................................................... 794
Fixed-point data and intermediate results............................................................................................. 795
Addition, subtraction, multiplication, and division........................................................................... 795
Exponentiation................................................................................................................................... 796
Example: exponentiation in fixed-point arithmetic...........................................................................797
Truncated intermediate results......................................................................................................... 797
Binary data and intermediate results................................................................................................ 798
Intrinsic functions evaluated in fixed-point arithmetic.......................................................................... 798
Integer functions................................................................................................................................798
Mixed functions.................................................................................................................................. 799
Floating-point data and intermediate results......................................................................................... 800
Exponentiations evaluated in floating-point arithmetic................................................................... 800
Intrinsic functions evaluated in floating-point arithmetic................................................................ 801
Arithmetic expressions in nonarithmetic statements............................................................................ 801

Appendix B. Converting double-byte character set (DBCS) data.......................... 803

xvii
DBCS notation..........................................................................................................................................803
Alphanumeric to DBCS data conversion (IGZCA2D).............................................................................. 803
IGZCA2D syntax................................................................................................................................. 803
IGZCA2D return codes....................................................................................................................... 804
Example: IGZCA2D............................................................................................................................ 805
DBCS to alphanumeric data conversion (IGZCD2A)...............................................................................805
IGZCD2A syntax................................................................................................................................. 805
IGZCD2A return codes....................................................................................................................... 806
Example: IGZCD2A............................................................................................................................ 807

Appendix C. XML reference material...................................................................809


XML PARSE exceptions with XMLPARSE(XMLSS) in effect.....................................................................809
XML PARSE exceptions with XMLPARSE(COMPAT) in effect.................................................................. 811
XML PARSE exceptions that allow continuation................................................................................811
XML PARSE exceptions that do not allow continuation.................................................................... 814
XML GENERATE exceptions.....................................................................................................................817

Appendix D. JSON reference material.................................................................819


JSON GENERATE exceptions...................................................................................................................819
JSON PARSE conditions and associated codes and runtime messages................................................ 819
Nonexception conditions and corresponding values of JSON-STATUS............................................820
Exception conditions, and corresponding values of JSON-CODE.....................................................820
Nonexception condition runtime messages......................................................................................821
Exception condition runtime messages............................................................................................ 822

Appendix E. EXIT compiler option...................................................................... 825


Using the user-exit work area................................................................................................................. 825
Calling from exit modules........................................................................................................................826
Processing of INEXIT...............................................................................................................................826
INEXIT parameters............................................................................................................................ 826
Processing of LIBEXIT............................................................................................................................. 827
Processing of LIBEXIT with nested COPY statements......................................................................828
LIBEXIT parameters...........................................................................................................................829
Processing of PRTEXIT............................................................................................................................ 830
PRTEXIT parameters..........................................................................................................................831
Processing of ADEXIT.............................................................................................................................. 832
ADEXIT parameters........................................................................................................................... 832
Processing of MSGEXIT........................................................................................................................... 833
MSGEXIT parameters.........................................................................................................................834
Customizing compiler-message severities........................................................................................835
Example: MSGEXIT user exit............................................................................................................. 837
Error handling for exit modules...............................................................................................................842
Using the EXIT compiler option with CICS, SQL and SQLIMS statements............................................ 844

Appendix F. JNI.cpy copybook........................................................................... 847

Appendix G. COBOL SYSADATA file contents.......................................................851


Compiler options that affect the SYSADATA file..................................................................................... 851
SYSADATA record types...........................................................................................................................852
Example: SYSADATA................................................................................................................................ 853
SYSADATA record descriptions............................................................................................................... 854
Common header section......................................................................................................................... 855
Job identification record: X'0000'...........................................................................................................857
ADATA identification record: X'0001'......................................................................................................858
Compilation unit start | end record: X'0002'.......................................................................................... 858
Options record: X'0010'.......................................................................................................................... 859
External symbol record: X'0020'.............................................................................................................871

xviii
Parse tree record: X'0024'...................................................................................................................... 872
Token record: X'0030'............................................................................................................................. 899
Source error record: X'0032'...................................................................................................................927
Source record: X'0038'............................................................................................................................927
COPY REPLACING record: X'0039'......................................................................................................... 928
Symbol record: X'0042'........................................................................................................................... 929
Symbol cross-reference record: X'0044'................................................................................................ 941
Nested program record: X'0046'.............................................................................................................943
Library record: X'0060'............................................................................................................................943
Statistics record: X'0090'........................................................................................................................ 944
EVENTS record: X'0120'.......................................................................................................................... 944

Appendix H. Using sample programs.................................................................. 949


IGYTCARA: batch application..................................................................................................................949
Input data for IGYTCARA................................................................................................................... 950
Report produced by IGYTCARA......................................................................................................... 951
Preparing to run IGYTCARA............................................................................................................... 952
IGYTCARB: interactive program.............................................................................................................. 953
Preparing to run IGYTCARB............................................................................................................... 953
IGYTSALE: nested program application..................................................................................................955
Input data for IGYTSALE.................................................................................................................... 956
Reports produced by IGYTSALE........................................................................................................ 958
Preparing to run IGYTSALE................................................................................................................ 962
Language elements and concepts that are illustrated........................................................................... 963

Appendix I. Accessing JCL parameters...............................................................969

Appendix J. Accessibility features for Enterprise COBOL for z/OS........................971

Notices..............................................................................................................973
Trademarks.............................................................................................................................................. 975
Glossary............................................................................................................ 977
List of resources.............................................................................................. 1021
Enterprise COBOL for z/OS publications...............................................................................................1021
Related publications..............................................................................................................................1021

Index.............................................................................................................. 1025

xix
xx
Tables

1. FILE-CONTROL entries..................................................................................................................................6

2. FILE SECTION entries................................................................................................................................. 12

3. Assignment to data items in a program......................................................................................................27

4. Effect of RMODE and RENT compiler options on the RMODE attribute.....................................................41

5. Ranges in value of COMP-5 data items.......................................................................................................49

6. Internal representation of numeric items.................................................................................................. 50

7. NUMCLS(PRIM) and valid signs.................................................................................................................. 54

8. NUMCLS(ALT) and valid signs..................................................................................................................... 54

9. Order of evaluation of arithmetic operators............................................................................................... 56

10. Numeric intrinsic functions.......................................................................................................................57

11. Compatibility of math intrinsic functions and callable services.............................................................. 58

12. INTDATE(LILIAN) and compatibility of date intrinsic functions and callable services...........................59

13. INTDATE(ANSI) and compatibility of date intrinsic functions and callable services..............................59

14. Hexadecimal values of the euro sign........................................................................................................65

15. COBOL statements and national data.................................................................................................... 127

16. Intrinsic functions and national character data.....................................................................................130

17. National group items that are processed with group semantics...........................................................138

18. Encoding and size of alphanumeric, DBCS, and national data.............................................................. 139

19. Summary of file organizations, access modes, and record formats of COBOL files............................. 163

20. QSAM file allocation................................................................................................................................181

21. Maximum record length of QSAM files................................................................................................... 184

22. Comparison of VSAM, COBOL, and non-VSAM terminology.................................................................. 189

23. Comparison of VSAM data-set types......................................................................................................190

xxi
24. VSAM file organization, access mode, and record format..................................................................... 191

25. Definition of VSAM fixed-length records................................................................................................ 195

26. Definition of VSAM variable-length records........................................................................................... 196

27. I/O statements for VSAM sequential files.............................................................................................. 197

28. I/O statements for VSAM relative and indexed files.............................................................................. 197

29. Statements to load records into a VSAM file..........................................................................................200

30. Statements to update records in a VSAM file.........................................................................................202

31. Methods for improving VSAM performance........................................................................................... 211

32. Methods for checking for sort errors with NOFASTSRT......................................................................... 234

33. Methods for controlling sort behavior.................................................................................................... 235

34. Compiler data sets.................................................................................................................................. 267

35. Block size of fixed-length compiler data sets........................................................................................ 269

36. Block size