|
------------------------------
message: 8
date: Fri, 17 Aug 2007 13:10:44 -0600
from: "Jim Essinger" <dilbernator@xxxxxxxxx>
subject: Re: SQL Statement failing in COBOL program
Brian,
Thanks for the idea. It would be best to avoid the
decimal conversion. I
have implemented your suggestion. It did not fix the
problem with the
embedded statement, but is a good suggestion.
Jim
On 8/17/07, Brian Johnson <brian.johnson.mn@xxxxxxxxx>
wrote:
value that cannot
I agree with Wilt; the error seems to indicate data
be converted to decimal. Why you don't get the errorin STRSQL is
unexplained, though.conversion with
You could avoid the always dangerous char-to-decimal
something like:'')
WHERE BORR_SSN = replace(replace(BRQDVA, ',', ''), '.',
It fails on the
On 8/17/07, Jim Essinger <dilbernator@xxxxxxxxx> wrote:
Charles,
Thanks for the reply. The job log tells me nothing.
between 20 and 500first fetch. The result is a small set, usually
all the records inrecords depending on the day. I have paged through
you've got a datathe STRSQL execution of the statement.
Jim
On 8/17/07, Wilt, Charles <WiltC@xxxxxxxxxx> wrote:
Jim,
The system's telling you the problem. I'm guessing
recordjob log that tells
somewhere with a bad
value in BRQDVA. Look for a prior message in the
youlast record you got
which record.
Or add some code in your program to tell you the
record yet, unlesssuccessfully.
STRSQL may be working because it hadn't hit the bad
Behalf Of Jim Essingeryou've paged through all the
records.
HTH,
Charles
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On
responsesSent: Friday, August 17, 2007 12:29 AM
To: Midrange Systems Technical Discussion
Subject: SQL Statement failing in COBOL program
I asked this in the WDSc list, but none of the
statement;helped me find the problem. I have the following
on BrBSS = LNBSS
Exec SQL
Declare LTRC1 cursor for
with t1 as (Select distinct lnbss, lnbond
from slsfiles/sllnrep
WHERE lnlsts < "P90" )
select
Distinct ZIP_CODE,
PLUS_FOUR,
CAR_RTE_CD,
CAR_RTE_CD,
PLUS_SIX,
PAGE_INFO,
ADDR_LINE1,
ADDR_LINE2,
ADDR_LINE3,
ADDR_LINE4,
BORR_NAME,
BORR_SSN,
RTN_CODES,
LNBOND
from BCTEST/BCSRREP,
SLSFILES/SLBRREP Join T1
Dec(BRQDVA *100,9,0)WHERE Dec(BORR_SSN,9,0) =
the recordsOrder by LnBond, Zip_Code
END-EXEC
The select statement works in STRSQL and selects
the openI want to process. When I run it in the program,
fetch gets me acursor statement completes normally, but the
FLOAT, or INTEGERSQLSTATE of 22018 with a SQLCODE of -420.
The code book says;
"The character value for the CAST, DECIMAL,
which is ascalar function is invalid."
Every column selected is alpha except the LNBOND
receivingpacked decimal 3 long in the file. I have the
Decimal 3field for the LNBOND field set as a Signed Packed
inlong. BRQDVA in the "WHERE" clause is a number
account9,999,999.99 format, and so to compare with the
have to movenumber (not really SSN, but was at one time) I
BORR_SSN isdecimal to the right like 999,999,999. The
but theactually a number, just stored as character.
This statement happens to be in ILE COBOL SQL,
Also I knowquestion is more SQL based then program based.
constantthat in this example, taken from the program the
not single as'P90' has double quotes, required by COBOL, and
required by STRSQL.
I'm not sure what I am being told by the message.
Any thoughts/Help?
Thanks!
Jim
--
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.