Declaring a character array

The precompiler supports complex definitions, which are structures and arrays. You can nest structures, but you cannot have an array of structures.

The precompiler recognizes single-dimensional arrays of all datatypes. The precompiler also recognizes double-dimensional arrays of characters, as demonstrated in the following example:

01 NUMSALES PIC S9(9) OCCURS 25 TIMES.
exec sql begin declare section end-exec. 
 01 DAYS-OF-THE-WEEK PIC X(31) OCCURS 7 TIMES.
 exec sql end declare section end-exec. 

For details on arrays, see “Using arrays”.