Thank you Dan.
No. The job log looks normal.
Yesterday myself and another programmer found a report from the
program showing several SQL 02000 report detail lines and matched
those to the joblog for that time period.
Because these particular jobs are closely scrutinized, they are set to
create the most verbose joblog so we get a lot of 3 to 5 thousand page
logs for each Order Dispatch person daily.
With the date and time from the program report we found six outlets
where the report shows SQL 02000 for an Outlet which did, in fact, have
the combination of OM1 and OM8 data which is required for ASN delivery.
For these six outlets, we have processed some 70 to 90 ASN documents
each since they started on ASN delivery in March - April of this year. Also,
up to today, all "problem" Outlets have been in one Location of the several
currently providing ASN delivery.
This issue has me baffled and confused and I think there is some detail
I've missed. Yesterday I added an additional program step so that when
SQL 02000 is returned, the program does a CHAIN to just the OM8 file
and I will be monitoring that closely today.
The new code, commented with "1616" in the left 6 columns, in production as of about 5pm yesterday:
C/EXEC SQL
C+ SELECT COALESCE(om8.suptyp,' ')
C+ INTO :wk_OutAsnSts
C+ FROM om01 om1
C+ LEFT JOIN om08 om8
C+ ON om8.outnum = om1.outnum
1552 C+ AND om8.suptyp = 'AS'
| C+ AND om8.recsta = '5'
C+ WHERE om1.outnum = :wk_OutNum
C/END-EXEC
*
C SQLCODE IFEQ *ZERO
C If wk_OutAsnSts = 'AS'
C Eval wk_RteAsn = *On
C End
C ELSE
C Eval wk_OutAsnSts = *Blank
1552 C Eval DtlMsg = 'Error: ' + SQLSTATE +
| C ' checking ASN status for Outlet: ' +
| C %Char(wk_OutNum)
| C Except DTL1
1616 * Double Check for OM08 due to nasty Ogden problem
| C Eval wk_SupNum = '02'
| C Eval wk_SupTyp = 'AS'
| C ms_Key Chain ms_Rec OM08
| C If %Found(OM08) And ms_RECSTA = '5'
| C Eval wk_OutAsnSts = ms_SUPTYP
| C Eval wk_RteAsn = *On
| C Eval DtlMsg = 'Fixed: ASN status with CHAIN' +
| C ' for Outlet: ' + %Char(wk_OutNum)
| C Except DTL1
C End
C ENDIF
1616 * Basis Marketing Support File - OM08
| C ms_Key Klist
| C Kfld wk_OutNum
| C Kfld wk_SupTyp
| C Kfld wk_SupNum
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dan
Sent: Wednesday, July 15, 2015 12:54 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Unexpected SQLSTATE returned from embedded SQL
Any SQL0911 messages in the job log?
- Dan
On Wed, Jul 15, 2015 at 1:07 PM, Gary Thompson <gthompson@xxxxxxxxxxx>
wrote:
I have the following SQL that has been working as expected for about 2
years:
SELECT COALESCE(om8.suptyp,' ')
INTO :wk_OutAsnSts
FROM om01 om1
LEFT JOIN om08 om8
ON om8.outnum = om1.outnum
AND om8.suptyp = 'AS'
AND om8.recsta = '5'
WHERE om1.outnum = :wk_OutNum
The query is intended to return the EDI 856 ASN status of the "Sales
Outlet" specified by "wk_OutNum".
This week we received a problem report from one of our seven warehouse
locations that six outlets did not receive the expected ASN pallet
labels and Document.
This happened on Monday and Tuesday of this week at that one location,
but has yet to be reported by any other warehouse location. We send
70-90 ASN documents daily.
All location data is processed by one RPGLE program which has the SQL
shown above.
I reviewed all status reports created by this program yesterday and
found six examples where the program reported SQL State = 02000 (no
rows)for an outlet that >IS< defined.
Late yesterday, we identified this problem in time to repeat the
procedure that runs the query, and then successfully created and
transmitted the required ASN documents.
Repeating the query now also returns the expected "row found" condition.
My question is what, other than an actual "no row" could cause SQL
State =
02000 ?
Because I often see CPU well above 100%, I suspect that some kind of
"time-out" may cause this ?
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.