next up previous contents index
Next: Common Blocks Up: DATA Statement Previous: DATA Statements in Procedures

General Rules

The general form of the DATA statement is:
DATA nlist / clist /, nlist / clist /, ...
Where nlist is a list of variable names, array names, substring names, and implied-DO lists, and clist is a list of items which may be literal or named constants or either of these preceded by a repeat-count and an asterisk. The repeat-count can also be an unsigned integer constant or named constant.

The comma which precedes each list of names except the first is optional. An implied-DO list has the general form:
( dlist, intvar = start, limit, step )
Where em dlist is a list of implied-DO lists and array elements; intvar is an integer variable called the loop-control variable; start, limit, and step are integer expressions in which all the operands must be integer constants or loop-control variables of outer implied-DO lists.

DATA statements cannot be used to initialise items in the blank common block; items in named common blocks can only be initialised within a BLOCK DATA program unit (see section 12.4).

The DATA statements in each program unit must follow all specification statements but they can be interspersed with executable statements and statement function statements. It is, however, best to follow the usual practice of putting all DATA statements before any of the executable statements.


next up previous contents index
Next: Common Blocks Up: DATA Statement Previous: DATA Statements in Procedures
Helen Rowlands
8/27/1998