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 Could we identify the called modules ... elixir1986 COBOL Programming 5 Fri Jul 14, 2017 1:53 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am


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