View previous topic :: View next topic
|
Author |
Message |
Amsar
New User
Joined: 26 Sep 2008 Posts: 84 Location: Chennai
|
|
|
|
Hi All,
I have array defined as
01 WS-ARRAY1.
05 WS-CACT-ARRAY OCCURS 0 TO 500 TIMES DEPENDING
ON WS-VAR INDEXED BY WS-C1.
10 WS-CACT-NUM PIC S9(9) COMP.
10 WS-CACT-FLAG PIC X(01).
I am Initalizing array as INITIALIZE WS-ARRAY1.
I am getting error while compilation
IGYPS2142-E - WS-ARRAY1" was found in an "INITIALIZE" statement but was variable-length or variably located The operand was discarded from the "INITIALIZE" statement.
Can anybody help me to resolve this issue?
Thanks,
Amsar |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
yes I can help you. the application programmers guide states:
Quote: |
The INITIALIZE statement cannot assign values to a variable-length table (that is, a table that was defined using the OCCURS DEPENDING ON clause). |
you could move low-values to WS-ARRAY1 and treat WS-CACT-FLAG = low-values as valid data - meaning unused.
you could perform varying and
INITIALIZE WS-CACT-NUM(WS-C1) WS-CACT-FLAG(WS-C1).
or, as you increment WS-VAR and the index WS-C1, you could initialize the item then.
that way you do not initialize anything that you don't need to use. |
|
Back to top |
|
|
Amsar
New User
Joined: 26 Sep 2008 Posts: 84 Location: Chennai
|
|
|
|
Hi Dick,
Thanks for your reply.
Quote: |
and treat WS-CACT-FLAG = low-values as valid data - meaning unused. |
i didn't get what you mean by this, but i need to check this flag value ( can be 'Y' or 'N') to do the further processing in the program.
Thanks,
Amsar |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
instead of having a Y or N, have a Y or low-values. |
|
Back to top |
|
|
|