Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
db2 query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: db2 query
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    Post subject:
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    Post subject: Reply to: db2 query
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

Site Director


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

PostPosted: Sat Sep 12, 2009 12:03 am    Post subject:
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    Post subject:
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    Post subject: Reply to: db2 query
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    Post subject:
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    Post subject: Reply to: db2 query
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

Site Director


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

PostPosted: Mon Sep 14, 2009 4:33 am    Post subject:
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    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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us