10.07.2015 Views

Enterprise COBOL for z/OS V4.2 Programming Guide

Enterprise COBOL for z/OS V4.2 Programming Guide

Enterprise COBOL for z/OS V4.2 Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using file status keys. . . . . . . . . . 239Example: file status key . . . . . . . . . 240Using VSAM status codes (VSAM files only) 241Example: checking VSAM status codes . . . . 241Coding INVALID KEY phrases . . . . . . 243Example: FILE STATUS and INVALID KEY . . 243Handling errors when calling programs . . . . 244Writing routines <strong>for</strong> handling errors . . . . . . 244Part 2. Compiling and debuggingyour program . . . . . . . . . . 247Chapter 14. Compiling under z/<strong>OS</strong> 249Compiling with JCL . . . . . . . . . . . 249Using a cataloged procedure . . . . . . . 250Writing JCL to compile programs. . . . . . 259Compiling under TSO . . . . . . . . . . 261Example: ALLOCATE and CALL <strong>for</strong> compilingunder TSO . . . . . . . . . . . . . 262Example: CLIST <strong>for</strong> compiling under TSO . . . 262Starting the compiler from an assembler program 263Defining compiler input and output . . . . . . 264Data sets used by the compiler under z/<strong>OS</strong> . . 265Defining the source code data set (SYSIN) . . . 267Defining a compiler-option data set (SYSOPTF) 267Specifying source libraries (SYSLIB) . . . . . 268Defining the output data set (SYSPRINT) . . . 269Directing compiler messages to your terminal(SYSTERM) . . . . . . . . . . . . . 269Creating object code (SYSLIN or SYSPUNCH) 269Defining an associated-data file (SYSADATA) 270Defining the Java-source output file (SYSJAVA) 270Defining the debug data set (SYSDEBUG) . . . 270Defining the library-processing output file(SYSMDECK) . . . . . . . . . . . . 271Specifying compiler options under z/<strong>OS</strong> . . . . 271Specifying compiler options with the PROCESS(CBL) statement . . . . . . . . . . . 272Example: specifying compiler options using JCL 273Example: specifying compiler options underTSO . . . . . . . . . . . . . . . 273Compiler options and compiler output underz/<strong>OS</strong> . . . . . . . . . . . . . . . 273Compiling multiple programs (batch compilation) 274Example: batch compilation . . . . . . . 275Specifying compiler options in a batchcompilation . . . . . . . . . . . . . 276Example: precedence of options in a batchcompilation . . . . . . . . . . . . . 277Example: LANGUAGE option in a batchcompilation . . . . . . . . . . . . . 278Correcting errors in your source program . . . . 279Generating a list of compiler messages . . . . 279Messages and listings <strong>for</strong> compiler-detectederrors . . . . . . . . . . . . . . . 280Format of compiler diagnostic messages . . . 280Severity codes <strong>for</strong> compiler diagnostic messages 281Chapter 15. Compiling under z/<strong>OS</strong>UNIX . . . . . . . . . . . . . . . 283vi<strong>Enterprise</strong> <strong>COBOL</strong> <strong>for</strong> z/<strong>OS</strong> <strong>V4.2</strong> <strong>Programming</strong> <strong>Guide</strong>||||Setting environment variables under z/<strong>OS</strong> UNIX 283Specifying compiler options under z/<strong>OS</strong> UNIX . . 284Compiling and linking with the cob2 command 285Creating a DLL under z/<strong>OS</strong> UNIX . . . . . 286Example: using cob2 to compile and link underz/<strong>OS</strong> UNIX . . . . . . . . . . . . . 287cob2 syntax and options . . . . . . . . . 287cob2 input and output files . . . . . . . . 289Compiling using scripts . . . . . . . . . . 290Chapter 16. Compiling, linking, andrunning OO applications . . . . . . 291Compiling, linking, and running OO applicationsunder z/<strong>OS</strong> UNIX. . . . . . . . . . . . 291Compiling OO applications under z/<strong>OS</strong> UNIX 291Preparing OO applications under z/<strong>OS</strong> UNIX 292Example: compiling and linking a <strong>COBOL</strong> classdefinition under z/<strong>OS</strong> UNIX . . . . . . . 293Running OO applications under z/<strong>OS</strong> UNIX 293Compiling, linking, and running OO applicationsin JCL or TSO/E . . . . . . . . . . . . 295Compiling OO applications in JCL or TSO/E 296Preparing and running OO applications in JCLor TSO/E. . . . . . . . . . . . . . 296Example: compiling, linking, and running anOO application using JCL . . . . . . . . 298Using Java SDKs <strong>for</strong> z/<strong>OS</strong> . . . . . . . . . 299Object-oriented syntax, and Java 5 or Java 6SDKs . . . . . . . . . . . . . . . 300Chapter 17. Compiler options . . . . 301Option settings <strong>for</strong> Standard <strong>COBOL</strong> 85con<strong>for</strong>mance. . . . . . . . . . . . . . 303Conflicting compiler options . . . . . . . . 304ADATA . . . . . . . . . . . . . . . 305ADV . . . . . . . . . . . . . . . . 305ARITH . . . . . . . . . . . . . . . 306AWO . . . . . . . . . . . . . . . . 307BLOCK0 . . . . . . . . . . . . . . . 307BUFSIZE . . . . . . . . . . . . . . . 309CICS . . . . . . . . . . . . . . . . 309CODEPAGE . . . . . . . . . . . . . . 310COMPILE . . . . . . . . . . . . . . 313CURRENCY. . . . . . . . . . . . . . 313DATA . . . . . . . . . . . . . . . . 314DATEPROC . . . . . . . . . . . . . . 315DBCS . . . . . . . . . . . . . . . . 317DECK . . . . . . . . . . . . . . . . 317DIAGTRUNC . . . . . . . . . . . . . 318DLL . . . . . . . . . . . . . . . . 318DUMP . . . . . . . . . . . . . . . 319DYNAM . . . . . . . . . . . . . . . 320EXIT . . . . . . . . . . . . . . . . 321EXPORTALL . . . . . . . . . . . . . 321FASTSRT . . . . . . . . . . . . . . . 322FLAG . . . . . . . . . . . . . . . . 322FLAGSTD . . . . . . . . . . . . . . 323INTDATE . . . . . . . . . . . . . . 325LANGUAGE . . . . . . . . . . . . . 326LIB. . . . . . . . . . . . . . . . . 327

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!