Page 1 of 1

Initializing 2 dimension table

PostPosted: Fri May 07, 2010 7:20 pm
by bravedreamer
Hi there!

I would like to know, how to initialize a two dimensional table in COBOL. STATICALLY! Clearly, I could initialize it in a seperate section and fill the table with my prefferred values. But in fact, that the table should contain only error messages (those can not be changed with the program), it would be nice to do it somehow statically.

Is there a way in COBOL to do that? My first choice would be to initialize it through the 'VALUE' clause. But I don't know if that is the correct way of doing it.

What do you think about?

Re: Initializing 2 dimension table

PostPosted: Fri May 07, 2010 7:31 pm
by CICS Guy
This would initialize a one dimensional array:
01 ONE-DATA.
  03 FILLER PIC X(10) VALUE 'ERROR 1'.
  03 FILLER PIC X(10) VALUE 'ERROR 2'.
  03 FILLER PIC X(10) VALUE 'ERROR 3'.
  03 FILLER PIC X(10) VALUE 'ERROR 4'.
01 FILLER REDEFINES
   ONE-DATA.
  03 ERROR-TEXT PIC X(10) OCCURS 4 TIMES.

What does your two dimensional table look like?