× 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.



I use trigger program on the file being written to writing out the changed
record before and after image and the program making the change along
with user details program name and timestamp so I can track who and what is happening

Sent from Mail for Windows 10

From: rpg400-l-request@xxxxxxxxxxxx
Sent: 15 May 2018 18:00
To: rpg400-l@xxxxxxxxxxxx
Subject: RPG400-L Digest, Vol 17, Issue 252

Send RPG400-L mailing list submissions to
rpg400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.midrange.com/mailman/listinfo/rpg400-l
or, via email, send a message with subject or body 'help' to
rpg400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
rpg400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of RPG400-L digest..."


*** NOTE: When replying to this digest message, PLEASE remove all text unrelated to your reply and change the subject line so it is meaningful.

Today's Topics:

1. One Write, two records.... (Costa Marks)
2. Re: One Write, two records.... (Craig Richards)
3. Re: One Write, two records.... (Joe Pluta)
4. Re: One Write, two records.... (Richard Reeve)


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

message: 1
date: Tue, 15 May 2018 12:08:32 +0100
from: Costa Marks <markscostas@xxxxxxxxx>
subject: One Write, two records....

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


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

message: 2
date: Tue, 15 May 2018 13:45:18 +0100
from: Craig Richards <craig@xxxxxxxxxxxxxxxx>
subject: Re: One Write, two records....

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



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

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




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

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





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.