View previous topic :: View next topic
|
Author |
Message |
praveena avaluru
New User
Joined: 29 Sep 2010 Posts: 9 Location: bangalore
|
|
|
|
Hi
I have 2 variables
WS-count is declared as a S9(04) Comp-3 and
the value in WS-DUPLICATE is 07%
The table has the following rows
COLUMN1
07
078
0781
I have a query in the cobol program as
EXEC SQL
SELECT COUNT(*)
INTO :WS-COUNT
FROM TABLE
WHERE
COLUMN1 LIKE :WS-DUPLICATE
END-EXEC
The result ( ws-count) is 2 and not 3.
When i run this query in spufi the result is 3
Do i have to take any care while running a Count(*) in cobol ??
Regards
Praveena Avaluru |
|
Back to top |
|
|
nigelosberry
New User
Joined: 06 Jan 2009 Posts: 88 Location: Ggn, IN
|
|
|
|
Did you check the value of WS-DUPLICATE just before the query is executed? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what is the datatype of COLUMN1? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
That's because in spufi you do:
Code: |
WHERE COLUMN1 LIKE '07%' |
and in cobol you do
Code: |
WHERE COLUMN1 LIKE '07% ' |
Note the spaces after the % in cobol (number of spaces according to PIC of WS-DUPLICATE)
0781 does not fit in your WHERE request. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Did you solve your problem, and how? |
|
Back to top |
|
|
|