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

data exception error.


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

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Tue Sep 02, 2008 11:27 am
Reply with quote

Hai,
Please help me with fillowing piece of code.. when WS-LEDGER-STORE-NO = STORE-NUM(T-INDEX) condition satisfies, it works well. but if they both dont match then S0C7 abend is thrown.Should we manually increment the index in this regard?or does it get auto incremented?

3000-MATCH-STORE-NOS.

IF NOT EOF-LEDGER-FILE-SW
IF WS-TRX-CODE = '999'
SET T-INDEX TO 1
SEARCH STORE-ITEMS
AT END
CONTINUE
WHEN WS-LEDGER-STORE-NO = STORE-NUM(T-INDEX)
PERFORM 4000-WRITE-INTO-OUTPUT THRU 4000-EXIT
END-SEARCH
END-IF
PERFORM 2200-READSTK-LEDGER-FILE THRU 2200-EXIT
END-IF.

3000-EXIT.
EXIT.
Back to top
View user's profile Send private message
birdy K

New User


Joined: 05 Mar 2008
Posts: 72
Location: chennai

PostPosted: Tue Sep 02, 2008 11:56 am
Reply with quote

Hai

I think if they dont match, the control is going some where and you are getting that abend. Try to xpedit and find. Please correct me if I am wrong.
Back to top
View user's profile Send private message
anand tr

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Tue Sep 02, 2008 12:08 pm
Reply with quote

yeah.. tat might b the case.. do we have any option to search to handle a situation if the condition is not met?.
and the table index is not getting incremented.
shud we do it manually?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Sep 02, 2008 12:26 pm
Reply with quote

Hi,

DISPLAY the values of WS-TRX-CODE, WS-LEDGER-STORE-NO & STORE-NUM(T-INDEX) & check what do they contain at the time of abend.

BTW, what other values can WS-TRX-CODE take ? What happens to the program for those other values, where the control goes ? Does that/those controls also CALL 4000-WRITE-INTO-OUTPUT THRU 4000-EXIT ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Sep 02, 2008 12:54 pm
Reply with quote

Code:

IF NOT EOF-LEDGER-FILE-SW
   IF WS-TRX-CODE = '999'
       SET T-INDEX TO 1
       SEARCH STORE-ITEMS
           AT END
              CONTINUE
           WHEN WS-LEDGER-STORE-NO = STORE-NUM(T-INDEX)
               PERFORM 4000-WRITE-INTO-OUTPUT THRU 4000-EXIT
       END-SEARCH
   END-IF
   PERFORM 2200-READSTK-LEDGER-FILE THRU 2200-EXIT
END-IF.



where are you getting your data exception error?

and show us the working-storage defining STORE-ITEMS
Back to top
View user's profile Send private message
anand tr

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Tue Sep 02, 2008 12:55 pm
Reply with quote

ws-trx-code can take other values like 800,821 etc.. but i want it into a file only when it is 999. other conditions nothing is to be done.
well when we use SEARCH, how to handle whenthe condition is not met?
Back to top
View user's profile Send private message
anand tr

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Tue Sep 02, 2008 1:00 pm
Reply with quote

WHEN WS-LEDGER-STORE-NO = STORE-NUM(T-INDEX) - 4000- is performed.
but when WS-LEDGER-STORE-NO is not equal to STORE-NUM(T-INDEX)
then soc7 is encountered.
so how to handle the above condition inside a search?


01 STORE-TABLE.
05 STORE-ITEMS OCCURS 1 TO 999 TIMES
DEPENDING ON REC-COUNT INDEXED BY T-INDEX.
10 STORE-NUM PIC 9(3).
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 02, 2008 7:51 pm
Reply with quote

Hello,

Quote:
do we have any option to search to handle a situation if the condition is not met?.
It may help if you initialize all of the numeric fields before you begin the search. It sounds like you are trying to use an uninitialized numeric field.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 02, 2008 7:54 pm
Reply with quote

It's not all that hard to analyze a S0C7 abend to determine which line of code is generating it -- that will tell you a lot about what is causing the abend. S0C7 could be only incidentally related to your SEARCH; you need to start by analyzing the S0C7, not worrying about the SEARCH statement.
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 Store the data for fixed length COBOL Programming 1
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top