The code for the RPG program and the display DDS can be found at:

http://code.midrange.com/ed51927a1a.html

What seems pretty obvious is that I did make a change which affected
(adversely, as it were) the functioning of the program; it's just that I
can't see it.

I'm going to give my one good eye a rest. Tomorrow my plan is to compile
the original (production) program against the new display format. and then
test that. Then add in the new code piece-by-piece and test each iteration.

I'm sure that, when I or one of you find the bug, it will prove to be
embarrassing. I'm reminded of the time about 40 years ago when I spent > 2
days trying to find a program error. I finally gave up and called in a
colleague. As I'm walking through the code with him, I mumbled something
(quite obscene). I found the bug by explaining the program to him.

Jerry C. Adams
IBM i Programmer/Analyst
--
NMM&D
615-832-2730

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jim Franz
Sent: Wednesday, January 28, 2015 4:20 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Old subfile no longer being processed

not seeing any of the DDS code for how you handled 2 diff sfls (SFLDSP,
SFLDSPCTL, SFLCLR) and overlay keyword ?
Jim

On Wed, Jan 28, 2015 at 5:14 PM, Vinay Gavankar <vinaygav@xxxxxxxxx> wrote:

When is the second subfile being written, before or after the first one?

Are they by any chance using the same field for Subfile Record number?

On Wed, Jan 28, 2015 at 1:37 PM, Gary Thompson <gthompson@xxxxxxxxxxx>
wrote:

So those subfile records are not in range of 1-67 ?

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Jerry Adams
Sent: Wednesday, January 28, 2015 11:33 AM
To: 'RPG programming on the IBM i (AS/400 and iSeries)'
Subject: RE: Old subfile no longer being processed

"Not working" means that the CHAIN to the subfile [%found() ] is not
confirming a hit; i.e., the code that follows it is skipped and goes
straight to the ENDFOR. The FOR loop is processed 67 times (number
of records in the subfile.

Jerry C. Adams
IBM i Programmer/Analyst
--
NMM&D
615-832-2730


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
John
R.
Smith, Jr.
Sent: Wednesday, January 28, 2015 11:35 AM
To: 'RPG programming on the IBM i (AS/400 and iSeries)'
Subject: RE: Old subfile no longer being processed

Any chance you turned on or off an indicator when adding subfile2
that
subfile1 needs? Maybe an indicator was initialized early (*inzsr or
somewhere) and you've change the value with subfile2.

Can you explain further what is "not working"?

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Jerry Adams
Sent: Wednesday, January 28, 2015 12:17 PM
To: 'RPG programming on the IBM i (AS/400 and iSeries)'
Subject: Old subfile no longer being processed

I am really stumped. This week I had to modify a display and
program
that
had a single subfile (#1) by adding another subfile (#2); subfile#2
is displayed and processed first. Running through subfile#2 to see
if a record is selected works fine. However, processing subfile#1
no longer works, though the code for the DDS and the RPG program
have not been changed; just preceded it with the code for subfile #2.




//****************************************************************

// SUBROUTINE - $MAINB
**

// PURPOSE - Process Price List.
**


//****************************************************************



BEGSR $MAINB;



DOW not eoj

AND not cancel;



WRITE MSGSFLB;

IF not #error;

$BuildList();

ELSE;

rrna = rrna_error;

ENDIF;

WRITE DTU020AFK;

EXFMT DTU020ACTL;

EXSR $CMsg;



IF eoj;

LEAVE;

ENDIF;



EXSR $EditA; // Code below

IF #error;

ITER;

ENDIF;



EXSR $PostList;



ENDDO;



ENDSR;



Running debug over the followinjg subroutine shows that

#Limit = 67 (the number of subfile records)

X is incremented by 1 and the FOR is executed 67 times

The CHAIN is *not* finding the subfile (DTU020A) record




//****************************************************************

// SUBROUTINE - $EditA
**

// PURPOSE - Validate the lines on Panel 'A'.
**


//****************************************************************



BEGSR $EditA;



#error = *Off;

#First = *On;

rrna_error = *Zeros;



IF #limit > *Zeros;

FOR x = 1 to #limit;



CHAIN x DTU020A;

IF %found();



(lots of code)



ENDIF;



ENDFOR;



ENDIF;



ENDSR;






As I said I added subfile#2, which uses similar processing (a FOR
loop with a CHAIN to the subfile). The CHAIN finds the subfile
record. The program then proceeds to the "old" code (above).



I have written many programs with multiple subfiles that used the
same methods and worked fine.



RRNA is the name of the subfile record number.



I know that this is going to turn out to be something simple, but I
have been staring at this since early this morning and just cannot
see it. I can post the entire RPG and DDS code, if necessary, to
code.midrange.



FWIW, this is a V5R1 system.



Jerry C. Adams

IBM i Programmer/Analyst

--

NMM&D

615-832-2730



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


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

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

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


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


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

This thread ...

Follow-Ups:
Replies:

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.