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





Thank you Creg,


I was not aware of this, but there are only 2 logicals with same fields,
and one of them is using Select/Omit without Dynamic Select, so If I
understand well, this could not be my issue...

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




--
All the best,

Richard Reeve


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

Subject: Digest Footer

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
digest 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 http://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

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

End of RPG400-L Digest, Vol 17, Issue 252
*****************************************



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

message: 2
date: Wed, 16 May 2018 10:32:56 +0200
from: "D*B" <dieter.bender@xxxxxxxxxxxx>
subject: Re: One Write, two records....

... STRJRNPF will show to you what's going on

D*B


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

message: 3
date: Wed, 16 May 2018 11:04:32 -0500
from: "T. Adair" <tadair@xxxxxxxxxxxxxxxx>
subject: Embedded SQL message

If I was a betting man, I would've bet money that I've seen this
somewhere in the past.

I have a simple embedded SQL RPG program that deletes records from a
file. Other than edit checking the date, the only thing the program
does is...

___ exec SQL delete from ds_gsl where GSLDLVYMD < :ymd;

It works fine, and the job log shows the message...:
"350104 rows deleted from DS_GSL in DS_DATA."

Now the kicker... I need/want to display this SQL message to the user
either during or after the program runs. Is there a way to access this
SQL message in the RPG program? My hope was to use SQLERM (or SQLERRMC)
but that doesn't help.

This may be a longshot, but something in the back of my mind says this
is do-able.

We're on 7.2.

Thanks in advance.

~TA~



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

message: 4
date: Wed, 16 May 2018 11:23:55 -0500
from: David Gibbs <david@xxxxxxxxxxxx>
subject: Re: Embedded SQL message

On 5/16/2018 11:04 AM, T. Adair wrote:
Now the kicker... I need/want to display this SQL message to the
user either during or after the program runs. Is there a way to
access this SQL message in the RPG program? My hope was to use
SQLERM (or SQLERRMC) but that doesn't help.

I've never tried this myself, but you could get the number of rows
processed using the following...

exec sql
GET DIAGNOSTICS :rowsDeleted = ROW_COUNT ;

It's up to you to send the message.

Alternatively, you could use the value in SQLER3, which contains the
number of rows affected. See https://ibm.co/2IKm8wN for more info.

david



--
David Gibbs
midrange.com

IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding 615 miles (Yes, you read that right) in the American Diabetes
Association's Tour de Cure to raise money for diabetes research, education,
advocacy, and awareness. You can make a tax deductible donation to my ride
by visiting https://lsteml.diabetessucks.net.

See where I get my donations from ... visit https://lsteml.diabetessucks.
net/map for an interactive map (it's a geeky thing).

I may have diabetes, but diabetes doesn't have me!


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

Subject: Digest Footer

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
digest 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 http://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

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

End of RPG400-L Digest, Vol 17, Issue 253
*****************************************


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.