Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Low values in a array

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Low values in a array
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: 755
Location: Germany

PostPosted: Mon Nov 06, 2006 2:40 pm    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Mon Nov 06, 2006 2:40 pm    Post subject:
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    Post subject: Re: Low values in a array
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us