Initializing 2 dimension table



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Initializing 2 dimension table

Postby bravedreamer » Fri May 07, 2010 7:20 pm

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?
bravedreamer
 
Posts: 17
Joined: Wed Nov 11, 2009 6:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Initializing 2 dimension table

Postby CICS Guy » Fri May 07, 2010 7:31 pm

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?
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post