Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


Procedure division

Procedure division structure
Requirements for a method procedure division
The procedure division header
The USING phrase
RETURNING phrase
References to items in the linkage section
Declaratives
Procedures
Arithmetic expressions
Arithmetic operators
Arithmetic with date fields
Addition that involves date fields
Subtraction that involves date fields
Storing arithmetic results that involve date fields
Conditional expressions
Simple conditions
Class condition
Condition-name condition
Condition-name conditions and windowed date field comparisons
Relation conditions
General relation conditions
Alphanumeric comparisons
DBCS comparisons
National comparisons
Numeric comparisons
Group comparisons
Comparison of index-names and index data items
Comparison of date fields
Data pointer relation conditions
Procedure-pointer and function-pointer relation conditions
Object-reference relation conditions
Sign condition
Date fields in sign conditions
Switch-status condition
Complex conditions
Negated simple conditions
Combined conditions
Order of evaluation of conditions
Order of evaluation:
Abbreviated combined relation conditions
Using parentheses
Statement categories
Imperative statements
Arithmetic
Data movement
Ending
Input-output
Ordering
Procedure-branching
Program or method linkage
Table-handling
Conditional statements
Arithmetic
Data movement
Decision
Input-output
Ordering
Program or method linkage
Table-handling
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
Size of operands
Overlapping operands
Multiple results
Data manipulation statements
Overlapping operands
Input-output statements
Common processing facilities
File status key
Invalid key condition
INTO and FROM phrases
File position indicator
Procedure division statements
ACCEPT statement
Data transfer
System date-related information transfer
DATE, DATE YYYYMMDD, DAY, DAY YYYYDDD, DAY-OF-WEEK, and TIME
ADD statement
ROUNDED phrase
SIZE ERROR phrases
CORRESPONDING phrase (format 3)
END-ADD phrase
ALTER statement
Segmentation considerations
CALL statement
USING phrase
BY REFERENCE phrase
BY CONTENT phrase
BY VALUE phrase
RETURNING phrase
ON EXCEPTION phrase
NOT ON EXCEPTION phrase
ON OVERFLOW phrase
END-CALL phrase
CANCEL statement
CLOSE statement
Effect of CLOSE statement on file types
COMPUTE statement
ROUNDED phrase
SIZE ERROR phrases
END-COMPUTE phrase
CONTINUE statement
DELETE statement
Sequential access mode
Random or dynamic access mode
END-DELETE phrase
DISPLAY statement
DIVIDE statement
ROUNDED phrase
REMAINDER phrase
SIZE ERROR phrases
END-DIVIDE phrase
ENTRY statement
USING phrase
EVALUATE statement
END-EVALUATE phrase
Determining values
Comparing selection subjects and objects
Executing the EVALUATE statement
EXIT statement
EXIT METHOD statement
EXIT PROGRAM statement
GOBACK statement
GO TO statement
Unconditional GO TO
Conditional GO TO
Altered GO TO
MORE-LABELS GO TO
IF statement
END-IF phrase
Transferring control
Nested IF statements
INITIALIZE statement
REPLACING phrase
INITIALIZE statement rules
INSPECT statement
TALLYING phrase (formats 1 and 3)
REPLACING phrase (formats 2 and 3)
Replacement rules
BEFORE and AFTER phrases (all formats)
CONVERTING phrase (format 4)
Data types for identifiers and literals
Data flow
Comparison cycle
Example of the INSPECT statement
INVOKE statement
USING phrase
BY VALUE phrase
Conformance requirements for arguments
RETURNING phrase
Conformance requirements for the RETURNING item
ON EXCEPTION phrase
NOT ON EXCEPTION phrase
END-INVOKE phrase
Interoperable data types for COBOL and Java
Miscellaneous argument types for COBOL and Java
MERGE statement
ASCENDING/DESCENDING KEY phrase
COLLATING SEQUENCE phrase
USING phrase
GIVING phrase
OUTPUT PROCEDURE phrase
MERGE special registers
Segmentation considerations
MOVE statement
Elementary moves
Elementary move rules
Valid and invalid elementary moves
Moves involving date fields
Moves involving file record areas
Group moves
MULTIPLY statement
ROUNDED phrase
SIZE ERROR phrases
END-MULTIPLY phrase
OPEN statement
General rules
Label records
OPEN statement notes
PERFORM statement
Basic PERFORM statement
END-PERFORM
PERFORM with TIMES phrase
PERFORM with UNTIL phrase
PERFORM with VARYING phrase
Varying identifiers
Varying two identifiers
Varying three identifiers
Varying more than three identifiers
Varying phrase rules
READ statement
KEY IS phrase
AT END phrases
INVALID KEY phrases
END-READ phrase
Multiple record processing
Sequential access mode
Sequential files
Indexed or relative files
Random access mode
Indexed files
Relative files
Dynamic access mode
READ statement notes:
RELEASE statement
RETURN statement
AT END phrases
END-RETURN phrase
REWRITE statement
INVALID KEY phrases
END-REWRITE phrase
Reusing a logical record
Sequential files
Indexed files
Relative files
SEARCH statement
Serial search
Example: multidimensional serial search
VARYING phrase
WHEN phrase (serial search)
Binary search
WHEN phrase (binary search)
Search statement considerations
AT END and WHEN phrases
NEXT SENTENCE
END-SEARCH phrase
SET statement
Format 1: SET for basic table handling
Format 2: SET for adjusting indexes
Format 3: SET for external switches
Format 4: SET for condition-names
Format 5: SET for USAGE IS POINTER data items
Format 6: SET for procedure-pointer and function-pointer data items
Example of COBOL/C interoperability
Format 7: SET for USAGE OBJECT REFERENCE data items
SORT statement
ASCENDING KEY and DESCENDING KEY phrases
DUPLICATES phrase
COLLATING SEQUENCE phrase
USING phrase
INPUT PROCEDURE phrase
GIVING phrase
OUTPUT PROCEDURE phrase
SORT special registers
Segmentation considerations
START statement
KEY phrase
INVALID KEY phrases
END-START phrase
Indexed files
Relative files
STOP statement
STRING statement
ON OVERFLOW phrases
END-STRING phrase
Data flow
SUBTRACT statement
ROUNDED phrase
SIZE ERROR phrases
CORRESPONDING phrase (format 3)
END-SUBTRACT phrase
UNSTRING statement
DELIMITED BY phrase
Delimiter with two or more characters
Two or more delimiters
INTO phrase
POINTER phrase
TALLYING IN phrase
ON OVERFLOW phrases
When an overflow condition occurs
When an overflow condition does not occur
END-UNSTRING phrase
Data flow
Values at the end of execution of the UNSTRING statement
Example of the UNSTRING statement
WRITE statement
ADVANCING phrase
ADVANCING phrase rules
LINAGE-COUNTER rules
END-OF-PAGE phrases
INVALID KEY phrases
END-WRITE phrase
WRITE for sequential files
WRITE for indexed files
WRITE for relative files
XML GENERATE statement
Nested XML GENERATE or XML PARSE statements
Operation of XML GENERATE
Format conversion of elementary data
Trimming of generated XML data
XML element name formation
XML PARSE statement
Nested XML GENERATE or XML PARSE statements
Control flow

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)