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

OCCURS exeeding limits issue


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

Active User


Joined: 22 Jul 2005
Posts: 114
Location: Chennai

PostPosted: Tue Aug 16, 2005 5:33 pm
Reply with quote

"Hi,

In an existing production program the working storage table is defined as
follows:
01 UNIT-MEM-TABLE.
05 UNIT-AMENDMENTS OCCURS 12 TIMES.
10 NUM-OF-UNITS PIC S9(04) COMP-3.
10 UNIT-VALUES OCCURS 7 TIMES
INDEXED BY UNIT-INDX.
15 UNIT-ID PIC X(01).
15 UNIT-MEM-VALUES OCCURS 500 TIMES INDEXED BY
MEM-INDX.
20 UNIT-MEM-KEY.
25 UNIT-MEM-AGRE-PA PIC X(02).
25 UNIT-MEM-AGRE-MGR-CODE PIC X(02).
25 UNIT-MEM-AGRE-PROD-ID PIC X(05).
25 UNIT-MEM-UNIT-ID PIC X.

The program reads a file sequentially and populates
UNIT-MEM-VALUES depending upon the number of records for a perticular key.

While population we are not giving any upper limit as
PERFORM UNTIL UNIT-CNTR > 500.

The program currently populates 558 UNIT-MEM-VALUES although the OCCURS
defined in the table are 500.

And while writing an output record it is correctly picking up the values
for the occurences above 500.

Can anybody please explain whether it is possible to have 501th occurence
in a table populated eventhough the OCCURS defined are 500.

Note: I checked using SSRANGE as a compiler option but it is not able to
trap the table overflow condition."

Any clues???????
Back to top
View user's profile Send private message
learner

New User


Joined: 17 Aug 2005
Posts: 4
Location: Chennai

PostPosted: Wed Aug 17, 2005 3:40 pm
Reply with quote

Hi,

I m not sure why SSRANGE compile option didn't trap the error..it shud issue the error code..

Secondly...With out SSRANGE option ...Although we specify a limt for occurs class..say 500 in your case.... referring 501th memory area will use the memory area by calculating the respective displacement..
for ex)

05 chk-occurs pic x(02) occurs 500 times.

by refering/using chk-occurs(501) will refer to the relative memory location of SM + 1002 byte..where SM is the starting memory address for this variable....but if the same memory location is used by some other variable the contents would be modified and it will lead to mess....
ie if SM+1002 byte is allocated to another Working storage variable it content would be altered
Back to top
View user's profile Send private message
Pjoe

New User


Joined: 22 Jul 2005
Posts: 17

PostPosted: Wed Aug 17, 2005 9:29 pm
Reply with quote

Hi All,
SSRANGE generates a code that checks if subscripts or indexes try to reference an area outside the region of the table. Each subscript or index is not individually checked .The effective address is checked to make sure that it does not cause a reference outside the region of the table.
If SSRANGE is in effect at compile time, the range-checking code is
generated. We can inhibit range checking by specifying CHECK(OFF) as a run-time option. This leaves range-checking code dormant in the object code. The range-checking code can then be optionally used to aid in resolving any unexpected errors without recompilation.

It seems the CHECK(OFF) is set as a run-time option in your installtion.It should be CHECK(ON).Also when overflow occurs sometimes it wil clash with other variables memory location leading to unpredeictable behaviours. Recently i had such a problem, where the program became crazy and started looping.

Thanks
PJ
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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Facing ABM3 issue! CICS 3
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top