Micro Focus COBOL for UNIX COBOL User Guide MPE/iX 5.0 Documentation
Micro Focus COBOL for UNIX COBOL User Guide
Table of Contents
Micro Focus COBOL for UNIX COBOL User Guide
Micro Focus COBOL for UNIX COBOL User Guide : COPYRIGHT NOTICE
Ch 1. Introduction
The Documentation Set
How to Use This Guide
Ch 2. Developing COBOL Applications
COBOL System Interface
Compiling
Animating
Generating
Linking
Running
The Development Cycle
Compiling Your Program
Using the Compiler Command Line
Compiling for Animation
Compiling for Production
Using Directives
cobol.dir
COBOPT
Command line
$SET statement
Directive file
Obtaining the Fastest Compilation Time
Using the Development Cycle Procedure
Using Directives for Fast Compilation
ALTER Directive
COMS85 Directive
COPYLIST Directive
LIST Directive
QUAL Directive
Animating Your Program
Working with Multiple Programs
Accessing the Command Line from Your Program
Running Your Program
Preparing Your System
For More Information
Ch 3. Writing Programs
Choosing Intermediate or Generated Code
Performance Programming
Data Division Considerations
Data Types
Procedure Division Considerations
Arithmetic Statements
Operations
COMPUTE
Decimal Alignment
Exponentiation
Initialization
Alphanumeric Data Manipulation
Table Handling
Conditional Statements
Logical Operations
The PERFORM Statement
CALL Statements
Parameters
Sorting
Compiler Directives
Using Directives to Optimize for Speed
ALTER Directive
BOUND Directive
BOUNDOPT Directive
COMP Directive
IBMCOMP Directive
NESTCALL Directive
TRUNC Directive
Using Directives to Optimize for Size
ALIGN Directive
ANIM Directive
Using Dynamically Linked Executable Files
Implementation of Floating-Point
Range
Accuracy
External Items and Literals
Handling Large Programs
Segmentation (Overlaying)
Communication (CALL)
Call Requirements
Public Symbols and Your Program-ID
Passing the Command Line
ACCEPT...FROM COMMAND-LINE
ACCEPT...FROM ARGUMENT NUMBER/ARGUMENT-VALUE
Linkage Section
ACCEPT...FROM CONSOLE and READ from stdin
Recursion
Example
For More Information
Ch 4. The COBOL Interfacing Environment
Interfacing - The Issues
Calling Interface Compatibility
Parameter Ordering
Parameter Removal
Parameter Format
Program Return Code
Interfacing - The Environment
Advanced COBOL Syntax for Interfacing
Call Conventions
Using BY VALUE Parameters
Example
Storage Representation of COBOL Data Types
Alignment of Parameters
Handling Return Codes
Calling Subprograms
Calling COBOL Subprograms
Calling Statically or Dynamically Linked Programs
Calling Dynamically Loadable Programs
Calling Dynamically Loadable COBOL Programs via Entry Points
Command Line Syntax
via main entry point
via "other" entry point
via entry point in a segment
avoiding duplicate copies
Entry-point Naming Conventions
For More Information
Ch 5. Mixed-language Programming
Calling Operating System Functions
Calling Non-COBOL Subprograms
Run-time Errors 114 and 115
Mixing C and COBOL Programs
C Functions
cobcall
Syntax:
Remarks:
cobcancel
Syntax:
Remarks:
cobexit
Syntax:
Remarks:
cobfunc
Syntax:
Remarks:
cobkeypad
Syntax:
Parameters:
Remarks:
cobtidy
Syntax:
Remarks:
Sample Program
Miscellaneous Routines
cobsavenv and coblongjmp
Remarks:
Example:
Screen Handling from C
cobaddch
Syntax:
Parameters:
cobaddstr
Syntax:
Parameters:
cobaddstrc
Syntax:
Parameters:
cobclear
Syntax:
Remarks:
cobcols
Syntax:
Remarks:
cobgetch
Syntax:
Remarks:
coblines
Syntax:
Remarks:
cobmove
Syntax:
Parameters:
Remarks:
cobprintf
Syntax:
Parameters:
Remarks:
cobscroll
Syntax:
Parameters:
Environment Handling
cobgetenv
Syntax:
Parameters:
cobputenv
Syntax:
Parameters:
Remarks:
cobrescanenv
Syntax:
Remarks:
Example
Configuring the _CODESET Program
Statically Linking _CODESET
For More Information
Ch 6. Multi-user File Handling
A Typical Multi-user Environment
Default locking
Multi-user Syntax
Multi-user Facilities
Types of Locking
Automatic Locking
Manual Locking
Exclusive Locking
Locking Rules for Each File Organization
Record Sequential, Relative and Indexed Files
Line Sequential Files
All File Types
The Procedure Division
File Status
Handling a Record or File Lock
File Sharing
Active Files in Exclusive Mode
Active Files in Shareable Mode
Single Record Locking
Manual Single
Single Record Locking
Multiple Record Locking
Manual Multiple Record Locking
Automatic Multiple Record Locking
Using the Demonstration Programs
Running the Demonstration Programs
Creating the file
Sharing the file
For More Information
Ch 7. SQL Database Interface
Supported SQL Systems
Features of the Micro Focus Support
Installation
SQL in COBOL Programs
The EXEC SQL Statement
Example
Host Variables
Small Integer
Examples
Large Integer
Examples
Varying Length Character Strings
Example
Fixed Length Character Strings
Example
Decimal
Example
Float
Example
Extensions to Embedded SQL Support
The INCLUDE Statement
The DECLARE TABLE Statement
Integer Host Variables
Undeclared Host Variables
Qualified Host Variables
Example
Host Variable Groups and Indicator Arrays
Example
The NOT Operator ()
SQL Communications Area
The SQLINIT and SQLINIM Modules
Compiling
Compiler Directives
Compiling Against a Remote Database
Linking
IBM Database Manager
Linking with 16-bit Database Manager on OS/2
Linking with 32-bit Database Manager on OS/2
Microsoft SQL Server
Binding
Sample Programs
SQLDEMO Sample Program
Error Codes
For More Information
Ch 8. Comparison of Screen Handling Methods
Screen Handling Methods
ANSI ACCEPT/DISPLAY
Example
Advantages
Disadvantages
Comment
Enhanced ACCEPT/DISPLAY
Example
Advantages
Disadvantages
Screen Section
Example
Advantages
Disadvantages
Comment
Windowing Syntax
Example
Advantages
Disadvantages
Comment
Low Level-COBOL System Library Routines
Example
Advantages
Disadvantages
Comment
Low Level-Graphical User Interface API
Advantages
Disadvantages
Panels
Advantages
Disadvantages
Panels Version 2
Advantages
Disadvantages
Dialog System
Advantages
Disadvantages
Screen Handling Comparison Table
For More Information
Ch 9. Motif Applications
Requirements
Using the System Programming Extensions
Calling the Motif API
Returning Values from Motif API Functions
Returning a Value from a COBOL Procedure
Pointers
Procedure Pointers
Local-Storage Section
Sample Program
Translating C Definitions
Converting C Header Files
Translating C Function Declarations
Macros
Compiling
Linking
Building a Run-time System
Building an Executable Application
Debugging
For More Information
Ch 10. Portability Issues
Making Applications Portable
Supported Environments
Introduction to Portability
Creating Portable Intermediate Code
Using INTLEVEL
Using INTLEVEL"1"
Portable Syntax
Restrictions
COBOL System Library Routines
ACCEPT and DISPLAY
RM COBOL Semantics
RETRYLOCK directive
RM file statuses
Fixed File Attribute Conflicts
Files with no FILE STATUS Item
Key Sequence Checking
Windowing Syntax
Other Directives
Portability Guidelines
Operating System Specific Features
The User Attribute Byte
Screen I/O
Case Sensitivity
Paths
Extended Character Sets
The Alt and Ctrl Keys
USAGE COMP-5
$SET and Generator Directives
The ROLLBACK Statement
Creating Portable Source Code
File Portability
For More Information
Ap A. National Language Support (NLS) Demonstration
Files Required for the Demonstration
Running the Demonstration
Typical Results
Ap B. Your Environment
The COBOL Technology
16-bit Environments
Native DOS
Windows
Windows Emulation of DOS
Native Windows
OS/2 v1.x
OS/2 v1.x Emulation of DOS
32-bit Environments
OS/2 v2.x
OS/2 v2.xz Emulation of DOS
Windows NT
Windows NT Emulation of DOS
Windows NT Emulation of OS/2
UNIX
INDEX
Index
MPE/iX 5.0 Documentation