Using this information center
Feedback
XL C/C++ V7.0 (for AIX)
Getting started
XL C/C++ overview
Command-line C and C++ compiler
Libraries
Standard C++ library
IBM Mathematics Acceleration Subsystem libraries
IBM Distributed Debugger
Other tools and utilities
National language support
Documentation and online help
What's new in version 7
Performance and optimization
Machine architecture and hardware
New built-in functions for POWER5 processors
New XL C/C++ pragmas
New optimization utilities
IBM Mathematics Accelerated Subsystem (MASS) libraries
SMP thread binding
Conformance to industry standards
Ease of use
New XL C/C++ options
Customizing the compilation environment
Environment variables
Create symbolic links for the path
Configuration files
Controlling the compilation process
Invoking the compiler
Object model
Types of input and output files
Default behavior
Getting started with compiler options
Compiler messages
Return codes
Compiler message format
Reusing GNU C and C++ compiler options with gxlc and gxlc++
gxlc and gxlc++ syntax
GNU C and C++ to XL C/C++ option mapping
Configuring the option mapping
Options summary: C compiler
Basic translation
Special handling and control
Linking and library-related options
Options summary: C++ compiler
Getting started with optimization
Selected compiler options for optimization
Getting started with optimization pragmas
Porting considerations
Portability issues intrinsic to the language
Diagnostics for compile-time errors
32- and 64-bit application development
32- and 64-bit development environments on AIX
Objects and libraries on AIX
Difference between a shared object and library on AIX
Difference between shared and static objects on AIX
Link time and load time
Diagnostics for link-time errors
Diagnostics for run-time errors
Shared memory parallelization
OpenMP directives
Threads on AIX
Features related to GNU C and C++ portability
Function attributes
Variable attributes
Type attributes
GNU C and C++ assertions
Other extensions related to GNU C and C++
Language support
Compatibility with ISO/IEC International Standards
ISO/IEC 14882:1998 and ISO/IEC 14882:2003(E)
ISO/IEC 9899:1990 International Standard compatibility
ISO/IEC 9899:1999 International Standard support
Enhanced language level support
OpenMP compliance and support
OpenMP directives
OpenMP data scope attribute clauses
OpenMP library functions
OpenMP environment variables
OpenMP implementation-defined behavior
Tuning an OpenMP program
Language reference
About This Reference
The IBM Language Extensions
Features Related to GNU C and C++
Highlighting Conventions
How to Read the Syntax Diagrams
Scope and Linkage
Scope
Local Scope
Function Scope
Function Prototype Scope
Global Scope
Class Scope
Name Spaces of Identifiers
Name Hiding
Program Linkage
Internal Linkage
External Linkage
No Linkage
Linkage Specifications -- Linking to Non-C++ Programs
Name Mangling
Lexical Elements
Tokens
Punctuators
Source Program Character Set
Escape Sequences
The Unicode Standard
Trigraph Sequences
Multibyte Characters
Comments
Identifiers
Reserved Identifiers
Case Sensitivity and Special Characters in Identifiers
Predefined Identifiers
Keywords
Literals
Boolean Literals
Integer Literals
Floating-Point Literals
Complex Literals
Character Literals
String Literals
Compound Literals
Declarations
Declaration Overview
Variable Attributes
The __align Specifier
Tentative Definitions
Objects
Storage Class Specifiers
auto Storage Class Specifier
extern Storage Class Specifier
mutable Storage Class Specifier
register Storage Class Specifier
static Storage Class Specifier
typedef
Type Specifiers
Type Names
Type Attributes
Compatible Types
Simple Type Specifiers
Compound Types
Complex Types
Type Qualifiers
The const Type Qualifier
The volatile Type Qualifier
The restrict Type Qualifier
The asm Declaration
Incomplete Types
Declarators
Initializers
Pointers
Declaring Pointers
Assigning Pointers
Initializing Pointers
Using Pointers
Pointer Arithmetic
Arrays
Declaring Arrays
Initializing Arrays
Function Specifiers
References
Initializing References
Expressions and Operators
Operator Precedence and Associativity
Lvalues and Rvalues
Primary Expressions
Identifier Expressions
Integer Constant Expressions
Parenthesized Expressions ( )
C++ Scope Resolution Operator ::
Postfix Expressions
Function Call Operator ( )
Array Subscripting Operator [ ]
Dot Operator .
Arrow Operator -
The typeid Operator
static_cast Operator
reinterpret_cast Operator
const_cast Operator
dynamic_cast Operator
Unary Expressions
Increment ++
Decrement --
Unary Plus +
Unary Minus -
Logical Negation !
Bitwise Negation ~
Address &
Indirection *
alignof Operator
sizeof Operator
typeof Operator
label Value Operator &&
C++ new Operator
C++ delete Operator
Cast Expressions
Cast to a Union Type
Binary Expressions
Multiplication *
Division /
Remainder %
Addition +
Subtraction -
Bitwise Left and Right Shift << >>
Relational < > <= >=
Equality == !=
Bitwise AND &
Bitwise Exclusive OR ^
Bitwise Inclusive OR |
Logical AND &&
Logical OR ||
C++ Pointer to Member Operators .* -*
Conditional Expressions
Type of Conditional C Expressions
Type of Conditional C++ Expressions
Examples of Conditional Expressions
Assignment Expressions
Simple Assignment =
Compound Assignment
Comma Expressions
C++ throw Expressions
Implicit Type Conversions
Integral and Floating-Point Promotions
Standard Type Conversions
Lvalue-to-Rvalue Conversions
Boolean Conversions
Integral Conversions
Floating-Point Conversions
Pointer Conversions
Reference Conversions
Pointer-to-Member Conversions
Qualification Conversions
Function Argument Conversions
Other Conversions
Arithmetic Conversions
The explicit Keyword
Functions
C++ Enhancements to C Functions
Function Declarations
C++ Function Declarations
Function Attributes
Examples of Function Declarations
Function Definitions
Ellipsis and void
Examples of Function Definitions
The main() Function
Arguments to main
Example of Arguments to main
Calling Functions and Passing Arguments
Passing Arguments by Value
Passing Arguments by Reference
Default Arguments in C++ Functions
Restrictions on Default Arguments
Evaluating Default Arguments
Function Return Values
Using References as Return Types
Allocation and Deallocation Functions
Pointers to Functions
Inline Functions
Nested Functions
Statements
labels
Locally Declared labels
labels as Values
Expression Statements
Resolving Ambiguous Statements in C++
Block Statement
Statement Expressions
if Statement
switch Statement
while Statement
do Statement
for Statement
break Statement
continue Statement
return Statement
Value of a return Expression and Function Value
goto Statement
Computed goto
Null Statement
Preprocessor Directives
Preprocessor Overview
Preprocessor Directive Format
Macro Definition and Expansion (#define)
Object-Like Macros
Function-Like Macros
Scope of Macro Names (#undef)
# Operator
Macro Concatenation with the ## Operator
Preprocessor Error Directive (#error)
Preprocessor Warning Directive (#warning)
File Inclusion (#include)
Specialized File Inclusion (#include_next)
ISO Standard Predefined Macro Names
Conditional Compilation Directives
#if, #elif
#ifdef
#ifndef
#else
#endif
Line Control (#line)
Null Directive (#)
Pragma Directives (#pragma)
Standard Pragmas
The _Pragma Operator
Namespaces
Defining Namespaces
Declaring Namespaces
Creating a Namespace Alias
Creating an Alias for a Nested Namespace
Extending Namespaces
Namespaces and Overloading
Unnamed Namespaces
Namespace Member Definitions
Namespaces and Friends
Using Directive
The using Declaration and Namespaces
Explicit Access
Overloading
Overloading Functions
Restrictions on Overloaded Functions
Overloading Operators
Overloading Unary Operators
Overloading Increment and Decrement
Overloading Binary Operators
Overloading Assignments
Overloading Function Calls
Overloading Subscripting
Overloading Class Member Access
Overload Resolution
Implicit Conversion Sequences
Resolving Addresses of Overloaded Functions
Classes
Declaring Class Types
Using Class Objects
Classes and Structures
Scope of Class Names
Incomplete Class Declarations
Nested Classes
Local Classes
Local Type Names
Class Members and Friends
Class Member Lists
Data Members
Member Functions
const and volatile Member Functions
Virtual Member Functions
Special Member Functions
Member Scope
Pointers to Members
The this Pointer
Static Members
Using the Class Access Operators with Static Members
Static Data Members
Static Member Functions
Member Access
Friends
Friend Scope
Friend Access
Inheritance
Derivation
Inherited Member Access
Protected Members
Access Control of Base Class Members
The using Declaration and Class Members
Overloading Member Functions from Base and Derived Classes
Changing the Access of a Class Member
Multiple Inheritance
Virtual Base Classes
Multiple Access
Ambiguous Base Classes
Virtual Functions
Ambiguous Virtual Function Calls
Virtual Function Access
Abstract Classes
Special Member Functions
Constructors and Destructors Overview
Constructors
Default Constructors
Explicit Initialization with Constructors
Initializing Base Classes and Members
Construction Order of Derived Class Objects
Destructors
Free Store
Temporary Objects
User-Defined Conversions
Conversion by Constructor
Conversion Functions
Copy Constructors
Copy Assignment Operators
Templates
Template Parameters
Type Template Parameters
Non-Type Template Parameters
Template Template Parameters
Default Arguments for Template Parameters
Template Arguments
Template Type Arguments
Template Non-Type Arguments
Template Template Arguments
Class Templates
Class Template Declarations and Definitions
Static Data Members and Templates
Member Functions of Class Templates
Friends and Templates
Function Templates
Template Argument Deduction
Overloading Function Templates
Partial Ordering of Function Templates
Template Instantiation
Implicit Instantiation
Explicit Instantiation
Template Specialization
Explicit Specialization
Partial Specialization
Name Binding and Dependent Names
The typename Keyword
The Keyword template as Qualifier
Exception Handling
The try Keyword
Nested Try Blocks
catch Blocks
Function try block Handlers
Arguments of catch Blocks
Matching between Exceptions Thrown and Caught
Order of Catching
The throw Expression
Rethrowing an Exception
Stack Unwinding
Exception Specifications
Special Exception Handling Functions
unexpected()
terminate()
set_unexpected() and set_terminate()
Example Using the Exception Handling Functions
The IBM C Language Extensions
Orthogonal Extensions
Existing IBM C Extensions with Individual Option Controls
IBM C Extensions: C99 Features as Extensions to C89
IBM C Extensions Related to GNU C
Non-Orthogonal Extensions
Existing IBM C Extensions with Individual Option Controls
IBM C Extensions: C99 Features as Extensions to C89
IBM C Extensions Related to GNU C
The IBM C++ Language Extensions
Orthogonal Extensions
IBM C++ Extensions for Compatibility with C99
IBM C++ Extensions Related to GNU C
IBM C++ Extensions Related to GNU C++
Non-Orthogonal Extensions
IBM C++ Extensions for Compatibility with C99
IBM C++ Extensions Related to GNU C
Predefined Macros Related to Language Features
Compiler reference
How to read syntax diagrams
Overview
XL C/C++ Enterprise Edition
Compiler Modes
Object Models
Compiler Options
Types of Input Files
Types of Output Files
Compiler Message and Listing Information
Compiler Messages
Compiler Listings
Program Parallelization
IBM SMP Directives
OpenMP Directives
Countable Loops
Reduction Operations in Parallelized Loops
Shared and Private Variables in a Parallel Environment
Using XL C/C++ Enterprise Edition with Other Programming Languages
Configuration and Use
Set Up the Compilation Environment
Set Environment Variables
Set Environment Variables in bsh, ksh, or sh Shells
Set Environment Variables in csh Shell
Set Environment Variables to Select 64- or 32-bit Modes
Set Parallel Processing Run-time Options
Set Other Environment Variables
Invoke the Compiler
Invoke the Linkage Editor
Specify Compiler Options
Specify Compiler Options on the Command Line
-q Options
Flag Options
Specify Compiler Options in Your Program Source Files
Specify Compiler Options in a Configuration File
Tailor a Configuration File
Configuration File Attributes
Specify Compiler Options for Architecture-Specific, 32- or 64-bit Compilation
Resolving Conflicting Compiler Options
Specify Path Names for Include Files
Directory Search Sequence for Include Files Using Relative Path Names
Control Parallel Processing with Pragmas
Use C and C++ with Other Programming Languages
Interlanguage Calling Conventions
Corresponding Data Types
Special Treatment of Character and Aggregate Data
Use the Subroutine Linkage Conventions in Interlanguage Calls
Interlanguage Calls - Parameter Passing
Interlanguage Calls - Call by Reference Parameters
Interlanguage Calls - Call by Value Parameters
Interlanguage Calls - Rules for Passing Parameters by Value
Interlanguage Calls - Pointers to Functions
Interlanguage Calls - Function Return Values
Interlanguage Calls - Stack Floor
Interlanguage Calls - Stack Overflow
Interlanguage Calls - Traceback Table
Interlanguage Calls - Type Encoding and Checking
Sample Program: C/C++ Calling Fortran
Compiler Options
Compiler Command Line Options
Summary of Command Line Compiler Options
+ (plus sign)
# (pound sign)
32, 64
aggrcopy
alias
align
alloca
ansialias
arch
asm
asm_as
assert
attr
B
b
bitfields
bmaxdata
brtl
C
c
c_stdinc
cache
chars
check
cinc
compact
cpluscmt
cpp_stdinc
D
dataimported
datalocal
dbxextra
digraph
directstorage
dollar
dpcl
E
e
eh
enum
expfile
extchk
F
f
fdpr
flag
float
flttrap
fold
format
fullpath
funcsect
G
g
genproto
halt
haltonmsg
heapdebug
hot
hsflt
hssngl
I
idirfirst
ignerrno
ignprag
info
initauto
inlglue
inline
ipa
isolated_call
keepinlines
keepparm
keyword
L
l
langlvl
largepage
ldbl128, longdouble
libansi
linedebug
list
listopt
longlit
longlong
M
ma
macpstr
maf
makedep
maxerr
maxmem
mbcs, dbcs
mkshrobj
namemangling
O, optimize
o
objmodel
oldpassbyvalue
P
p
pascal
path
pdf1, pdf2
pg
phsinfo
pic
prefetch
print
priority
proclocal, procimported, procunknown
proto
Q
r
report
rndflt
ro
roconst
roptr
rrm
rtti
S
s
saveopt
showinc
showpdf
smallstack
smp
source
sourcetype
spill
spnans
srcmsg
staticinline
statsym
stdinc
strict
strict_induction
suppress
symtab
syntaxonly
t
tabsize
tbtable
tempinc
templaterecompile
templateregistry
tempmax
threaded
tmplparse
tocdata
tocmerge
trigraph
tune
twolink
U
unique
unroll
unwind
upconv
utf
V
v
vftable
W
w
warn64
weaksymbol
xcall
xref
y
Z
General Purpose Pragmas
#pragma align
#pragma alloca
#pragma block_loop
#pragma chars
#pragma comment
#pragma define
#pragma disjoint
#pragma do_not_instantiate
#pragma enum
#pragma execution_frequency
#pragma hashome
#pragma ibm snapshot
#pragma implementation
#pragma info
#pragma instantiate
#pragma ishome
#pragma isolated_call
#pragma langlvl
#pragma leaves
#pragma loop_id
#pragma map
#pragma mc_func
#pragma namemangling
#pragma nameManglingRule
#pragma object_model
#pragma options
#pragma option_override
#pragma pack
#pragma pass_by_value
#pragma priority
#pragma reachable
#pragma reg_killed_by
#pragma report
#pragma stream_unroll
#pragma strings
#pragma unroll
#pragma unrollandfuse
#pragma weak
Pragmas to Control Parallel Processing
#pragma ibm critical
#pragma ibm independent_calls
#pragma ibm independent_loop
#pragma ibm iterations
#pragma ibm parallel_loop
#pragma ibm permutation
#pragma ibm schedule
#pragma ibm sequential_loop
#pragma omp atomic
#pragma omp parallel
#pragma omp for
#pragma omp ordered
#pragma omp parallel for
#pragma omp section, #pragma omp sections
#pragma omp parallel sections
#pragma omp single
#pragma omp master
#pragma omp critical
#pragma omp barrier
#pragma omp flush
#pragma omp threadprivate
Acceptable Compiler Mode and Processor Architecture Combinations
Compiler Messages
Message Severity Levels and Compiler Response
Compiler Return Codes
Compiler Message Format
Parallel Processing Support
IBM SMP Run-time Options for Parallel Processing
Scheduling Algorithm Options
Parallel Environment Options
Performance Tuning Options
Dynamic Profiling Options
OpenMP Run-time Options for Parallel Processing
Scheduling Algorithm Environment Variable
Parallel Environment Environment Variables
Dynamic Profiling Environment Variable
Built-in Functions Used for Parallel Processing
Predefined Macros
Macros related to the platform
Built-in Functions
National Languages Support in XL C/C++ Enterprise Edition
Converting Files Containing Multibyte Data to New Code Pages
Multibyte Character Support
String Literals and Character Constants
Preprocessor Directives
Macro Definitions
Compiler Options
File Names and Comments
Restrictions
Problem Solving
Message Catalog Errors
Correcting Paging Space Errors During Compilation
ASCII Character Set
Programming guide
Using 32-bit and 64-bit modes
Assigning long values
Assigning constant values to long variables
Bit-shifting long values
Assigning pointers
Aligning aggregate data
Calling Fortran code
Aligning data in aggregates
Using alignment modes and modifiers
General rules for alignment
Alignment examples
Using and aligning bit fields
Rules for natural alignment
Rules for power alignment
Rules for Mac68K alignment
Rules for bit-packed alignment
Example of bit field alignment
Handling floating point operations
Handling multiply-add operations
Handling floating-point rounding
Handling floating-point exceptions
Single-precision and double-precision performance
Using the Mathematical Acceleration Subsystem (MASS)
Using the scalar library
Using the vector libraries
Compiling and linking a program with MASS
Using memory heaps
Managing memory with multiple heaps
Functions for managing user-created heaps
Creating a heap
Expanding a heap
Using a heap
Getting information about a heap
Closing and destroying a heap
Changing the default heap used in a program
Compiling and linking a program with user-created heaps
Examples of creating and using user heaps
Debugging memory heaps
Functions for checking memory heaps
Functions for debugging memory heaps
Using memory allocation fill patterns
Skipping heap checking
Using stack traces
Using C++ templates
Using the -qtempinc compiler option
Example of -qtempinc
Regenerating the template instantiation file
Using -qtempinc with shared libraries
Using the -qtemplateregistry compiler option
Recompiling related compilation units
Switching from -qtempinc to -qtemplateregistry
Ensuring thread safety (C++)
Ensuring thread safety of template objects
Ensuring thread safety of stream objects
Constructing a library
Compiling and linking a library
Compiling a static library
Compiling a shared library
Linking a shared library to another shared library
Initializing static objects in libraries (C++)
Assigning priorities to objects
Order of object initialization across libraries
Dynamically loading a shared library
Loading and initializing a module with the loadAndInit function
Terminating and unloading a module with the terminateAndUnload function
Using the C++ utilities
Demangling compiled C++ names
Demangling compiled C++ names with c++filt
Demangling compiled C++ names with the demangle class library
Creating a shared library with the makeC++SharedLib utility
Linking with the linkxlC utility
Optimizing your applications
Using optimization levels
Getting the most out of optimization levels 2 and 3
Optimizing for system architecture
Getting the most out of target machine options
Using high-order loop analysis and transformations
Getting the most out of -qhot
Using shared-memory parallelism
Getting the most out of -qsmp
Using interprocedural analysis
Getting the most from -qipa
Using profile-directed feedback
Example of compilation with pdf and showpdf
Other optimization options
Summary of options for optimization and performance
Coding your application to improve performance
Find faster input/output techniques
Reduce function-call overhead
Manage memory efficiently
Optimize variables
Manipulate strings efficiently
Optimize expressions and program logic
Optimize operations in 64-bit mode
Appendix. Memory debug library functions
Memory allocation debug functions
_debug_calloc -- Allocate and initialize memory
_debug_free -- Free allocated memory
_debug_heapmin -- Free unused memory in the default heap
_debug_malloc -- Allocate memory
_debug_ucalloc -- Reserve and initialize memory from a user-created heap
_debug_uheapmin -- Free unused memory in a user-created heap
_debug_umalloc -- Reserve memory blocks from a user-created heap
_debug_realloc -- Reallocate memory block
String handling debug functions
_debug_memcpy -- Copy bytes
_debug_memmove -- Copy bytes
_debug_memset -- Set bytes to value
_debug_strcat -- Concatenate strings
_debug_strcpy -- Copy strings
_debug_strncat -- Concatenate strings
_debug_strncpy -- Copy strings
_debug_strnset -- Set characters in a string
_debug_strset -- Set characters in a string
Standard C++ library reference
C++ Library
C++ Library Overview
Using C++ Library Headers
C++ Library Conventions
Iostreams Conventions
C++ Program Startup and Termination
Characters
Character Sets
Character Sets and Locales
Escape Sequences
Numeric Escape Sequences
Trigraphs
Multibyte Characters
Wide-Character Encoding
Expressions
Files and Streams
Text and Binary Streams
Byte and Wide Streams
Controlling Streams
Stream States
Functions
Formatted Input
Scan Formats
Scan Functions
Scan Conversion Specifiers
Formatted Output
Print Formats
Print Functions
Print Conversion Specifiers
STL Conventions
Iterator Conventions
Algorithm Conventions
Containers
Cont
Cont::begin
Cont::clear
Cont::const_iterator
Cont::const_reference
Cont::const_reverse_iterator
Cont::difference_type
Cont::empty
Cont::end
Cont::erase
Cont::iterator
Cont::max_size
Cont::rbegin
Cont::reference
Cont::rend
Cont::reverse_iterator
Cont::size
Cont::size_type
Cont::swap
Cont::value_type
operator!=
operator==
operator<
operator<=
operator
operator=
swap
Preprocessing
Standard C++ Library Header Files
<bitset
bitset
operator<<
operator
<cassert
<cctype
<cerrno
<cfloat
<ciso646
<climits
<clocale
<cmath
<complex
abs
arg
complex
complex<double
complex<float
complex<long double
conj
cos
cosh
exp
imag
log
log10
norm
operator!=
operator*
operator+
operator-
operator/
operator<<
operator==
operator
polar
pow
real
sin
sinh
sqrt
__STD_COMPLEX
tan
tanh
<csetjmp
<csignal
<cstdarg
<cstddef
<cstdio
<cstdlib
<cstring
<ctime
<cwchar
<cwctype
<exception
bad_exception
exception
set_terminate
set_unexpected
terminate
terminate_handler
uncaught_exception
unexpected
unexpected_handler
<fstream
basic_filebuf
basic_fstream
basic_ifstream
basic_ofstream
filebuf
fstream
ifstream
ofstream
wfstream
wifstream
wofstream
wfilebuf
<iomanip
resetiosflags
setbase
setfill
setiosflags
setprecision
setw
<ios
basic_ios
boolalpha
dec
fixed
fpos
hex
internal
ios
ios_base
left
noboolalpha
noshowbase
noshowpoint
noshowpos
noskipws
nounitbuf
nouppercase
oct
right
scientific
showbase
showpoint
showpos
skipws
streamoff
streampos
streamsize
unitbuf
uppercase
wios
wstreampos
<iosfwd
<iostream
cerr
cin
clog
cout
wcerr
wcin
wclog
wcout
<istream
basic_iostream
basic_istream
iostream
istream
operator
wiostream
wistream
ws
<limits
float_denorm_style
float_round_style
numeric_limits
<locale
codecvt
codecvt_base
codecvt_byname
collate
collate_byname
ctype
ctype<char
ctype_base
ctype_byname
has_facet
isalnum
isalpha
iscntrl
isdigit
isgraph
islower
isprint
ispunct
isspace
isupper
isxdigit
locale
messages
messages_base
messages_byname
money_base
money_get
money_put
moneypunct
moneypunct_byname
num_get
num_put
numpunct
numpunct_byname
time_base
time_get
time_get_byname
time_put
time_put_byname
tolower
toupper
use_facet
<new
bad_alloc
new_handler
nothrow
nothrow_t
operator delete
operator delete[]
operator new
operator new[]
set_new_handler
<ostream
basic_ostream
endl
ends
flush
operator<<
ostream
wostream
<sstream
basic_stringbuf
basic_istringstream
basic_ostringstream
basic_stringstream
istringstream
ostringstream
stringbuf
stringstream
wistringstream
wostringstream
wstringbuf
wstringstream
<stdexcept
domain_error
invalid_argument
length_error
logic_error
out_of_range
overflow_error
range_error
runtime_error
underflow_error
<streambuf
basic_streambuf
streambuf
wstreambuf
<string
basic_string
char_traits
char_traits<char
char_traits<wchar_t
getline
operator+
operator!=
operator==
operator<
operator<<
operator<=
operator
operator=
operator
string
swap
wstring
<strstream
strstreambuf
istrstream
ostrstream
strstream
<typeinfo
bad_cast
bad_typeid
type_info
<valarray
abs
acos
asin
atan
atan2
cos
cosh
exp
gslice
gslice_array
indirect_array
log
log10
mask_array
operator!=
operator%
operator&
operator&&
operator
operator
operator=
operator<
operator<<
operator<=
operator*
operator+
operator-
operator/
operator==
operator^
operator|
operator||
pow
sin
sinh
slice
slice_array
sqrt
tan
tanh
valarray
valarray<bool
Standard Template Library C++
<algorithm
adjacent_find
binary_search
copy
copy_backward
count
count_if
equal
equal_range
fill
fill_n
find
find_end
find_first_of
find_if
for_each
generate
generate_n
includes
inplace_merge
iter_swap
lexicographical_compare
lower_bound
make_heap
max
max_element
merge
min
min_element
mismatch
next_permutation
nth_element
partial_sort
partial_sort_copy
partition
pop_heap
prev_permutation
push_heap
random_shuffle
remove
remove_copy
remove_copy_if
remove_if
replace
replace_copy
replace_copy_if
replace_if
reverse
reverse_copy
rotate
rotate_copy
search
search_n
set_difference
set_intersection
set_symmetric_difference
set_union
sort
sort_heap
stable_partition
stable_sort
swap
swap_ranges
transform
unique
unique_copy
upper_bound
<deque
deque
operator!=
operator==
operator<
operator<=
operator
operator=
swap
<functional
binary_function
binary_negate
bind1st
bind2nd
binder1st
binder2nd
const_mem_fun_t
const_mem_fun_ref_t
const_mem_fun1_t
const_mem_fun1_ref_t
divides
equal_to
greater
greater_equal
hash
less
less_equal
logical_and
logical_not
logical_or
mem_fun
mem_fun_ref
mem_fun_t
mem_fun_ref_t
mem_fun1_t
mem_fun1_ref_t
minus
modulus
multiplies
negate
not1
not2
not_equal_to
plus
pointer_to_binary_function
pointer_to_unary_function
ptr_fun
unary_function
unary_negate
<iterator
advance
back_insert_iterator
back_inserter
bidirectional_iterator_tag
distance
forward_iterator_tag
front_insert_iterator
front_inserter
input_iterator_tag
insert_iterator
inserter
istream_iterator
istreambuf_iterator
iterator
iterator_traits
operator!=
operator==
operator<
operator<=
operator
operator=
operator+
operator-
ostream_iterator
ostreambuf_iterator
output_iterator_tag
random_access_iterator_tag
reverse_iterator
<list
list
operator!=
operator==
operator<
operator<=
operator
operator=
swap
<map
map
multimap
operator!=
operator==
operator<
operator<=
operator
operator=
swap
<memory
allocator
allocator<void
auto_ptr
get_temporary_buffer
operator!=
operator==
raw_storage_iterator
return_temporary_buffer
uninitialized_copy
uninitialized_fill
uninitialized_fill_n
<numeric
accumulate
adjacent_difference
inner_product
partial_sum
<queue
operator!=
operator==
operator<
operator<=
operator
operator=
priority_queue
queue
<set
multiset
operator!=
operator==
operator<
operator<=
operator
operator=
set
swap
<stack
operator!=
operator==
operator<
operator<=
operator
operator=
stack
<unordered_map
unordered_map
unordered_multimap
<unordered_set
unordered_multiset
unordered_set
<utility
make_pair
operator!=
operator==
operator<
operator<=
operator
operator=
pair
<vector
operator!=
operator==
operator<
operator<=
operator
operator=
swap
vector
vector<bool, A
Legacy class library reference
USL I/O Streaming
The USL I/O Stream Class Hierarchy
USL I/O Stream Header Files
The USL I/O Stream Classes and stdio.h
Use Predefined Streams
Use Anonymous Streams
Stream Buffers
Format State Flags
Format Stream Output
Define Your Own Format State Flags
Manipulators
Create Manipulators
Define an APP Parameterized Manipulator
Define a MANIP Parameterized Manipulator
Define Nonassociative Parameterized Manipulators
Thread Safety and USL I/O Streaming
Basic USL I/O Stream Tasks
Receive Input from Standard Input
Display Output on Standard Output or Standard Error
Flush Output Streams with endl and flush
Parse Multiple Inputs
Open a File for Input and Read from the File
Open a File for Output and Write to the File
Combine Input and Output of Different Types
Advanced USL I/O Stream Tasks
Associate a File with a Standard Input or Output Stream
Move through a file with filebuf Functions
Define an Input Operator for a Class Type
Define an Output Operator for a Class Type
Correct Input Stream Errors
Manipulate Strings with the strstream Classes
USL Complex Mathematics Library
Review of Complex Numbers
Header Files and Constants for the complex and c_exception Classes
Construct complex Objects
Mathematical Operators for complex
Use Mathematical Operators for complex
Friend Functions for complex
Use Friend Functions with complex
Input and Output Operators for complex
Use complex Input and Output Operators
Error Functions
Handle complex Mathematics Errors
Example: Calculate Roots
Example: Use Equality and Inequality Operators
Reference
_CCSID_T
_CCSID_T - Hierarchy List
_CCSID_T - Member Functions and Data by Group
_CCSID_T - Inherited Member Functions and Data
complex
complex - Hierarchy List
complex - Member Functions and Data by Group
complex - Associated Globals
complex - Inherited Member Functions and Data
filebuf
filebuf - Hierarchy List
filebuf - Member Functions and Data by Group
filebuf - Inherited Member Functions and Data
fstream
fstream - Hierarchy List
fstream - Member Functions and Data by Group
fstream - Inherited Member Functions and Data
fstreambase
fstreambase - Hierarchy List
fstreambase - Member Functions and Data by Group
fstreambase - Inherited Member Functions and Data
ifstream
ifstream - Hierarchy List
ifstream - Member Functions and Data by Group
ifstream - Inherited Member Functions and Data
ios
ios - Hierarchy List
ios - Member Functions and Data by Group
ios - Enumerations
ios - Inherited Member Functions and Data
iostream
iostream - Hierarchy List
iostream - Member Functions and Data by Group
iostream - Inherited Member Functions and Data
iostream_withassign
iostream_withassign - Hierarchy List
iostream_withassign - Member Functions and Data by Group
iostream_withassign - Inherited Member Functions and Data
istream
istream - Hierarchy List
istream - Member Functions and Data by Group
istream - Inherited Member Functions and Data
istream_withassign
istream_withassign - Hierarchy List
istream_withassign - Member Functions and Data by Group
istream_withassign - Inherited Member Functions and Data
istrstream
istrstream - Hierarchy List
istrstream - Member Functions and Data by Group
istrstream - Inherited Member Functions and Data
ofstream
ofstream - Hierarchy List
ofstream - Member Functions and Data by Group
ofstream - Inherited Member Functions and Data
ostream
ostream - Hierarchy List
ostream - Member Functions and Data by Group
ostream - Inherited Member Functions and Data
ostream_withassign
ostream_withassign - Hierarchy List
ostream_withassign - Member Functions and Data by Group
ostream_withassign - Inherited Member Functions and Data
ostrstream
ostrstream - Hierarchy List
ostrstream - Member Functions and Data by Group
ostrstream - Inherited Member Functions and Data
stdiobuf
stdiobuf - Hierarchy List
stdiobuf - Member Functions and Data by Group
stdiobuf - Inherited Member Functions and Data
stdiostream
stdiostream - Hierarchy List
stdiostream - Member Functions and Data by Group
stdiostream - Inherited Member Functions and Data
streambuf
streambuf - Hierarchy List
streambuf - Member Functions and Data by Group
streambuf - Inherited Member Functions and Data
strstream
strstream - Hierarchy List
strstream - Member Functions and Data by Group
strstream - Inherited Member Functions and Data
strstreambase
strstreambase - Hierarchy List
strstreambase - Member Functions and Data by Group
strstreambase - Inherited Member Functions and Data
strstreambuf
strstreambuf - Hierarchy List
strstreambuf - Member Functions and Data by Group
strstreambuf - Inherited Member Functions and Data
Installation
XL C/C++ packaging and filesets
XL C compiler filesets
XL C++ compiler filesets
C++ run-time filesets
XL SMP run-time environment filesets
Non-default installation scripts and sample files
XL C/C++ compiler online help filesets
IBM Distributed Debugger filesets
Bundle installation filesets
Installing XL C/C++ Enterprise Edition V7.0 for AIX
System prerequisites
Prerequisite tasks or conditions
Installation and license agreements preview
Default installation
Non-default installation
Bundle installation
Product migration installation
Operating system migration
Enabling the XL C/C++ Enterprise Edition V7.0 for AIX manual pages
Locations of XLOPT and MASS components
Deinstalling XL C/C++ Enterprise Edition V7.0 for AIX from a default location
Using SMIT
Using installp
Deinstalling XL C/C++ Enterprise Edition V7.0 for AIX from a non-default location
Deinstalling previous versions of the MASS components
Deinstalling bundle filesets
Viewing and printing the documentation
Viewing the HTML documentation
Viewing and printing the PDF documentation
Testing the installation
XL Fortran V9.1 (for AIX)
Language reference
XL Fortran for AIX
Language Standards
Fortran 2003 Draft Standard
Fortran 95
Fortran 90
Other Standards and Standards Documents
Typographical Conventions
How to Read Syntax Diagrams
Sample Syntax Diagram
Using Examples
Fundamentals of the XL Fortran Language
Characters
Names
Statements
Statement Keywords
Statement Labels
Lines and Source Formats
Fixed Source Form
Free Source Form
IBM Free Source Form
Conditional Compilation
Order of Statements and Execution Sequence
Data Types and Data Objects
Data Types
Type Parameters and Specifiers
Data Objects
Constants
Automatic Objects
Intrinsic Types
Integer
Real
Complex
Logical
Character
BYTE
Derived Types
Input/Output
Determining Type for Derived Types
Record Structures
Union and Map
Typeless Literal Constants
Hexadecimal Constants
Octal Constants
Binary Constants
Hollerith Constants
Using Typeless Constants
How Type Is Determined
Definition Status of Variables
Events Causing Definition
Events Causing Undefinition
Allocation Status
Storage Classes for Variables
Fundamental Storage Classes
Secondary Storage Classes
Storage Class Assignment
Array Concepts
Arrays
Bounds of a Dimension
Extent of a Dimension
Rank, Shape, and Size of an Array
Array Declarators
Explicit-Shape Arrays
Examples of Explicit-Shape Arrays
Automatic Arrays
Adjustable Arrays
Pointee Arrays
Assumed-Shape Arrays
Examples of Assumed-Shape Arrays
Deferred-Shape Arrays
Allocatable Arrays
Array Pointers
Assumed-Size Arrays
Examples of Assumed-Size Arrays
Array Elements
Notes
Array Element Order
Array Sections
Subscript Triplets
Vector Subscripts
Array Sections and Substring Ranges
Array Sections and Structure Components
Rank and Shape of Array Sections
Array Constructors
Implied-DO List for an Array Constructor
Expressions Involving Arrays
Expressions and Assignment
Introduction to Expressions and Assignment
Primary
Constant Expressions
Examples of Constant Expressions
Initialization Expressions
Examples of Initialization Expressions
Specification Expressions
Examples of Specification Expressions
Operators and Expressions
General
Arithmetic
Character
Relational
Logical
Primary
Extended Intrinsic and Defined Operations
How Expressions Are Evaluated
Precedence of Operators
Using BYTE Data Objects
Intrinsic Assignment
Arithmetic Conversion
WHERE Construct
Interpreting Masked Array Assignments
FORALL Construct
Interpreting the FORALL Construct
Pointer Assignment
Examples of Pointer Assignment
Integer Pointer Assignment
Execution Control
Statement Blocks
ASSOCIATE Construct
DO Construct
The Terminal Statement
DO WHILE Construct
Example
IF Construct
Example
SELECT CASE Construct
Examples
Branching
Program Units and Procedures
Scope
The Scope of a Name
Association
Construct Association
Host Association
Use Association
Pointer Association
Integer Pointer Association
Program Units, Procedures, and Subprograms
Internal Procedures
Interface Concepts
Interface Blocks
Example of an Interface
Generic Interface Blocks
Unambiguous Generic Procedure References
Extending Intrinsic Procedures with Generic Interface Blocks
Defined Operators
Defined Assignment
Main Program
Modules
Example of a Module
Block Data Program Unit
Example of a Block Data Program Unit
Function and Subroutine Subprograms
Procedure References
Intrinsic Procedures
Conflicts Between Intrinsic Procedure Names and Other Names
Arguments
Actual Argument Specification
Argument Association
%VAL and %REF
Intent of Dummy Arguments
Optional Dummy Arguments
Restrictions on Optional Dummy Arguments Not Present
Length of Character Arguments
Variables as Dummy Arguments
Allocatable Objects as Dummy Arguments
Pointers as Dummy Arguments
Procedures as Dummy Arguments
Asterisks as Dummy Arguments
Resolution of Procedure References
Rules for Resolving Procedure References to Names
Resolving Procedure References to Generic Names
Recursion
Pure Procedures
Examples
Elemental Procedures
Examples
XL Fortran Input/Output
Records
Formatted Records
Unformatted Records
Endfile Records
Files
Definition of an External File
File Access Methods
Units
Connection of a Unit
Data Transfer Statements
Asynchronous Input/Output
Advancing and Nonadvancing Input/Output
File Position Before and After Data Transfer
Conditions and IOSTAT Values
End-Of-Record Conditions
End-Of-File Conditions
Error Conditions
Input/Output Formatting
Format-Directed Formatting
Complex Editing
Data Edit Descriptors
Control Edit Descriptors
Interaction of Input/Output Lists and Format Specifications
Data Edit Descriptors
A (Character) Editing
B (Binary) Editing
E, D, and Q (Extended Precision) Editing
EN Editing
ES Editing
F (Real without Exponent) Editing
G (General) Editing
I (Integer) Editing
L (Logical) Editing
O (Octal) Editing
Q (Character Count) Editing
Z (Hexadecimal) Editing
Control Edit Descriptors
/ (Slash) Editing
: (Colon) Editing
$ (Dollar) Editing
Apostrophe/Double Quotation Mark Editing (Character-String Edit Descriptor)
BN (Blank Null) and BZ (Blank Zero) Editing
H Editing
P (Scale Factor) Editing
S, SP, and SS (Sign Control) Editing
T, TL, TR, and X (Positional) Editing
List-Directed Formatting
Value Separators
List-Directed Input
List-Directed Output
Namelist Formatting
Namelist Input
Namelist Output
Statements and Attributes
Attributes
ALLOCATABLE
ALLOCATE
ASSIGN
ASSOCIATE
AUTOMATIC
BACKSPACE
BIND
BLOCK DATA
BYTE
CALL
CASE
CHARACTER
CLOSE
COMMON
Common Association
COMPLEX
CONTAINS
CONTINUE
CYCLE
DATA
DEALLOCATE
Derived Type
DIMENSION
DO
DO WHILE
DOUBLE COMPLEX
DOUBLE PRECISION
ELSE
ELSE IF
ELSEWHERE
END
END (Construct)
END INTERFACE
END TYPE
ENDFILE
ENTRY
Recursion
EQUIVALENCE
EXIT
EXTERNAL
FLUSH
FORALL
Interpreting the FORALL Statement
Loop Parallelization
FORALL (Construct)
FORMAT
Character Format Specification
FUNCTION
Recursion
Elemental Procedures
GO TO (Assigned)
GO TO (Computed)
GO TO (Unconditional)
IF (Arithmetic)
IF (Block)
IF (Logical)
IMPLICIT
IMPORT
INQUIRE
INTEGER
INTENT
INTERFACE
INTRINSIC
LOGICAL
MODULE
MODULE PROCEDURE
NAMELIST
NULLIFY
OPEN
OPTIONAL
PARAMETER
PAUSE
POINTER (Fortran 90)
POINTER (integer)
PRINT
Implied-DO List
PRIVATE
PROCEDURE
PROGRAM
PROTECTED
PUBLIC
READ
Implied-DO List
REAL
RECORD
RETURN
REWIND
SAVE
SELECT CASE
SEQUENCE
Statement Function
STATIC
STOP
SUBROUTINE
TARGET
TYPE
Type Declaration
USE
VALUE
VIRTUAL
VOLATILE
WAIT
WHERE
WRITE
Implied-DO List
Directives
Comment and Noncomment Form Directives
Comment Form Directives
Noncomment Form Directives
Directives and Optimization
Assertive Directives
Directives for Loop Optimization
Detailed Directive Descriptions
ASSERT
BLOCK_LOOP
CNCALL
COLLAPSE
EJECT
INCLUDE
INDEPENDENT
#LINE
LOOPID
NOVECTOR
PERMUTATION
@PROCESS
SNAPSHOT
SOURCEFORM
STREAM_UNROLL
SUBSCRIPTORDER
UNROLL
UNROLL_AND_FUSE
Hardware-Specific Directives
CACHE_ZERO
EIEIO
ISYNC
LIGHT_SYNC
PREFETCH
PROTECTED STREAM
SMP Directives
An Introduction to SMP Directives
Parallel Region Construct
Work-sharing Constructs
Combined Parallel Work-sharing Constructs
Synchronization Constructs
Other OpenMP Directives
Non-OpenMP SMP Directives
Detailed Descriptions of SMP Directives
ATOMIC
BARRIER
CRITICAL / END CRITICAL
DO / END DO
DO SERIAL
FLUSH
MASTER / END MASTER
ORDERED / END ORDERED
PARALLEL / END PARALLEL
PARALLEL DO / END PARALLEL DO
PARALLEL SECTIONS / END PARALLEL SECTIONS
PARALLEL WORKSHARE / END PARALLEL WORKSHARE
SCHEDULE
SECTIONS / END SECTIONS
SINGLE / END SINGLE
THREADLOCAL
THREADPRIVATE
WORKSHARE
OpenMP Directive Clauses
Global Rules for Directive Clauses
COPYIN
COPYPRIVATE
DEFAULT
IF
FIRSTPRIVATE
LASTPRIVATE
NUM_THREADS
ORDERED
PRIVATE
REDUCTION
SCHEDULE
SHARED
Intrinsic Procedures
Classes of Intrinsic Procedures
Inquiry Intrinsic Functions
Elemental Intrinsic Procedures
System Inquiry Intrinsic Functions
Transformational Intrinsic Functions
Intrinsic Subroutines
Data Representation Models
Integer Bit Model
Integer Data Model
Real Data Model
Detailed Descriptions of Intrinsic Procedures
ABORT()
ABS(A)
ACHAR(I)
ACOS(X)
ACOSD(X)
ADJUSTL(STRING)
ADJUSTR(STRING)
AIMAG(Z), IMAG(Z)
AINT(A, KIND)
ALL(MASK, DIM)
ALLOCATED(ARRAY) or ALLOCATED(SCALAR)
ANINT(A, KIND)
ANY(MASK, DIM)
ASIN(X)
ASIND(X)
ASSOCIATED(POINTER, TARGET)
ATAN(X)
ATAND(X)
ATAN2(Y, X)
ATAN2D(Y, X)
BIT_SIZE(I)
BTEST(I, POS)
CEILING(A, KIND)
CHAR(I, KIND)
CMPLX(X, Y, KIND)
COMMAND_ARGUMENT_COUNT()
CONJG(Z)
COS(X)
COSD(X)
COSH(X)
COUNT(MASK, DIM)
CPU_TIME(TIME)
CSHIFT(ARRAY, SHIFT, DIM)
CVMGx(TSOURCE, FSOURCE, MASK)
DATE_AND_TIME(DATE, TIME, ZONE, VALUES)
DBLE(A)
DCMPLX(X, Y)
DIGITS(X)
DIM(X, Y)
DOT_PRODUCT(VECTOR_A, VECTOR_B)
DPROD(X, Y)
EOSHIFT(ARRAY, SHIFT, BOUNDARY, DIM)
EPSILON(X)
ERF(X)
ERFC(X)
EXP(X)
EXPONENT(X)
FLOOR(A, KIND)
FRACTION(X)
GAMMA(X)
GETENV(NAME, VALUE)
GET_COMMAND(COMMAND, LENGTH, STATUS)
GET_COMMAND_ARGUMENT(NUMBER, VALUE, LENGTH, STATUS)
GET_ENVIRONMENT_VARIABLE(NAME, VALUE, LENGTH, STATUS, TRIM_NAME)
HFIX(A)
HUGE(X)
IACHAR(C)
IAND(I, J)
IBCLR(I, POS)
IBITS(I, POS, LEN)
IBSET(I, POS)
ICHAR(C)
IEOR(I, J)
ILEN(I)
IMAG(Z)
INDEX(STRING, SUBSTRING, BACK)
INT(A, KIND)
INT2(A)
IOR(I, J)
ISHFT(I, SHIFT)
ISHFTC(I, SHIFT, SIZE)
KIND(X)
LBOUND(ARRAY, DIM)
LEADZ(I)
LEN(STRING)
LEN_TRIM(STRING)
LGAMMA(X)
LGE(STRING_A, STRING_B)
LGT(STRING_A, STRING_B)
LLE(STRING_A, STRING_B)
LLT(STRING_A, STRING_B)
LOC(X)
LOG(X)
LOG10(X)
LOGICAL(L, KIND)
LSHIFT(I, SHIFT)
MATMUL(MATRIX_A, MATRIX_B, MINDIM)
MAX(A1, A2, A3, ...)
MAXEXPONENT(X)
MAXLOC(ARRAY, DIM, MASK) or MAXLOC(ARRAY, MASK)
MAXVAL(ARRAY, DIM, MASK) or MAXVAL(ARRAY, MASK)
MERGE(TSOURCE, FSOURCE, MASK)
MIN(A1, A2, A3, ...)
MINEXPONENT(X)
MINLOC(ARRAY, DIM, MASK) or MINLOC(ARRAY, MASK)
MINVAL(ARRAY, DIM, MASK) or MINVAL(ARRAY, MASK)
MOD(A, P)
MODULO(A, P)
MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)
NEAREST(X,S)
NEW_LINE(A)
NINT(A, KIND)
NOT(I)
NULL(MOLD)
NUM_PARTHDS()
NUMBER_OF_PROCESSORS(DIM)
NUM_USRTHDS()
PACK(ARRAY, MASK, VECTOR)
POPCNT(I)
POPPAR(I)
PRECISION(X)
PRESENT(A)
PROCESSORS_SHAPE()
PRODUCT(ARRAY, DIM, MASK) or PRODUCT(ARRAY, MASK)
QCMPLX(X, Y)
QEXT(A)
RADIX(X)
RAND()
RANDOM_NUMBER(HARVEST)
RANDOM_SEED(SIZE, PUT, GET, GENERATOR)
RANGE(X)
REAL(A, KIND)
REPEAT(STRING, NCOPIES)
RESHAPE(SOURCE, SHAPE, PAD, ORDER)
RRSPACING(X)
RSHIFT(I, SHIFT)
SCALE(X,I)
SCAN(STRING, SET, BACK)
SELECTED_INT_KIND(R)
SELECTED_REAL_KIND(P, R)
SET_EXPONENT(X,I)
SHAPE(SOURCE)
SIGN(A, B)
SIGNAL(I, PROC)
SIN(X)
SIND(X)
SINH(X)
SIZE(ARRAY, DIM)
SIZEOF(A)
SPACING(X)
SPREAD(SOURCE, DIM, NCOPIES)
SQRT(X)
SRAND(SEED)
SUM(ARRAY, DIM, MASK) or SUM(ARRAY, MASK)
SYSTEM(CMD, RESULT)
SYSTEM_CLOCK(COUNT, COUNT_RATE, COUNT_MAX)
TAN(X)
TAND(X)
TANH(X)
TINY(X)
TRANSFER(SOURCE, MOLD, SIZE)
TRANSPOSE(MATRIX)
TRIM(STRING)
UBOUND(ARRAY, DIM)
UNPACK(VECTOR, MASK, FIELD)
VERIFY(STRING, SET, BACK)
Hardware-Specific Intrinsic Procedures
ALIGNX(K,M)
FCFI(I)
FCTID(X)
FCTIDZ(X)
FCTIW(X)
FCTIWZ(X)
FMADD(A, X, Y)
FMSUB(A, X, Y)
FNABS(X)
FNMADD(A, X, Y)
FNMSUB(A, X, Y)
FRE(X)
FRES(X)
FRSQRTE(X)
FRSQRTES(X)
FSEL(X,Y,Z)
MTFSF(MASK, R)
MTFSFI(BF, I)
MULHY(RA, RB)
POPCNTB(I)
ROTATELI(RS, IS, SHIFT, MASK)
ROTATELM(RS, SHIFT, MASK)
SETFSB0(BT)
SETFSB1(BT)
SFTI(M, Y)
SWDIV(X,Y)
SWDIV_NOCHK(X,Y)
TRAP(A, B, TO)
Language Interoperability Features
Interoperability of Types
Intrinsic Types
Derived Types
Interoperability of Variables
Interoperability of Common Blocks
Interoperability of Procedures
The ISO_C_BINDING Module
Constants for use as Kind Type Parameters
Character Constants
Other Constants
Types
Procedures
Binding Labels
The ISO_FORTRAN_ENV Intrinsic Module
CHARACTER_STORAGE_SIZE
ERROR_UNIT
FILE_STORAGE_SIZE
INPUT_UNIT
IOSTAT_END
IOSTAT_EOR
NUMERIC_STORAGE_SIZE
OUTPUT_UNIT
OpenMP Execution Environment and Lock Routines
omp_destroy_lock(svar)
omp_destroy_nest_lock(nvar)
omp_get_dynamic()
omp_get_max_threads()
omp_get_nested()
omp_get_num_procs()
omp_get_num_threads()
omp_get_thread_num()
omp_get_wtick()
omp_get_wtime()
omp_in_parallel()
omp_init_lock(svar)
omp_init_nest_lock(nvar)
omp_set_dynamic(enable_expr)
omp_set_lock(svar)
omp_set_nested(enable_expr)
omp_set_nest_lock(nvar)
omp_set_num_threads(number_of_threads_expr)
omp_test_lock(svar)
omp_test_nest_lock(nvar)
omp_unset_lock(svar)
omp_unset_nest_lock(nvar)
Pthreads Library Module
Pthreads Data Structures, Functions, and Subroutines
Pthreads Data Types
Functions That Perform Operations on Thread Attribute Objects
Functions and Subroutines That Perform Operations on Thread
Functions That Perform Operations on Mutex Attribute Objects
Functions That Perform Operations on Mutex Objects
Functions That Perform Operations on Attribute Objects of Condition Variables
Functions That Perform Operations on Condition Variable Objects
Functions That Perform Operations on Thread-Specific Data
Functions and Subroutines That Perform Operations to Control Thread Cancelability
Functions That Perform Operations on Read-Write Lock Attribute Objects
Functions That Perform Operations on Read-Write Lock Objects
Functions That Perform Operations for One-Time Initialization
f_maketime(delay)
f_pthread_attr_destroy(attr)
f_pthread_attr_getdetachstate(attr, detach)
f_pthread_attr_getguardsize(attr, guardsize)
f_pthread_attr_getinheritsched(attr, inherit)
f_pthread_attr_getschedparam(attr, param)
f_pthread_attr_getschedpolicy(attr, policy)
f_pthread_attr_getscope(attr, scope)
f_pthread_attr_getstackaddr(attr, stackaddr)
f_pthread_attr_getstacksize(attr, ssize)
f_pthread_attr_init(attr)
f_pthread_attr_setdetachstate(attr, detach)
f_pthread_attr_setguardsize(attr, guardsize)
f_pthread_attr_setinheritsched(attr, inherit)
f_pthread_attr_setschedparam(attr, param)
f_pthread_attr_setschedpolicy(attr, policy)
f_pthread_attr_setscope(attr, scope)
f_pthread_attr_setstackaddr(attr, stackaddr)
f_pthread_attr_setstacksize(attr, ssize)
f_pthread_attr_t
f_pthread_cancel(thread)
f_pthread_cleanup_pop(exec)
f_pthread_cleanup_push(cleanup, flag, arg)
f_pthread_cond_broadcast(cond)
f_pthread_cond_destroy(cond)
f_pthread_cond_init(cond, cattr)
f_pthread_cond_signal(cond)
f_pthread_cond_t
f_pthread_cond_timedwait(cond, mutex, timeout)
f_pthread_cond_wait(cond, mutex)
f_pthread_condattr_destroy(cattr)
f_pthread_condattr_getpshared(cattr, pshared)
f_pthread_condattr_init(cattr)
f_pthread_condattr_setpshared(cattr, pshared)
f_pthread_condattr_t
f_pthread_create(thread, attr, flag, ent, arg)
f_pthread_detach(thread)
f_pthread_equal(thread1, thread2)
f_pthread_exit(ret)
f_pthread_getconcurrency()
f_pthread_getschedparam(thread, policy, param)
f_pthread_getspecific(key, arg)
f_pthread_join(thread, ret)
f_pthread_key_create(key, dtr)
f_pthread_key_delete(key)
f_pthread_key_t
f_pthread_kill(thread, sig)
f_pthread_mutex_destroy(mutex)
f_pthread_mutex_getprioceiling(mutex, old)
f_pthread_mutex_init(mutex, mattr)
f_pthread_mutex_lock(mutex)
f_pthread_mutex_setprioceiling(mutex, new, old)
f_pthread_mutex_t
f_pthread_mutex_trylock(mutex)
f_pthread_mutex_unlock(mutex)
f_pthread_mutexattr_destroy(mattr)
f_pthread_mutexattr_getprioceiling(mattr, ceiling)
f_pthread_mutexattr_getprotocol(mattr, proto)
f_pthread_mutexattr_getpshared(mattr, pshared)
f_pthread_mutexattr_gettype(mattr, type)
f_pthread_mutexattr_init(mattr)
f_pthread_mutexattr_setprioceiling(mattr, ceiling)
f_pthread_mutexattr_setprotocol(mattr, proto)
f_pthread_mutexattr_setpshared(mattr, pshared)
f_pthread_mutexattr_settype(mattr, type)
f_pthread_mutexattr_t
f_pthread_once(once, initr)
f_pthread_once_t
f_pthread_rwlock_destroy(rwlock)
f_pthread_rwlock_init(rwlock, rwattr)
f_pthread_rwlock_rdlock(rwlock)
f_pthread_rwlock_t
f_pthread_rwlock_tryrdlock(rwlock)
f_pthread_rwlock_trywrlock(rwlock)
f_pthread_rwlock_unlock(rwlock)
f_pthread_rwlock_wrlock(rwlock)
f_pthread_rwlockattr_destroy(rwattr)
f_pthread_rwlockattr_getpshared(rwattr, pshared)
f_pthread_rwlockattr_init(rwattr)
f_pthread_rwlockattr_setpshared(rwattr, pshared)
f_pthread_rwlockattr_t
f_pthread_self()
f_pthread_setcancelstate(state, oldstate)
f_pthread_setcanceltype(type, oldtype)
f_pthread_setconcurrency(new_level)
f_pthread_setschedparam(thread, policy, param)
f_pthread_setspecific(key, arg)
f_pthread_t
f_pthread_testcancel()
f_sched_param
f_sched_yield()
f_timespec
Floating-Point Control and Inquiry Procedures
fpgets fpsets
Efficient Floating-Point Control and Inquiry Procedures
xlf_fp_util Floating-Point Procedures
IEEE Modules and Support
Compiling and Exception Handling
General Rules for Implementing IEEE Modules
IEEE Derived Data Types and Constants
IEEE Operators
IEEE PROCEDURES
Rules for Floating-Point Status
Examples
Service and Utility Procedures
General Service and Utility Procedures
List of Service and Utility Procedures
alarm_(time, func)
bic_(X1, X2)
bis_(X1, X2)
bit_(X1, X2)
clock_()
ctime_(STR, TIME)
date()
dtime_(dtime_struct)
etime_(etime_struct)
exit_(exit_status)
fdate_(str)
fiosetup_(unit, command, argument)
flush_(lunit)
ftell_(lunit)
ftell64_(lunit)
getarg(i1,c1)
getcwd_(name)
getfd(lunit)
getgid_()
getlog_(name)
getpid_()
getuid_()
global_timef()
gmtime_(stime, tarray)
hostnm_(name)
iargc()
idate_(idate_struct)
ierrno_()
irand()
irtc()
itime_(itime_struct)
jdate()
lenchr_(str)
lnblnk_(str)
ltime_(stime, tarray)
mclock()
qsort_(array, len, isize, compar)
qsort_down(array, len, isize)
qsort_up(array, len, isize)
rtc()
setrteopts(c1)
sleep_(sec)
time_()
timef()
timef_delta(t)
umask_(cmask)
usleep_(msec)
xl__trbk()
Compatibility Across Standards
Fortran 90 compatibility
Obsolescent Features
Deleted Features
ASCII and EBCDIC Character Sets
Glossary
User's guide
What's New for XL Fortran
Introduction
How to Use This Document
How to Read the Syntax Diagrams and Statements
Notes on the Examples in This Document
Notes on the Terminology in This Document
Typographical Conventions
Related Documentation
XL Fortran and Operating System Publications
Other Publications
Standards Documents
Overview of XL Fortran Features
Hardware and Operating-System Support
Language Support
Migration Support
Source-Code Conformance Checking
Highly Configurable Compiler
Diagnostic Listings
Symbolic Debugger Support
Program Optimization
Documentation and Online Help
Setting Up and Customizing XL Fortran
Where to Find Installation Instructions
Using the Compiler on a Network File System
Correct Settings for Environment Variables
Environment Variable Basics
Environment Variables for National Language Support
LIBPATH: Setting Library Search Paths
PDFDIR: Specifying the Directory for PDF Profile Information
TMPDIR: Specifying a Directory for Temporary Files
XLFSCRATCH_unit: Specifying Names for Scratch Files
XLFUNIT_unit: Specifying Names for Implicitly Connected Files
Customizing the Configuration File
Attributes
What a Configuration File Looks Like
Determining Which Level of XL Fortran Is Installed
Upgrading to XL Fortran Version 9
Things to Note in XL Fortran Version 9
Avoiding or Fixing Upgrade Problems
Running Two Levels of XL Fortran
Editing, Compiling, Linking, and Running XL Fortran Programs
Editing XL Fortran Source Files
Compiling XL Fortran Programs
Compiling XL Fortran Version 2 Programs
Compiling Fortran 90 or Fortran 95 Programs
Compiling XL Fortran SMP Programs
Compilation Order for Fortran Programs
Canceling a Compilation
XL Fortran Input Files
XL Fortran Output Files
Scope and Precedence of Option Settings
Specifying Options on the Command Line
Specifying Options in the Source File
Passing Command-Line Options to the ld or as Commands
Tracking Use of the Compiler
Compiling for Specific Architectures
Passing Fortran Files through the C Preprocessor
cpp Directives for XL Fortran Programs
Passing Options to the C Preprocessor
Avoiding Preprocessing Problems
Linking XL Fortran Programs
Compiling and Linking in Separate Steps
Linking 32-Bit SMP Object Files Using the ld Command
Linking 64-Bit SMP Object Files Using the ld Command
Linking 32-Bit Non-SMP Object Files Using the ld Command
Linking 64-Bit Non-SMP Object Files Using the ld Command
Passing Options to the ld Command
Checking for Interface Errors at Link Time
Linking New Objects with Existing Ones
Relinking an Existing Executable File
Dynamic and Static Linking
Avoiding Naming Conflicts during Linking
Running XL Fortran Programs
Canceling Execution
Running Previously Compiled Programs
Compiling and Executing on Different Systems
POSIX Pthreads Binary Compatibility
Run-Time Libraries for POSIX Pthreads Support
Selecting the Language for Run-Time Messages
Setting Run-Time Options
OpenMP Environment Variables
Other Environment Variables That Affect Run-Time Behavior
XL Fortran Run-Time Exceptions
XL Fortran Compiler-Option Reference
Summary of the XL Fortran Compiler Options
Options That Control Input to the Compiler
Options That Specify the Locations of Output Files
Options for Performance Optimization
Options for Error Checking and Debugging
Options That Control Listings and Messages
Options for Compatibility
Options for Floating-Point Processing
Options That Control Linking
Options That Control Other Compiler Operations
Options That Are Obsolete or Not Recommended
Detailed Descriptions of the XL Fortran Compiler Options
-# Option
-1 Option
-B Option
-b64 Option
-bdynamic, -bshared, and -bstatic Options
-bhalt Option
-bloadmap Option
-bmaxdata, -bmaxstack Options
-brtl Option
-bshared Option
-bstatic Option
-C Option
-c Option
-D Option
-d Option
-F Option
-g Option
-I Option
-k Option
-L Option
-l Option
-N Option
-O Option
-o Option
-P Option
-p Option
-Q Option
-q32 Option
-q64 Option
-qalias Option
-qalign Option
-qarch Option
-qassert Option
-qattr Option
-qautodbl Option
-qcache Option
-qcclines Option
-qcheck Option
-qci Option
-qcompact Option
-qcr Option
-qctyplss Option
-qdbg Option
-qddim Option
-qdirective Option
-qdirectstorage Option
-qdlines Option
-qdpc Option
-qdpcl Option
-qescape Option
-qessl Option
-qextchk Option
-qextern Option
-qextname Option
-qfdpr Option
-qfixed Option
-qflag Option
-qfloat Option
-qflttrap Option
-qfree Option
-qfullpath Option
-qhalt Option
-qhot Option
-qhsflt Option
-qhssngl Option
-qieee Option
-qinit Option
-qinitauto Option
-qintlog Option
-qintsize Option
-qipa Option
-qkeepparm Option
-qlanglvl Option
-qlargepage Option
-qlibansi Option
-qlibessl Option
-qlibposix Option
-qlist Option
-qlistopt Option
-qlm Option
-qlog4 Option
-qmaxmem Option
-qmbcs Option
-qmixed Option
-qmoddir Option
-qmodule Option
-qnoprint Option
-qnullterm Option
-qobject Option
-qonetrip Option
-qoptimize Option
-qpdf Option
-qphsinfo Option
-qpic Option
-qport Option
-qposition Option
-qprefetch Option
-qqcount Option
-qrealsize Option
-qrecur Option
-qreport Option
-qsaa Option
-qsave Option
-qsaveopt Option
-qsclk Option
-qshowpdf Option
-qsigtrap Option
-qsmallstack Option
-qsmp Option
-qsource Option
-qspillsize Option
-qstrict Option
-qstrictieeemod Option
-qstrict_induction Option
-qsuffix Option
-qsuppress Option
-qswapomp Option
-qtbtable Option
-qthreaded Option
-qtune Option
-qundef Option
-qunroll Option
-qunwind Option
-qversion Option
-qwarn64 Option
-qxflag=oldtab Option
-qxflag=xalias Option
-qxlf77 Option
-qxlf90 Option
-qxlines Option
-qxref Option
-qzerosize Option
-S Option
-t Option
-U Option
-u Option
-v Option
-V Option
-W Option
-w Option
-y Option
Using XL Fortran in a 64-Bit Environment
64-Bit Large Data Type Support
64-Bit Thread Support
Compiler Options for the 64-Bit Environment
-q32 Option
-q64 Option
-qwarn64 Option
Default Bit Mode
Module Support
XL Fortran Floating-Point Processing
IEEE Floating-Point Overview
Compiling for Strict IEEE Conformance
IEEE Single- and Double-Precision Values
IEEE Extended-Precision Values
Infinities and NaNs
Exception-Handling Model
Hardware-Specific Floating-Point Overview
Single- and Double-Precision Values
Extended-Precision Values
How XL Fortran Rounds Floating-Point Calculations
Selecting the Rounding Mode
Minimizing Rounding Errors
Minimizing Overall Rounding
Delaying Rounding until Run Time
Ensuring that the Rounding Mode is Consistent
Duplicating the Floating-Point Results of Other Systems
Maximizing Floating-Point Performance
Detecting and Trapping Floating-Point Exceptions
Compiler Features for Trapping Floating-Point Exceptions
Operating System Features for Trapping Floating-Point Exceptions
Installing an Exception Handler
Producing a Core File
Controlling the Floating-Point Status and Control Register
xlf_fp_util Procedures
fpgets and fpsets Subroutines
Sample Programs for Exception Handling
Causing Exceptions for Particular Variables
Minimizing the Performance Impact of Floating-Point Exception Trapping
Floating-Point Processing on the POWER and POWER2 Architectures
Precision of Computations
Invalid Operation Exceptions for SQRT Operations on POWER Processors
Optimizing XL Fortran Programs
The Philosophy of XL Fortran Optimizations
Summary of Compiler Options for Optimization
Choosing an Optimization Level
Optimization Level -O2
Optimization Level -O3
Getting the Most out of -O2 and -O3
The -O4 and -O5 Options
Optimizing for a Target Machine or Class of Machines
Getting the Most out of Target Machine Options
Optimizing Floating-Point Calculations
High-order Transformations (-qhot)
Getting the Most out of -qhot
Optimizing Loops and Array Language
Profile-directed Feedback (PDF)
Using Profile-directed Feedback (PDF)
Optimizing Conditional Branching
Interprocedural Analysis (-qipa)
Getting the Most from -qipa
Optimizing Subprogram Calls
Finding the Right Level of Inlining
Shared-memory Parallelism (-qsmp)
Getting the Most out of -qsmp
Other Program Behavior Options
Other Performance Options
Debugging Optimized Code
Different Results in Optimized Programs
Compiler-friendly Programming
Implementation Details of XL Fortran Input/Output
Implementation Details of File Formats
File Names
Preconnected and Implicitly Connected Files
File Positioning
Preserving the XL Fortran Version 2.3 File Positioning
I/O Redirection
How XLF I/O Interacts with Pipes, Special Files, and Links
Default Record Lengths
File Permissions
Selecting Error Messages and Recovery Actions
Flushing I/O Buffers
Choosing Locations and Names for Input/Output Files
Naming Files That Are Connected with No Explicit Name
Naming Scratch Files
Increasing Throughput with Logical Volume I/O and Data Striping
Logical Volume I/O
Data Striping
Asynchronous I/O
Execution of an Asychronous Data Transfer Operation
Usage
Performance
Compiler-Generated Temporary I/O Items
System Setup
Linking
Error Handling
XL Fortran Thread-Safe I/O Library
Use of I/O Statements in Signal Handlers
Asynchronous Thread Cancellation
Interlanguage Calls
Conventions for XL Fortran External Names
Mixed-Language Input and Output
Mixing Fortran and C++
Making Calls to C Functions Work
Passing Data From One Language to Another
Passing Arguments between Languages
Passing Global Variables between Languages
Passing Character Types between Languages
Passing Arrays between Languages
Passing Pointers between Languages
Passing Arguments By Reference or By Value
Returning Values from Fortran Functions
Arguments with the OPTIONAL Attribute
Arguments with the INTENT Attribute
Type Encoding and Checking
Assembler-Level Subroutine Linkage Conventions
The Stack
The Link Area
The Input Parameter Area
The Register Save Area
The Local Stack Area
The Output Parameter Area
Linkage Convention for Argument Passing
Argument Passing Rules (by Value)
Order of Arguments in Argument List
Linkage Convention for Function Calls
Pointers to Functions
Function Values
The Stack Floor
Stack Overflow
Prolog and Epilog
Traceback
THREADLOCAL Common Blocks and ILC with C
Example
Problem Determination and Debugging
Understanding XL Fortran Error Messages
Error Severity
Compiler Return Code
Run-Time Return Code
Understanding XL Fortran Messages
Limiting the Number of Compile-Time Messages
Selecting the Language for Messages
Fixing Installation or System Environment Problems
Fixing Compile-Time Problems
Duplicating Extensions from Other Systems
Isolating Problems with Individual Compilation Units
Compiling with Thread-safe Commands
Running out of Machine Resources
Fixing Link-Time Problems
Fixing Run-Time Problems
Duplicating Extensions from Other Systems
Mismatched Sizes or Types for Arguments
Working around Problems when Optimizing
Input/Output Errors
Tracebacks and Core Dumps
Debugging a Fortran 90 or Fortran 95 Program
A Sample dbx Session for an XL Fortran Program
Problem with Dynamic Memory Allocation
Using Debug Memory Routines for XL Fortran
The libhm.a Library
The libhmd.a Library
Environment Variables
Understanding XL Fortran Compiler Listings
Header Section
Options Section
Source Section
Error Messages
Transformation Report Section
Attribute and Cross-Reference Section
Object Section
File Table Section
Compilation Unit Epilogue Section
Compilation Epilogue Section
Fortran-Related AIX Commands
Working with Object-Code Archives (ar)
Printing Output Files with Fortran ASA Carriage Controls (asa)
Splitting Subprograms into Individual Files (fsplit)
Automating Large, Complex Compilations (make)
Run-Time Profiling (prof, gprof)
Translating Programs into RATFOR (struct)
Displaying Information inside Binary Files (what)
Porting Programs to XL Fortran
Outline of the Porting Process
Maintaining FORTRAN 77 Source and Object Code
Portability of Directives
NEW
Common Industry Extensions That XL Fortran Supports
Mixing Data Types in Statements
Date and Time Routines
Other libc Routines
Changing the Default Sizes of Data Types
Name Conflicts between Your Procedures and XL Fortran Intrinsic Procedures
Reproducing Results from Other Systems
Finding Nonstandard Extensions
Answers to Frequently Asked Questions
Finding the Date and Time
Efficient Static Linking
Appendix A. Sample Fortran Programs
Example 1 - XL Fortran Source File
Execution Results
Example 2 - Valid C Routine Source File
Example 3 - Valid Fortran SMP Source File
Example 4 - Invalid Fortran SMP Source File
Programming Examples Using the Pthreads Library Module
Appendix B. XL Fortran Technical Information
The Compiler Phases
External Names in the XL Fortran Shared Libraries
The XL Fortran Run-Time Environment
External Names in the Run-Time Environment
Technical Details of the -qfloat=hsflt Option
Implementation Details for -qautodbl Promotion and Padding
Terminology
Examples of Storage Relationships for -qautodbl Suboptions
Appendix C. Using the Mathematical Acceleration Subsystem (MASS)
Using the Scalar Library
Using the Vector Libraries
Consistency of MASS Vector Functions
Compiling and Linking a Program with MASS
Using libmass.a with the Standard Intrinsic Functions
Appendix D. XL Fortran Internal Limits
Glossary
Installation guide
XL Fortran packaging and filesets
XL Fortran compiler filesets
XL Fortran run-time environment filesets
C++ run-time filesets
XL SMP run-time environment filesets
XL Fortran compiler online help filesets
Run-time debug memory routine filesets
IBM Distributed Debugger filesets
Installing XL Fortran Enterprise Edition V9.1 for AIX
System prerequisites
Prerequisite tasks or conditions
Installation and license agreements preview
Default installation
Non-default installation
Bundle installation
Product migration installation
Operating system migration
Enabling the XL Fortran manual pages
Locations of XLOPT and MASS components
Deinstalling XL Fortran from a default location
Using SMIT
Using installp
Deinstalling XL Fortran from a non-default location
Deinstallation of bundle filesets
Deinstalling previous versions of the MASS components
Viewing and printing the documentation
Viewing the HTML documentation
Viewing and printing the PDF documentation
Testing the installation
COBOL for AIX (V2.0)
Language Reference
About this document
Accessibility of this document
IBM extensions
Obsolete language elements
How to read the syntax diagrams
DBCS notation
Acknowledgment
How to send your comments
COBOL language structure
Characters
Character encoding units
Character-strings
COBOL words with single-byte characters
User-defined words with multibyte characters
User-defined words
System-names
Function-names
Reserved words
Figurative constants
Special registers
ADDRESS OF
DEBUG-ITEM
JNIENVPTR
LENGTH OF
LINAGE-COUNTER
RETURN-CODE
SHIFT-OUT and SHIFT-IN
SORT-CONTROL
SORT-CORE-SIZE
SORT-FILE-SIZE
SORT-MESSAGE
SORT-MODE-SIZE
SORT-RETURN
TALLY
WHEN-COMPILED
XML-CODE
XML-EVENT
XML-NTEXT
XML-TEXT
Literals
Alphanumeric literals
Basic alphanumeric literals
Alphanumeric literals with multibyte characters
Hexadecimal notation for alphanumeric literals
Null-terminated alphanumeric literals
Numeric literals
DBCS literals
National literals
Basic national literals
Hexadecimal notation for national literals
Where national literals can be used
PICTURE character-strings
Comments
Separators
Rules for separators
Sections and paragraphs
Sentences, statements, and entries
Entries
Clauses
Sentences
Statements
Phrases
Reference format
Sequence number area
Indicator area
Area A
Division headers
Section headers
Paragraph headers or paragraph names
Level indicators (FD and SD) or level-numbers (01 and 77)
DECLARATIVES and END DECLARATIVES
End program, end class, and end method markers
Area B
Entries, sentences, statements, clauses
Continuation lines
Area A or Area B
Level-numbers
Comment lines
Compiler-directing statements
Compiler directives
Debugging lines
Pseudo-text
Blank lines
Scope of names
Types of names
External and internal resources
Resolution of names
Referencing data names, copy libraries, and procedure division names
Uniqueness of reference
Qualification
Identical names
References to COPY libraries
References to procedure division names
References to data division names
Condition-name
Index-name
Index data item
Subscripting
Reference modification
Function-identifier
Data attribute specification
Transfer of control
Millennium Language Extensions and date fields
Millennium Language Extensions syntax
Terms and concepts
Date field
Nondate
Century window
COBOL source unit structure
COBOL program structure
Nested programs
Conventions for program-names
COBOL class definition structure
COBOL method definition structure
Identification division
Identification division
PROGRAM-ID paragraph
CLASS-ID paragraph
General rules
Inheritance
FACTORY paragraph
OBJECT paragraph
METHOD-ID paragraph
Optional paragraphs
Environment division
Configuration section
SOURCE-COMPUTER paragraph
OBJECT-COMPUTER paragraph
SPECIAL-NAMES paragraph
ALPHABET clause
SYMBOLIC CHARACTERS clause
CLASS clause
CURRENCY SIGN clause
DECIMAL-POINT IS COMMA clause
REPOSITORY paragraph
General rules
Identifying and referencing the class
Input-Output section
FILE-CONTROL paragraph
SELECT clause
ASSIGN clause
RESERVE clause
ORGANIZATION clause
File organization
PADDING CHARACTER clause
RECORD DELIMITER clause
ACCESS MODE clause
File organization and access modes
Access modes
Relationship between data organizations and access modes
RECORD KEY clause
ALTERNATE RECORD KEY clause
RELATIVE KEY clause
PASSWORD clause
FILE STATUS clause
I-O-CONTROL paragraph
RERUN clause
SAME AREA clause
SAME RECORD AREA clause
SAME SORT AREA clause
SAME SORT-MERGE AREA clause
MULTIPLE FILE TAPE clause
APPLY WRITE-ONLY clause
Data division
Data division overview
File section
Working-storage section
Local-storage section
Linkage section
Data units
File data
Program data
Method data
Factory data
Instance data
Data relationships
Levels of data
Levels of data in a record description entry
Special level-numbers
Indentation
Classes and categories of data
Alignment rules
Character-string and item size
Signed data
Operational signs
Editing signs
Data division--file description entries
File section
EXTERNAL clause
GLOBAL clause
BLOCK CONTAINS clause
RECORD clause
Format 1
Format 2
Format 3
LABEL RECORDS clause
VALUE OF clause
DATA RECORDS clause
LINAGE clause
LINAGE-COUNTER special register
RECORDING MODE clause
CODE-SET clause
Data division--data description entry
Format 1
Format 2
Format 3
Level-numbers
BLANK WHEN ZERO clause
DATE FORMAT clause
Semantics of windowed date fields
Restrictions on using date fields
EXTERNAL clause
GLOBAL clause
JUSTIFIED clause
OCCURS clause
Fixed-length tables
ASCENDING KEY and DESCENDING KEY phrases
INDEXED BY phrase
Variable-length tables
OCCURS DEPENDING ON clause
PICTURE clause
Symbols used in the PICTURE clause
Character-string representation
Data categories and PICTURE rules
PICTURE clause editing
Simple insertion editing
Special insertion editing
Fixed insertion editing
Floating insertion editing
Zero suppression and replacement editing
REDEFINES clause
REDEFINES clause considerations
REDEFINES clause examples
Undefined results
RENAMES clause
SIGN clause
SYNCHRONIZED clause
Slack bytes
Slack bytes within records
Slack bytes between records
USAGE clause
Computational items
DISPLAY phrase
DISPLAY-1 phrase
FUNCTION-POINTER phrase
INDEX phrase
NATIONAL phrase
OBJECT REFERENCE phrase
POINTER phrase
PROCEDURE-POINTER phrase
NATIVE phrase
VALUE clause
Format 1
Format 2
Format 3
Procedure division
Procedure division structure
Requirements for a method procedure division
The procedure division header
The USING phrase
Declaratives
Procedures
Arithmetic expressions
Arithmetic operators
Arithmetic with date fields
Conditional expressions
Simple conditions
Class condition
Condition-name condition
Relation condition
Comparison of numeric and alphanumeric operands
Comparison of national operands
Sign condition
Switch-status condition
Complex conditions
Negated simple conditions
Combined conditions
Abbreviated combined relation conditions
Statement categories
Imperative statements
Conditional statements
Delimited scope statements
Explicit scope terminators
Implicit scope terminators
Compiler-directing statements
Statement operations
CORRESPONDING phrase
GIVING phrase
ROUNDED phrase
SIZE ERROR phrases
Arithmetic statements
Arithmetic statement operands
Data manipulation statements
Input-output statements
Common processing facilities
Procedure division statements
ACCEPT statement
ADD statement
ALTER statement
CALL statement
CANCEL statement
CLOSE statement
COMPUTE statement
CONTINUE statement
DELETE statement
DISPLAY statement
DIVIDE statement
ENTRY statement
EVALUATE statement
EXIT statement
EXIT METHOD statement
EXIT PROGRAM statement
GOBACK statement
GO TO statement
IF statement
INITIALIZE statement
INSPECT statement
INVOKE statement
MERGE statement
MOVE statement
MULTIPLY statement
OPEN statement
PERFORM statement
READ statement
RELEASE statement
RETURN statement
REWRITE statement
SEARCH statement
SET statement
SORT statement
START statement
STOP statement
STRING statement
SUBTRACT statement
UNSTRING statement
WRITE statement
XML GENERATE statement
XML PARSE statement
Intrinsic functions
Intrinsic functions
Specifying a function
Function definitions
ACOS
ANNUITY
ASIN
ATAN
CHAR
COS
CURRENT-DATE
DATE-OF-INTEGER
DATE-TO-YYYYMMDD
DATEVAL
DAY-OF-INTEGER
DAY-TO-YYYYDDD
DISPLAY-OF
FACTORIAL
INTEGER
INTEGER-OF-DATE
INTEGER-OF-DAY
INTEGER-PART
LENGTH
LOG
LOG10
LOWER-CASE
MAX
MEAN
MEDIAN
MIDRANGE
MIN
MOD
NATIONAL-OF
NUMVAL
NUMVAL-C
ORD
ORD-MAX
ORD-MIN
PRESENT-VALUE
RANDOM
RANGE
REM
REVERSE
SIN
SQRT
STANDARD-DEVIATION
SUM
TAN
UNDATE
UPPER-CASE
VARIANCE
WHEN-COMPILED
YEAR-TO-YYYY
YEARWINDOW
Compiler-directing statements
Compiler-directing statements
BASIS statement
CBL (PROCESS) statement
*CONTROL (*CBL) statement
COPY statement
DELETE statement
EJECT statement
ENTER statement
INSERT statement
READY or RESET TRACE statement
REPLACE statement
SERVICE LABEL statement
SERVICE RELOAD statement
SKIP statements
TITLE statement
USE statement
Compiler directives
CALLINTERFACE
Appendixes
IBM extensions
Compiler limits
EBCDIC and ASCII collating sequences
EBCDIC collating sequence
US English ASCII code page
Source language debugging
Coding debugging lines
Coding debugging sections
DEBUG-ITEM special register
Activate compile-time switch
Activate object-time switch
Reserved words
Code page names
Locale considerations
Industry specifications
Notices
Programming interface information
Trademarks
Glossary
List of resources
Index
Programming Guide
About this document
How to send your comments
Coding your program
Structuring your program
Identifying a program
Identifying a program as recursive
Marking a program as callable by containing programs
Setting a program to an initial state
Changing the header of a source listing
Describing the computing environment
Example: FILE-CONTROL paragraph
Specifying the collating sequence
Example: specifying the collating sequence
Defining symbolic characters
Defining a user-defined class
Identifying files to the operating system
Varying the input or output file at run time
Example: using different input files
Describing the data
Using data in input and output operations
FILE SECTION entries
Comparison of WORKING-STORAGE and LOCAL-STORAGE
Example: storage sections
Using data from another program
Sharing data in separately compiled programs
Sharing data in nested programs
Sharing data in recursive or multithreaded programs
Processing the data
How logic is divided in the PROCEDURE DIVISION
Imperative statements
Conditional statements
Compiler-directing statements
Scope terminators
Declaratives
Using data
Using variables, structures, literals, and constants
Assigning values to data items
Examples: initializing data items
Initializing a structure (INITIALIZE)
Assigning values to elementary or group data items (MOVE)
Assigning arithmetic results (MOVE or COMPUTE)
Assigning input from a screen or file (ACCEPT)
Displaying values on a screen or in a file (DISPLAY)
Using intrinsic functions (built-in functions)
Using tables (arrays) and pointers
Working with numbers and arithmetic
Defining numeric data
Displaying numeric data
Controlling how numeric data is stored
Formats for numeric data
Examples: numeric data and internal representation
Data format conversions
Conversions and precision
Sign representation and processing
Checking for incompatible data (numeric class test)
Performing arithmetic
COMPUTE and other arithmetic statements
Arithmetic expressions
Numeric intrinsic functions
Examples: numeric intrinsic functions
Fixed-point versus floating-point arithmetic
Examples: fixed-point and floating-point evaluations
Using currency signs
Example: multiple currency signs
Handling tables
Defining a table (OCCURS)
Nesting tables
Referring to an item in a table
Subscripting
Indexing
Putting values into a table
Loading a table dynamically
Initializing a table (INITIALIZE)
Assigning values when you define a table (VALUE)
Example: PERFORM and subscripting
Example: PERFORM and indexing
Creating variable-length tables (DEPENDING ON)
Loading a variable-length table
Assigning values to a variable-length table
Searching a table
Doing a serial search (SEARCH)
Example: serial search
Doing a binary search (SEARCH ALL)
Example: binary search
Processing table items using intrinsic functions
Example: intrinsic functions
Selecting and repeating program actions
Selecting program actions
Coding a choice of actions
Using nested IF statements
Using the EVALUATE statement
Example: EVALUATE using THRU phrase
Example: EVALUATE using multiple WHEN statements
Example: EVALUATE testing several conditions
Coding conditional expressions
Switches and flags
Defining switches and flags
Example: switches
Example: flags
Resetting switches and flags
Example: set switch on
Example: set switch off
Repeating program actions
Choosing inline or out-of-line PERFORM
Example: inline PERFORM statement
Coding a loop
Coding a loop through a table
Executing multiple paragraphs or sections
Handling strings
Joining data items (STRING)
Example: STRING statement
Splitting data items (UNSTRING)
Example: UNSTRING statement
Manipulating null-terminated strings
Example: null-terminated strings
Referring to substrings of data items
Reference modifiers
Example: arithmetic expressions as reference modifiers
Example: intrinsic functions as reference modifiers
Tallying and replacing data items (INSPECT)
Examples: INSPECT statement
Converting data items (intrinsic functions)
Evaluating data items (intrinsic functions)
Evaluating single characters for collating sequence
Finding the largest or smallest data item
Finding the length of data items
Finding the date of compilation
Enabling programs for international environments
Processing character data in an international environment
Unicode and encoding of language characters
Using national data (Unicode) in COBOL
Converting national data
Example: converting national data
Processing UTF-8 data
Processing Chinese GB 18030 data
Comparing national data items
Coding for use of DBCS support
Declaring DBCS data
Specifying DBCS literals
Testing for valid DBCS characters
Processing alphanumeric data items that contain DBCS data
Setting the locale
How locale is determined
Controlling the collating sequence
Locales and code pages supported
Accessing the locale and code-page values in effect
Example: get and convert a code-page ID
Processing files
Identifying files
Identifying VSAM files
Identifying Encina SFS files
Identifying STL files
Identifying RSD files
File system
VSAM file system
SFS file system
STL file system
STL file system return codes
RSD file system
Enabling COBOL applications to access SFS files
Example: accessing SFS files
Improving SFS performance
Protecting against errors when opening files
Specifying a file organization and access mode
File organization and access mode
Sequential file organization
Line-sequential file organization
Indexed file organization
Relative file organization
Sequential access
Random access
Dynamic access
File input-output limitations
Setting up a field for file status
Describing the structure of a file in detail
Coding input and output statements for files
Example: COBOL coding for files
File position indicator
Opening a file
Valid COBOL statements for sequential files
Valid COBOL statements for line-sequential files
Valid COBOL statements for indexed and relative files
Reading records from a file
Statements used when writing records to a file
Adding records to a file
Replacing records in a file
Deleting records from a file
PROCEDURE DIVISION statements used to update files
Sorting and merging files
Sort and merge process
Describing the sort or merge file
Describing the input to sorting or merging
Example: describing sort and input files for SORT
Coding the input procedure
Describing the output from sorting or merging
Coding the output procedure
Restrictions on input and output procedures
Requesting the sort or merge
Choosing alternate collating sequences
Example: sorting with input and output procedures
Determining whether the sort or merge was successful
Sort and merge error numbers
Stopping a sort or merge operation prematurely
Handling errors
Handling errors in joining and splitting strings
Handling errors in arithmetic operations
Example: checking for division by zero
Handling errors in input and output operations
Using the end-of-file condition (AT END)
Coding ERROR declaratives
Using file status keys
Example: file status key
Using file system return codes
Example: checking file system return codes
Coding INVALID KEY phrases
Example: FILE STATUS and INVALID KEY
Handling errors when calling programs
Compiling, linking, running, and debugging your program
Compiling, linking, and running programs
Setting environment variables
Compiler environment variables
Run-time environment variables
TZ environment parameter variables
Example: setting and accessing environment variables
Compiling programs
Compiling from the command line
Examples: using cob2 for compiling
Compiling using shell scripts
Compiling for SFS files
Specifying compiler options with the PROCESS (CBL) statement
Modifying the default compiler configuration
Tailoring a configuration file
Stanzas in the configuration file
Correcting errors in your source program
Severity codes for compiler error messages
Generating a list of compiler error messages
Messages and listings for compiler-detected errors
Format of compiler error messages
cob2, cob2_j, cob2_r, and cob2_r4 options
Linking programs
Passing options to the linker
Examples: using an invocation command for linking
Linker input and output files
Linker search rules
Linker file-name defaults
Correcting errors in linking
Running programs
Redistributing COBOL for AIX library components
Compiling, linking, and running OO applications
Compiling OO applications
Preparing OO applications
Example: compiling and linking a COBOL class definition
Running OO applications
Compiler options
ADATA
ARITH
BINARY
CALLINT
CHAR
COLLSEQ
COMPILE
CURRENCY
DATEPROC
DIAGTRUNC
DYNAM
ENTRYINT
EXIT
FLAG
FLAGSTD
FLOAT
LIB
LINECOUNT
LIST
LSTFILE
MAP
MAXMEM
NCOLLSEQ
NSYMBOL
NUMBER
OPTIMIZE
PGMNAME
PROFILE
QUOTE/APOST
SEPOBJ
SEQUENCE
SIZE
SOSI
SOURCE
SPACE
SPILL
SQL
SSRANGE
TERMINAL
TEST
THREAD
TRUNC