× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Sorted!


It was a versioning issue... a modified version of PGM A that was in test
environment, had been placed in production for... testing reasons (???...)

So the DB2 integrity still lives!! (Not sure how long the tester will...
lol)

Thank you all!
Costa


message: 1
date: Thu, 17 May 2018 13:35:34 +0100
from: Costa Marks <markscostas@xxxxxxxxx>
subject: Re: RPG400-L Digest, Vol 17, Issue 253

Hi Richard,

Thank you, but it was the first I looked at, as a trigger placed by a
customer in the past had cause a huge.... traffic jam as the tracks
couldn't be loaded!!! lol!

Kind regards,

message: 4
date: Tue, 15 May 2018 08:05:31 -0500
from: Richard Reeve <rjrjr64@xxxxxxxxx>
subject: Re: One Write, two records....

Triggers?

On Tue, May 15, 2018 at 7:45 AM, Craig Richards <craig@xxxxxxxxxxxxxxxx>
wrote:

Costa,

Hard to say without looking at the program and tables, however it
reminds
me of an issue I?ve seen in the past where a program updates a record -
changing a field which is not part of the key list it is reading by,
but
another file sharing the same access path causes the program to pick up
the
same record on its next read. Thus processing it twice.

If not that - is the file open for shared access? Could B occasionally
be
moving the file pointer for A?

On Tue, 15 May 2018 at 13:13, Costa Marks <markscostas@xxxxxxxxx>
wrote:

Hello,

The whole team I work with is facing a weird issue.

Program A loops per order and calls program B, program B is doing
just
a
write to a file (order lines) using the input parms from A.

Occasionally though, program B is writing 2 lines (duplicate) for
some
of
the order lines, not all. By deleting the records and rerunning the
process, no duplicates are written.... So we can not reproduce the
fault.

I added a FEOD in pgm B, but we still get the duplicates once in a
while.

The release is V7R1M0.

Both programs are RPGLE, in DFTACTGRP.

Any hints?

Thank you in advance,
Costa
--
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD




--
All the best,

Richard Reeve





------------------------------

message: 2
date: Thu, 17 May 2018 14:08:04 +0100
from: Costa Marks <markscostas@xxxxxxxxx>
subject: Re: RPG400-L Digest, Vol 17, Issue 253

Hi Joe,

Although it is my strong believe that the simpliest answer is ussually the
correct one, in this case I tend to believe the no 4!!! lol...

1 and 2: In those cases, ALL order lines of a single order would get
duplicate, but in my case only a few of the lines do...
3: There is only one write statement in the B program...
4........
5. No other program is writing to the file.... It's a small independent
module (Track and Trace).

Here is the snippets of the 2 programs:

*PGM A*



D UpdTatDtlRec pr extpgm('UPDTATDTL')

D outParm likeds(TatDtl_Rec)

??

TdIOReq = '*WRITE';

UpdTatDtlRec(TatDtl_Rec:TdErrChk); ---- PGM B



*PGM B*



ErrorCode = *Blanks;

TatDtl_Rec = inParm;



Select;

When TDIOReq = '*WRITE';

* WriteRecord(); *

When TDIOReq = '*UPDATE';

UpdateRecord();

When TDIOReq = '*DELETE';

DeleteRecord();

When TDIOReq = '*REMOVE';

EndSL;

?.

P WriteRecord b

d WriteRecord pi



// Validate Input



If ValidateData(ErrChk) = 'Y';



// Write Record



// TdPrSt = *Blanks;

Write TatDtlR;



EndIf;

P WriteRecord e



message: 3
date: Tue, 15 May 2018 08:05:43 -0500
from: Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx>
subject: Re: One Write, two records....

Hi Costa!? Welcome to the world of intermittent errors.? :)

On these, the first thing to do is to identify the possible causes and
eliminate some of them.

In my mind, here are the possibilities:

1. Program A is getting called twice for the same order
2. Program A is calling program B twice for the same line
3. Program B is being called once but executing WRITE twice
4. Program B is executing WRITE once but the IBM i database is writing
two records
5. Some unknown program C is doing the same WRITE as program B

Someone might come up with more, but those are my choices.? Option 4 is
awfully far-fetched, but I include it for completeness.? Use a journal
if you suspect option 5; it will tell you if some other program or job
is writing to the same file.

Other than that, then, you have options 1, 2 and 3.? Option 1 seems
unlikely since the duplicate is for only certain lines.? So let's check
2 and 3.? The brute force method is pretty simple. Create a file with
program name, order and line number.? Every time program A calls program
B, it writes a record to that file. Every time program B writes a record
to the order file it also writes a record to the work file.

The next time the duplicate occurs, interrogate the file.? Either you'll
see program A calling program B twice with the same order and line, or
you'll see program A calling program B once and program B writing the
record twice.? That will identify which part of the business logic needs
to be debugged more thoroughly.

I know it's pretty basic stuff, but that's what I do.? A lot.? So I've
gotten pretty good at it.? :)



Hello,

The whole team I work with is facing a weird issue.

Program A loops per order and calls program B, program B is doing just
a
write to a file (order lines) using the input parms from A.

Occasionally though, program B is writing 2 lines (duplicate) for some
of
the order lines, not all. By deleting the records and rerunning the
process, no duplicates are written.... So we can not reproduce the
fault.

I added a FEOD in pgm B, but we still get the duplicates once in a
while.

The release is V7R1M0.

Both programs are RPGLE, in DFTACTGRP.

Any hints?

Thank you in advance,
Costa





-



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.