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

db2 query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bnveena

New User


Joined: 29 May 2007
Posts: 50
Location: hyderabad

PostPosted: Fri Sep 11, 2009 9:39 pm
Reply with quote

Hi i have a select query which goes like this...

SELECT ICN,SCCF_NUMBER,PLAN_RECEIPT_DATE,DATE_PAID,
INPUT_MEDIUM,FIN_CYCLE_DT,CHECK_NUMBER,
DISPOSITION_CODE,MONTH,
FROM DSNV.DWS_ITS_CLAIMS_H
WHERE PLAN_RECEIPT_DATE >= '2001-01-01' AND
HOME_HOST_IND = 'HOST'
ORDER BY ICN
WITH UR;

when i ran this i got some records.... the same query i with same fields i have retrieved thru focus program for the same table i got some records.......

when i saw the nubmber of records the records retrieved are same.

i wanted to check whther the fields are also same till ICN and SCCF_NUMBER i tried to compare the files in file aid .. i got differences.....

Differece was the order for SCCF_NUMBER where there are duplicate values the order is different for focus and the retrieval from IKJEFT01 Tool. when i checked for that particular ICN number in QMF the order was same as focus....

i am not able to decide what is wrong with the retrieval by using IKJEFT01 tool

can any one suggest me ....
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Sep 11, 2009 10:07 pm
Reply with quote

Post your FOCUS command ?
Back to top
View user's profile Send private message
bnveena

New User


Joined: 29 May 2007
Posts: 50
Location: hyderabad

PostPosted: Fri Sep 11, 2009 11:05 pm
Reply with quote

SUM SCCF_NUMBER
FST.PLAN_RECEIVED_DT
LST.PAID_DATE
FST.FIN_CYCLE_DT
CHECK_NUMBER
DISPOSITION_CODE
MONTH

WHERE PLAN_RECEIPT_DT GE '2001-01-01'
WHERE HOME_HOST_IND EQ 'HOST'
BY ICN

its like this.....here fst lst concept i am not including in the select query .... i am doing in sort...... but with out adding first last in focus data and retrieving the data using the IKJEFT tool i am getting difference only for the duplicate data...

:-(
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: Sat Sep 12, 2009 12:03 am
Reply with quote

Hello,

Might a SUM and a SELECT return different results. . .?

Quote:
i am not able to decide what is wrong with the retrieval by using IKJEFT01 tool
Why do you believe there is anything wrong with this execution?

I do not recall a case where a query returned invalid results when executed via IKJEFT01 (which is only tso (the terminal monitor program) in batch).
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sat Sep 12, 2009 2:38 am
Reply with quote

Please try to pick a more meaningful Topic in the future. It helps when people are searching.
Back to top
View user's profile Send private message
bnveena

New User


Joined: 29 May 2007
Posts: 50
Location: hyderabad

PostPosted: Sat Sep 12, 2009 6:24 am
Reply with quote

For comparing my data with focus and cobol i have removed sum and replaced print and also the fst and lst in focus.... i compared my data with focus retrieval and cobol retrieval in file aid for particular length i m getting differences....


I dont think my topic is not meaningful....
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sat Sep 12, 2009 6:52 am
Reply with quote

How about "IKJEFT01 and Focus yield different results"? Having the word Focus in the topic would have been more meaningful than "db2 query".
Back to top
View user's profile Send private message
bnveena

New User


Joined: 29 May 2007
Posts: 50
Location: hyderabad

PostPosted: Sat Sep 12, 2009 6:58 am
Reply with quote

It was a problem with IFJEFT01 so i kept like that...i checked with order of retrieval from QMF and IKJEFT... when there are duplicates the order is changing....using IKJEFT
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 Sep 14, 2009 4:33 am
Reply with quote

Hello,

Is the issue now that qmf and ikjeft01 give different results?

It is quite likely that the order of the retrieved rows is different because there are duplicates in the data and the system was not told how to order these duplicates. If you only ORDER BY ic, the sequence of the duplicates is unpredictable.

Has FOCUS gone away as part of the question?

Quote:
I dont think my topic is not meaningful....
Yes, unfortunately it is quite unmeaningful to the forum as nearly every topic posted in this part of the forum is some kind of "db2 query". . .
Quote:
It was a problem with IFJEFT01 so i kept like that...i checked with order of retrieval from QMF and IKJEFT
If the queries are presented to the system with the same lack of attention to detail as this last reply, there might be one or more typo's causing the differences in addition to the lack of qualification of the ORDER BY. . .
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top