|
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jim Essinger
Sent: Friday, August 17, 2007 10:52 AM
To: Midrange Systems Technical Discussion
Subject: Re: SQL Statement failing in COBOL program
Charles,
Thanks for the reply. The job log tells me nothing. It fails
on the first fetch. The result is a small set, usually
between 20 and 500 records depending on the day. I have paged
through all the records in the STRSQL execution of the statement.
Jim
On 8/17/07, Wilt, Charles <WiltC@xxxxxxxxxx> wrote:
Jim,got a data
The system's telling you the problem. I'm guessing you've
record somewhere with a bad value in BRQDVA. Look for aprior message
in the job log that tells you which record.record you got
Or add some code in your program to tell you the last
successfully.yet, unless
STRSQL may be working because it hadn't hit the bad record
you've paged through all the records.helped me
HTH,
Charles
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jim Essinger
Sent: 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 responses
records I wantfind the problem. I have the following statement;
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 on BrBSS = LNBSS
WHERE Dec(BORR_SSN,9,0) = Dec(BRQDVA *100,9,0)
Order by LnBond, Zip_Code
END-EXEC
The select statement works in STRSQL and selects the
cursor statementto process. When I run it in the program, the open
22018 with acompletes normally, but the fetch gets me a SQLSTATE of
INTEGER scalarSQLCODE of -420.
The code book says;
"The character value for the CAST, DECIMAL, FLOAT, or
a packedfunction is invalid."
Every column selected is alpha except the LNBOND which is
BRQDVA in thedecimal 3 long in the file. I have the receiving field for the
LNBOND field set as a Signed Packed Decimal 3 long.
number (not"WHERE" clause is a number in
9,999,999.99 format, and so to compare with the account
to the rightreally SSN, but was at one time) I have to move decimal
stored aslike 999,999,999. The BORR_SSN is actually a number, just
question ischaracter.
This statement happens to be in ILE COBOL SQL, but the
intended to bemore SQL based then program based. Also I know that in this
example, taken from the program the constant 'P90' has double
quotes, required by COBOL, and not single as required by STRSQL.
I'm not sure what I am being told by the message.
Any thoughts/Help?
Thanks!
Jim
--
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.
This e-mail transmission contains information that is
confidential and privileged. If you receive this e-mailand you are
not a named addressee you are hereby notified that you are notdoing so is
authorized to read, print, retain, copy or disseminate this
communication without the consent of the sender and that
prohibited and may be unlawful. Please reply to the messagemisdirected.
immediately by informing the sender that the message was
After replying, please delete and otherwise erase it and anycorrecting this error is appreciated.
attachments from your computer system. Your assistance in
(MIDRANGE-L) mailing
--
This is the Midrange Systems Technical Discussion
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,please take
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
a moment to review the archives at--
http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.