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
 

 

query execution in SPUFI and program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: query execution in SPUFI and program
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

Site Director


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

PostPosted: Mon May 12, 2008 12:12 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Tue May 13, 2008 12:43 pm    Post subject: Reply to: query execution in SPUFI and program
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm


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