FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-24
DATA Statement
Example
In the following example, the PRINT statement executes when J is greater than 10:
sum = 0
DO 100 j = 1, 10
sum = sum + 1
100 CONTINUE
PRINT *, sum
DATA Statement
The DATA statement assigns initial values to variables, arrays, array elements, and 
substrings at compile time.
list
is a list of entities separated by commas. An entity can be a variable name, array 
name, array element name, substring name, or an implied DO list.
data
is:
value [, value ]...
value
is:
datum
is a constant or symbolic constant. You can use Hollerith constants to specify 
datum.
count
is an unsigned, non-zero, integer constant or symbolic name specifying a 
repeat count for datum. For additional information, see Appendix C, 
Converting Programs to HP FORTRAN.
DATA list / data / [ [,] list / data / ]...
datum
count*datum










