CONTENTS Title Page Copyright Page Preface Summary of Technical Changes Part I Developing VAX COBOL Programs 1 Overview of VAX COBOL 2 Developing VAX COBOL Programs at DCL Command Level 2.1 Choosing a Reference Format 2.1.1 Terminal Reference Format 2.1.2 ANSI Reference Format 2.1.3 Converting Between Reference Formats 2.2 DCL Commands for Program Development 2.3 Creating a VAX COBOL Program 2.4 Using the COPY Statement in Your Source Program 2.5 Compiling a VAX COBOL Program 2.5.1 The COBOL Command 2.5.2 COBOL Command Qualifiers 2.5.3 Compiling Programs with Conditional Compilation Lines 2.5.4 Compiler Error Messages 2.5.5 Compiler Listings 2.5.5.1 Source Program Listing 2.5.5.2 Storage Map Portion of Compiler Listing 2.5.5.3 Compilation Summary 2.5.5.4 Compiler Listing Including the /MACHINE_CODE Qualifier 2.5.5.5 Compiler Listing for a Contained Program 2.6 Linking a VAX COBOL Program 2.6.1 The LINK Command 2.6.2 LINK Command Qualifiers 2.6.3 Positional Qualifiers 2.6.4 Using an Object Module Library 2.6.5 Object Libraries 2.6.5.1 Using System-Supplied Object Module Libraries 2.6.5.2 Defining the Search Order for Libraries 2.6.5.3 Default User Object Module Libraries 2.6.5.4 System Libraries 2.6.6 Shareable Images 2.6.6.1 Creating a Shareable Image 2.6.6.2 Using Transfer Vectors 2.6.7 Linker Error Messages 2.7 Running a VAX COBOL Program 2.7.1 COBOL Run-Time Errors 2.8 Program Switches 2.8.1 Setting Switches Internally 2.8.2 Setting Switches for a Process 2.8.3 Order of Evaluation 2.8.4 Checking and Controlling Switch Settings 2.8.5 Example Using Program Switches 3 Using the VMS Debugger 3.1 VMS Debugger Concepts 3.2 Features of the Debugger 3.3 Getting Started with the Debugger 3.3.1 Compiling and Linking to Prepare for Debugging 3.3.1.1 Establishing the Debugging Configuration 3.3.2 Starting and Ending a Debugging Session 3.3.3 Issuing Debugger Commands 3.4 Notes on VAX COBOL Support 3.5 Sample Debugging Session Part II Using VAX COBOL Features on VMS 4 Numeric Data Handling 4.1 How the Compiler Stores Numeric Data 4.2 Sign Conventions 4.3 Invalid Values in Numeric Items 4.4 Evaluating Numeric Items 4.4.1 Numeric Relation Tests 4.4.2 Numeric Sign Tests 4.4.3 Numeric Class Tests 4.4.4 Success/Failure Tests 4.5 Using the MOVE Statement 4.5.1 Elementary Numeric Moves 4.5.2 Elementary Numeric Edited Moves 4.5.3 Common Move Errors 4.6 Using the Arithmetic Statements 4.6.1 Intermediate Results 4.6.2 Specifying a Truncation Qualifier 4.6.3 Using the ROUNDED Phrase 4.6.3.1 ROUNDED with REMAINDER 4.6.4 Using the SIZE ERROR Phrase 4.6.5 Using the GIVING Phrase 4.6.6 Multiple Operands in ADD and SUBTRACT Statements 4.6.7 Common Errors in Arithmetic Statements 4.7 Arithmetic Expression Processing 5 Nonnumeric Data Handling 5.1 Data Organization 5.1.1 Group Items 5.1.2 Elementary Items 5.2 Special Characters 5.3 Testing Nonnumeric Items 5.3.1 Relation Tests of Nonnumeric Items 5.3.1.1 Classes of Data 5.3.1.2 Comparison Operations 5.3.2 Class Tests for Nonnumeric Items 5.4 Data Movement 5.5 Using the MOVE Statement 5.5.1 Group Moves 5.5.2 Elementary Moves 5.5.2.1 Edited Moves 5.5.2.2 Justified Moves 5.5.3 Multiple Receiving Items 5.5.4 Subscripted Moves 5.5.5 Common Nonnumeric Item MOVE Statement Errors 5.5.6 Using the MOVE CORRESPONDING Statement for Nonnumeric Items 5.5.7 Using Reference Modification 6 Table Handling 6.1 Defining Tables 6.1.1 Defining Fixed-Length, One-Dimensional Tables 6.1.2 Defining Fixed-Length, Multidimensional Tables 6.1.3 Defining Variable-Length Tables 6.1.4 Storage Allocation for Tables 6.1.4.1 Using the SYNCHRONIZED Clause 6.2 Initializing Values of Table Elements 6.3 Accessing Table Elements 6.3.1 Subscripting 6.3.2 Subscripting with Literals 6.3.3 Subscripting with Data Names 6.3.4 Subscripting with Indexes 6.3.5 Relative Indexing 6.3.6 Index Data Items 6.3.7 Assigning Index Values Using the SET Statement 6.3.7.1 Assigning an Integer Index Value with a SET Statement 6.3.7.2 Incrementing an Index Value with the SET Statement 6.3.8 Identifying Table Elements Using the SEARCH Statement 6.3.8.1 Implementing a Sequential Search 6.3.8.2 Implementing a Binary Search 7 Using the STRING, UNSTRING, and INSPECT Statements 7.1 Concatenating Data Using the STRING Statement 7.1.1 Multiple Sending Items 7.1.2 Using the DELIMITED BY Phrase 7.1.3 Using the POINTER Phrase 7.1.4 Using the OVERFLOW Phrase 7.1.5 Common STRING Statement Errors 7.2 Separating Data Using the UNSTRING Statement 7.2.1 Multiple Receiving Items 7.2.2 Controlling Moved Data Using the DELIMITED BY Phrase 7.2.2.1 Multiple Delimiters 7.2.3 Using the COUNT Phrase 7.2.4 Saving UNSTRING Delimiters Using the DELIMITER Phrase 7.2.5 Controlling UNSTRING Scanning Using the POINTER Phrase 7.2.6 Counting UNSTRING Receiving Items Using the TALLYING Phrase 7.2.7 E~~~G~~ ~~ ò ~~~~~\~~~~~~~~~$~~~"~~~~~i~~~~~~~~~~%~~~~~~~~ë~~~