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

query execution in SPUFI and program


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nag
Warnings : 1

New User


Joined: 29 Jul 2005
Posts: 20

PostPosted: Mon May 12, 2008 12:01 pm
Reply with quote

This is the Question that i have faced in my Interview.

There is an SQL query which contains Hardcoded values in the Where clause.
There are no date fields or time fields in the where caluse.
If we execute this query in the Cobol-DB2 program its giving SQLCODE=100 but if
we execute the same Query in SPUFI it is giving the valid records.
What might be the reason behind this?
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: Mon May 12, 2008 12:12 pm
Reply with quote

Hello,

Is it possible that you have mis-quoted the interview questoin?

Something that often gets confused is that SPUFI returns 100 as a normal completion.
Back to top
View user's profile Send private message
nag
Warnings : 1

New User


Joined: 29 Jul 2005
Posts: 20

PostPosted: Mon May 12, 2008 1:44 pm
Reply with quote

dick scherrer wrote:
Hello,

Is it possible that you have mis-quoted the interview questoin?

Something that often gets confused is that SPUFI returns 100 as a normal completion.


No i told him that if the cond in Where clause is not staisfied then it will return NULL in SPUFI. He said no its returning records in SPUFI but not in program.
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Tue May 13, 2008 7:28 am
Reply with quote

the query might be handling NULLS in the program and the resultant rows are having NULLS. in that case, you will get results in SPUFI and not in program.
Back to top
View user's profile Send private message
nag
Warnings : 1

New User


Joined: 29 Jul 2005
Posts: 20

PostPosted: Tue May 13, 2008 12:30 pm
Reply with quote

the_gautam wrote:
the query might be handling NULLS in the program and the resultant rows are having NULLS. in that case, you will get results in SPUFI and not in program.


If we are handling NULLS in the program then we move proper value by checking the NUll Indicator.

He told that we are getting proper records in the SPUFI not NULL.

I think this mite be the reason.

While binding the jcl we will specify the Qualifier and in the SPUFI if we do do specify the same qualifier then it will refer diff database and then i think there are chances of getting data here.I am not sure of that.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 13, 2008 12:43 pm
Reply with quote

Quote:
If we execute this query in the Cobol-DB2 program its giving SQLCODE=100 but if


spufi is getting a 100 sqlcode behind the scenes...

for any programming language used ( as a general point )
when using a cursor to fetch rows the program will keep getting a 0 sqlcode for each row fetched
a 100 sqlcode when there are no more rows to fetch

I guess that there was a communication problem at that table icon_biggrin.gif
on when the 100 sqlcode comes out
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DELETE SPUFI DB2 1
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts RC query -Time column CA Products 3
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
Search our Forums:

Back to Top