View previous topic :: View next topic
|
Author |
Message |
mubs55
New User
Joined: 19 Apr 2006 Posts: 12
|
|
|
|
Hi,
I have a working storage array defined as below:
01 SAVED-CSH-R-COST-TOTS.
05 SAVED-CSH-R-COST-TOT OCCURS 20 TIMES
PIC S9(9)V99 COMP-3.
Even though the array has been initialized as shown
INITIALIZE SAVED-CSH-R-COST-TOTS.
ADD CSH-R-COST-TOT TO SAVED-CSH-R-COST-TOT (WK-PER)
this abends with S0C7 due to low values with the subscript is 11
SAVED-CSH-R-COST-TOT (WK-PER) display a value 0000 0 0 0 when the subscript is 11.
can anyone please give the resolution for the abend.
Thanks,
mubs55 |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
Seams, that the tab-field is not really decimal packed zero.
In some cases you could not use initialise. This is, if you use FILLER,
INDEXES, or fields with depending-on clause or feileds with rename.
In your case you could use a normal move zeroes.
01 saved-csh-tab.
05 saved-csh-field pic s9(9)V9(2) comp-3 occ 20 indexd by saved-i
move zeroes to saved-csh-tab
Regards, UmeySan |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hey There,
Try after initializing every element of array
PERFORM UNTIL WS-CTR FROM 1 BY 1 UNTIL WS-CTR >20
INITIALIZE SAVED-CSH-R-COST-TOT(WS-CTR)
END-PERFROM. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
01 SAVED-CSH-R-COST-TOTS.
05 SAVED-CSH-R-COST-TOT OCCURS 20 TIMES
PIC S9(9)V99 COMP-3.
Even though the array has been initialized as shown
INITIALIZE SAVED-CSH-R-COST-TOTS. |
after your initialize statement, ALL occurances of SAVED-CSH-R-COST-TOT
contain zero. (packed with sign).
why you have 0000 0 0 0.... keine ahnung. depneds on what else you are doing in your program. also, how did you derive the display?
also, low-values are x'00'. a packed field containing zero, will include a sign as the low-order half byte. |
|
Back to top |
|
|
|