IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Low values in a array


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mubs55

New User


Joined: 19 Apr 2006
Posts: 12

PostPosted: Mon Nov 06, 2006 2:11 pm
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Mon Nov 06, 2006 2:40 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Nov 06, 2006 2:40 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Nov 06, 2006 5:23 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
Search our Forums:

Back to Top