ILE COBOL Programmer's Guide
Total Page:16
File Type:pdf, Size:1020Kb
IBM i Version 7.2 Programming IBM Rational Development Studio for i ILE COBOL Programmer's Guide IBM SC09-2540-08 Note Before using this information and the product it supports, read the information in “Notices” on page 575. This edition applies to IBM® Rational® Development Studio for i (product number 5770-WDS) and to all subsequent releases and modifications until otherwise indicated in new editions. This version does not run on all reduced instruction set computer (RISC) models nor does it run on CISC models. This document may contain references to Licensed Internal Code. Licensed Internal Code is Machine Code and is licensed to you under the terms of the IBM License Agreement for Machine Code. © Copyright International Business Machines Corporation 1993, 2013. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Part 1. ILE COBOL Programmer's Guide..................................................................1 Chapter 1. About ILE COBOL Programmer's Guide.................................................................................... 3 Who Should Use This Guide................................................................................................................... 3 Prerequisite and Related Information................................................................................................... 4 How to Send Your Comments................................................................................................................ 4 What's New.............................................................................................................................................4 What's New this Release?.................................................................................................................5 Changes to this Guide Since 7.1.......................................................................................................6 What's New in 7.1?........................................................................................................................... 6 What's New in V6R1?........................................................................................................................7 What's New in V5R4?........................................................................................................................8 What's New in V5R3?........................................................................................................................8 What's New in V5R2?........................................................................................................................9 What's New in V5R1?......................................................................................................................10 What's New in V4R4?......................................................................................................................11 What's New in V4R2?......................................................................................................................12 What's New in V3R7?......................................................................................................................13 What's New in V3R6/V3R2?........................................................................................................... 15 What's New in V3R1?......................................................................................................................15 Industry Standards...............................................................................................................................18 An Acknowledgment............................................................................................................................ 18 ILE COBOL Syntax Notation................................................................................................................. 19 Reading Syntax Diagrams...............................................................................................................19 Identifying Documentary Syntax....................................................................................................21 Interpreting Control Language (CL) Entry Codes...........................................................................21 Chapter 2. Compiling, Running, and Debugging ILE COBOL Programs....................................................23 Introduction..........................................................................................................................................23 Integrated Language Environment.................................................................................................23 Major Steps in Creating a Runnable ILE COBOL Program Object..................................................23 Other Application Development Tools........................................................................................... 27 Entering Source Statements into a Source Member........................................................................... 27 Creating a Library and Source Physical File................................................................................... 28 Entering Source Statements Using the Source Entry Utility..........................................................28 Example of Entering Source Statements into a Source Member.................................................. 31 Using Coded Character Set Identifiers...........................................................................................32 Compiling Source Programs into Module Objects...............................................................................36 Definition of a Module Object......................................................................................................... 36 Using the Create COBOL Module (CRTCBLMOD) Command......................................................... 39 Example of Compiling a Source Program into a Module Object....................................................61 Specifying a Different Target Release............................................................................................ 62 Specifying National Language Sort Sequence in CRTCBLMOD..................................................... 62 Collecting Profiling Data................................................................................................................. 63 Specifying Date, Time, and Timestamp Data Types...................................................................... 63 Using the PROCESS Statement to Specify Compiler Options........................................................64 Understanding Compiler Output.................................................................................................... 76 Creating a Program Object................................................................................................................... 89 Definition of a Program Object....................................................................................................... 89 Using the Create Program (CRTPGM) Command...........................................................................91 Example of Binding Multiple Modules to Create a Program Object.............................................. 92 iii Using the Create Bound COBOL (CRTBNDCBL) Command........................................................... 93 Example of Binding One Module Object to Create a Program Object.........................................101 Specifying National Language Sort Sequence in CRTBNDCBL....................................................101 Reading a Binder Listing...............................................................................................................101 Modifying a Module Object and Binding the Program Object Again........................................... 107 Removing Module Observability.................................................................................................. 110 Enabling Performance Collection.................................................................................................111 Creating a Service Program................................................................................................................112 Definition of a Service Program....................................................................................................112 Using Service Programs................................................................................................................113 Writing the Binder Language Commands for an ILE COBOL Service Program........................... 113 Using the Create Service Program (CRTSRVPGM) Command..................................................... 113 Using the Retrieve Binder Source (RTVBNDSRC) Command as Input........................................115 Calling Exported ILE Procedures in Service Programs................................................................115 Sharing Data with Service Programs............................................................................................115 Canceling an ILE COBOL Program in a Service Program............................................................. 116 Running an ILE COBOL Program........................................................................................................116 Running a COBOL Program Using the CL CALL Command.......................................................... 116 Running an ILE COBOL Program