Compaq COBOL
User Manual


Previous Contents Index

Chapter 6
6 Processing Files and Records
     6.1     Defining Files and Records
         6.1.1         File Organization
         6.1.2         Record Format
         6.1.3         Print-Control Records
         6.1.4         File Design
     6.2     Identifying Files and Records from Within Your Compaq COBOL Program
         6.2.1         Defining a File Connector
         6.2.2         Specifying File Organization and Record Access Mode
     6.3     Creating and Processing Files
         6.3.1         Opening and Closing Files
         6.3.2         File Handling for Sequential and Line Sequential (Alpha) Files
         6.3.3         File Handling for Relative Files
         6.3.4         File Handling for Indexed Files
     6.4     Reading Files
         6.4.1         Reading a Sequential or Line Sequential (Alpha) File
         6.4.2         Reading a Relative File
         6.4.3         Reading an Indexed File
     6.5     Updating Files
         6.5.1         Updating a Sequential File or Line Sequential (Alpha) File
         6.5.2         Updating a Relative File
             6.5.2.1             Rewriting a Relative File
             6.5.2.2             Deleting Records from a Relative File
         6.5.3         Updating an Indexed File
     6.6     Backing Up Your Files
Chapter 7
7 Handling Input/Output Exception Conditions
     7.1     Planning for the AT END Condition
     7.2     Planning for the Invalid Key Condition
     7.3     Using File Status Values and OpenVMS RMS Completion Codes
         7.3.1         File Status Values
         7.3.2         RMS Completion Codes (OpenVMS)
     7.4     Using Declarative USE Procedures
Chapter 8
8 Sharing Files and Locking Records
     8.1     Controlling Access to Files and Records
     8.2     Choosing X/Open Standard or Compaq Standard File Sharing and Record Locking (Alpha)
     8.3     Ensuring Successful File Sharing
         8.3.1         Providing Disk Residency
         8.3.2         Using File Protection
         8.3.3         Determining the Intended Access Mode to a File
         8.3.4         Specifying File Access Using X/Open Standard File Sharing (Alpha)
         8.3.5         Specifying File Access Using Compaq Standard File Sharing
         8.3.6         Error Handling for File Sharing
     8.4     Ensuring Successful Record Locking
         8.4.1         X/Open Standard Record Locking (Alpha)
         8.4.2         Compaq Standard Record Locking
         8.4.3         Error Handling for Record Locking
Chapter 9
9 Using the SORT and MERGE Statements
     9.1     Sorting Data with the SORT Statement
         9.1.1         File Organization Considerations for Sorting
         9.1.2         Specifying Sort Parameters with the ASCENDING and DESCENDING KEY Phrases
         9.1.3         Resequencing Files with the USING and GIVING Phrases
         9.1.4         Manipulating Data Before and After Sorting with the INPUT PROCEDURE and OUTPUT PROCEDURE Phrases
         9.1.5         Maintaining the Input Order of Records Using the WITH DUPLICATES IN ORDER Phrase
         9.1.6         Specifying Non-ASCII Collating Sequences with the COLLATING SEQUENCE IS Alphabet-Name Phrase
         9.1.7         Multiple Sorting
         9.1.8         Sorting Variable-Length Records
         9.1.9         Preventing I/O Aborts
         9.1.10         Sorting Tables (Alpha)
         9.1.11         Sorting at the Operating System Level
     9.2     Merging Data with the MERGE Statement
     9.3     Sample Programs Using the SORT and MERGE Statements
Chapter 10
10 Producing Printed Reports
     10.1     Designing a Report
     10.2     Components of a Report
     10.3     Accumulating and Reporting Totals
     10.4     The Logical Page and the Physical Page
     10.5     Programming a Conventional File Report
         10.5.1         Defining the Logical Page in a Conventional Report
         10.5.2         Controlling the Spacing in a Conventional Report
         10.5.3         Advancing to the Next Logical Page in a Conventional Report
             10.5.3.1             Programming for the Page-Overflow Condition in a Conventional Report
             10.5.3.2             Using a Line Counter
         10.5.4         Printing the Conventional Report
         10.5.5         A Conventional File Report Example
     10.6     Programming a Linage-File Compaq COBOL Report
         10.6.1         Defining the Logical Page in a Linage-File Report
         10.6.2         Controlling the Spacing in a Linage-File Report
         10.6.3         Using the LINAGE-COUNTER
         10.6.4         Advancing to the Next Logical Page in a Linage-File Report
         10.6.5         Programming for the End-of-Page and Page-Overflow Condition
         10.6.6         Printing a Linage-File Report
         10.6.7         A Linage-File Report Example
     10.7     Modes for Printing Reports
         10.7.1         Spooling to a Mass Storage Device
     10.8     Programming a Report Writer Report
         10.8.1         Using the REPORT Clause in the File Section
         10.8.2         Defining the Report Section and the Report File
         10.8.3         Defining a Report Writer Logical Page with the PAGE Clause
         10.8.4         Describing Report Group Description Entries
         10.8.5         Vertical Spacing for the Logical Page
         10.8.6         Horizontal Spacing for the Logical Page
         10.8.7         Assigning a Value in a Print Line
         10.8.8         Defining the Source for a Print Field
         10.8.9         Specifying Multiple Reports
         10.8.10         Generating and Controlling Report Headings and Footings
         10.8.11         Defining and Incrementing Totals
             10.8.11.1             Subtotaling
             10.8.11.2             Crossfooting
             10.8.11.3             Rolling Forward
             10.8.11.4             RESET Option
             10.8.11.5             UPON Option
         10.8.12         Restricting Print Items
         10.8.13         Processing a Report Writer Report
             10.8.13.1             Initiating the Report
             10.8.13.2             Generating a Report Writer Report
             10.8.13.3             Automatic Operations of the GENERATE Statement
             10.8.13.4             Ending Report Writer Processing
             10.8.13.5             Applying the USE BEFORE REPORTING Statement
             10.8.13.6             Suppressing a Report Group
         10.8.14         Selecting a Report Writer Report Type
             10.8.14.1             Detail Reporting
             10.8.14.2             Summary Reporting
     10.9     Report Writer Examples
         10.9.1         Input Data
         10.9.2         EX1006---Detail Report Program
         10.9.3         EX1007---Detail Report Program
         10.9.4         EX1008---Detail Report Program
         10.9.5         EX1009---Detail Report Program
         10.9.6         EX1010---Summary Report Program
     10.10     Solving Report Problems
         10.10.1         Printing More Than One Logical Line on a Single Physical Line
         10.10.2         Group Indicating
         10.10.3         Fitting Reports on the Page
         10.10.4         Printing Totals Before Detail Lines
         10.10.5         Underlining Items in Your Reports
         10.10.6         Bolding Items in Your Reports


Previous Next Contents Index