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
 

 

How to identify End of table or Record not found

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
manjuv26

New User


Joined: 19 Feb 2007
Posts: 9
Location: usa

PostPosted: Thu Feb 22, 2007 4:31 am    Post subject: How to identify End of table or Record not found
Reply with quote

Hi
How to identify whether we have reached end of table or record not found when the sql return code is +100. can any one help me.

Thanks
Manju
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Feb 22, 2007 5:08 am    Post subject: Re: How to identify End of table or Record not found
Reply with quote

manjuv26 wrote:
How to identify whether we have reached end of table or record not found when the sql return code is +100.
The return code says just that. Selecting on a cursor, +100 is EOF on the pseudo file, Fetching, the same thing.
EOF is EOF, whether or not it is end of table or no (additional) record found is moot.
Does this have a concern for you?
Back to top
View user's profile Send private message
manjuv26

New User


Joined: 19 Feb 2007
Posts: 9
Location: usa

PostPosted: Thu Feb 22, 2007 10:35 am    Post subject: Re: How to identify End of table or Record not found
Reply with quote

Hi
Thanks for ur reply.But it is not clear for me. Actually this question asked in the interview. I need some more details information to identify whether it is a end of file or record not found.
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Thu Feb 22, 2007 10:53 am    Post subject: Re: How to identify End of table or Record not found
Reply with quote

As William has already said, they are logically same. You don't find a record when you reached the end of the table while searching. There is no way you can not-find-the-record without reaching the end of the table or your cursor set.

So how do you differentiate them? And what you mean by file?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Thu Feb 22, 2007 9:10 pm    Post subject:
Reply with quote

Hi !

As wrote before:

If this is a FETCH statement, no more rows satisfy the selection values.
If this is an embedded SELECT statement, no rows satisfy the selection values.

That implies "End-of-File"

There is no special EOF-Indicator !!!

Regards, UmeySan
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: Thu Feb 22, 2007 11:48 pm    Post subject:
Reply with quote

Hello,

Keeping in mind that different code may be needed to deal with "No Record Found" versus "No more Records Found.

If there are "some" and then the last is processed, this is not the same as not finding "any" at all in many business situations.

It is one thing to have processed all of a customers orders - it is another if the customer has no orders or does not exist. . . .
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Fri Feb 23, 2007 5:36 pm    Post subject:
Reply with quote

Hi Dick !

I agree to your detailed handling on SQL-100.
It's individual and depends on internal logic.

Regards & nice Weekend
UmeySan
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am


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