View previous topic :: View next topic
|
Author |
Message |
shakti
New User
Joined: 20 Jan 2004 Posts: 42
|
|
|
|
Hi,
I am facing issue with this batch query.
SELECT COUNT(col1), SUM(col2)
FROM table1
WHERE col3 = 'abc';
The output of the above query is written to the output file with wrong count and sum.
We submit this query through IKJEFT01.
Any idea what is wrong in this queru why I am not able to get the right valules.
Same query works fine with SPUFI.
Thanks much in advance. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Which program are you executing using IKJEFT01? DSNTEP2 or DSNTIAUL? What values you are getting in the output? What are your expected values? Please provide some more details. |
|
Back to top |
|
|
shakti
New User
Joined: 20 Jan 2004 Posts: 42
|
|
|
|
Hi We use DSNTIAUL and the expected result should be 5 and 50.55 respectively..Butr in the output dataset shows som hex value with in correct data.
Thanks |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
as usual, we only see what the TS deems relevent -
which is sorta silly since the TS does not know the answer to his question -
how could he know what we need to know.
anyway,
the query as you have given will not work in spufi, because you have not qualified the table, thus the query is against the TS's userid/qualifier.
in batch, the run command will associate the proper qualifier.
shakti,
since we don't know what the query is, we can not provide an answer.
suggest that you provide the exact query (cut & paste) that you use in SPUFI
and the exact query that you run in the TMP as well as the RUN command. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Any idea what is wrong in this queru why I am not able to get the right valules. |
Quote: |
Butr in the output dataset shows som hex value with in correct data.
|
nothing wrong from the db2 side...
the only wrong is in Your understanding of the different functionality of different db2 utilities
before whining do a bit more of manual reading
for example differences in behavior and output of...
SPUFI, DSNTEP., DSNTIAUL |
|
Back to top |
|
|
Succor
New User
Joined: 20 Feb 2009 Posts: 96 Location: Bangalore :)
|
|
|
|
Quote: |
Same query works fine with SPUFI. |
Its about the representaion of data which makes you believe that the query works in SPUFI and not with DSNTIAUL(or else you are poiting to different DB2 region/Creator for the two runs).
Quote: |
shows som hex value with in correct data. |
How did you reach to this conclusion,what is the HEX value present over there ?did you try viewing the data set against a cobol copybook with DB2 equivalent Cobol data type representation?Few points to remember:
The COUNT function returns an integer number
The SUM of SMALLINT values returns an INTEGER result
The SUM of single precision floating point(REAL) values returns a double precision floating-point (DOUBLE or FLOAT)result. |
|
Back to top |
|
|
|