Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 757
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: 6970
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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us