Introduction IB Statements File System Compiler Applications Reference Guide Index

Language Structure Data Division I/O Format Division Procedure Division Mnemonics

Overview Statement Summary Common Parameters Exception Handling

Procedure Division Overview

The Procedure Division of an IB program is the place where the executable logic steps are written. This program section includes statements to input and output data, control data files and devices such as printers and terminals, assign values to data variables, establish program loops, test logical and relational conditions, etc.

See Statement Summary.

The general syntax of statements in the Procedure Division is:

  statement-label KEYWORD parameters
The statement-label may be used to define statements in this part of the program that are used as branch-to points, such as subroutines, exception routines, beginning of program sections, etc. Statement-labels are not required on every statement in this section, just those that will be used as branch-to points.

Statement-labels may be numeric or alphanumeric. Numeric labels may be one to four digits long, while alphanumeric labels may be up to 32 characters long. Alphanumeric labels, when defined, are followed by a colon (:), but the colon is not used when the statement-label is referred to from another part of the program.

The KEYWORD refers to the IB statement being used (e.g., PRINT, INPUT, IF, CLOSE, RUN, GOTO), and parameters refers to the items that typically accompany and IB keyword (e.g., data values, statement labels, format labels, program names).

Example:

1000  PRINT (0,100)
      INPUT (0) CUSTNUM$
      IF CUSTNUM$ = "" THEN CLOSE (1) & RUN "QMONITOR"
      .
      .
      .
      GOTO 1000
Here, the statement label 1000 is used to identify the beginning of a loop section in the program.