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
 

 

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: 6967
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: 8057
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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