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
 
data exception error.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: data exception error.
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Tue Sep 02, 2008 12:26 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Tue Sep 02, 2008 12:54 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Sep 02, 2008 7:51 pm    Post subject:
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: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 02, 2008 7:54 pm    Post subject:
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    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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm

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