Sorry for the delay. My mother was rushed to the ER yesterday and I am just getting back to work.

My intention was not to shame, and I am glad you know that my intentions are good.

John points out that there are things that the cycle is very good at. That is a true statement. However, when I code, I not only think of myself and the problem at hand. I also think of the developer that will come behind me. In my opinion, avoiding the cycle takes the "mystery" out of the code and makes it much easier to maintain, especially to a developer new to RPG.

Buck also points out my favorite advantage to completely removing the cycle. You can define a subprocedure as your mainline. This allows you to scope variables to your mainline code without making them global. This can really help prevent unintended consequences when modifying code.

As for resources to learn by, there are articles and books out there on the subject. You might try:

I have not read this one, but Rafael is a good author. https://www.mc-store.com/products/evolve-your-rpg-coding-move-from-opm-to-ile-and-beyond

Jim Buck and Bryan Meyers have their textbook used to teach RPG at colleges. https://www.mc-store.com/products/programming-in-ile-rpg-fifth-edition


There is also the ILE RPG Programmer's Guide in the IBM Knowledge center. https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzasc/rzascmain.htm


If you have questions on how to get started, please feel free to email me off list.


Brian May
Solutions Architect
Profound Logic Software
http://www.profoundlogic.com
937-439-7925 Phone
877-224-7768 Toll Free



The IBM i Modernization Experts
www.profoundlogic.com
             


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Richard Reeve
Sent: Tuesday, August 09, 2016 8:11 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Re: Successful read not showing any data in debug

Brian,

You raise a valid point and have made me a bit ashamed of myself. I'm one of those old school grumps (well, maybe I'm not a grump) but I'm old school. I need to force myself to look at better ways of doing things.
Can you suggest tutorials or books that will encourage me to become a true FREE/ILE rpg guy?

Thanks for pointing out my flaw. I mean that genuinely. I know that you intentions are good.

Rich

On Mon, Aug 8, 2016 at 11:31 AM, Brian May <bmay@xxxxxxxxxxxxxxxxx> wrote:

Is this new development? Why are you using the cycle?

I know the grumps will come out with their pitchforks to lynch me for
speaking poorly of the glorious cycle, but really why?

Brian May
Solutions Architect
Profound Logic Software
http://www.profoundlogic.com
937-439-7925 Phone
877-224-7768 Toll Free


The IBM i Modernization Experts
www.profoundlogic.com


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Richard Reeve
Sent: Monday, August 8, 2016 11:22 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <
rpg400-l@xxxxxxxxxxxx>
Subject: Re: Successful read not showing any data in debug

Hi Rob,

It is commented out but is defined as a primary file in the F
specs so the cycle should take care if it. Right?

Rich

On Mon, Aug 8, 2016 at 11:19 AM, Robert Rogerson
<rrogerson@xxxxxxxxxxx>
wrote:

Hey Rich,

Isn't the header (EDPOH1L1) read commented out?

Rob



On 8/8/2016 12:14 PM, Richard Reeve wrote:

All,

I'm confused and ashamed to say that I'm having trouble
seeing the problem in this simple program. All I'm doing is
reading a header file
(primary) then if not %eof reading all the associated detail recs
determining/updating the weight of each line and writing the total
weight to the header.

The issue is that while I'm not getting an eof condition on
the header, when I look at any of the header fields on the first
read they are blank.

What am I not seeing? Thanks for any advise/help.

Rich

Here is the pgm

FEDPOH1L1 IP E K DISK PREFIX(H)
FDDMF4101_2IF E K DISK
F**EDPOH1L1 UF E K DISK PREFIX(H)
FEDPOD1L1 UF E K DISK
FDDMF41002 IF E K DISK
DKMMCU S LIKE(UMMCU)
DKMITM S LIKE(UMITM)
DKUMUM S LIKE(UMUM)
DKUMRUM S LIKE(UMRUM)
DTOTALWGT S 10 4 INZ(*ZEROS)
DWGTACCUM S 10 4 INZ(*ZEROS)
DITEMNBR S LIKE(IMLITM)
**FOR REGULAR GRAINGER ONLY
D GRAINGERID C CONST('005103494')

C** READ EDPOH1L1
C** DOW NOT %EOF(EDPOH1L1)
C IF HPARTID = GRAINGERID

C CLEAR WGTACCUM
C POD1KEY SETLL EDPOD1L1
C POD1KEY READE EDPOD1L1
C DOW NOT %EOF(EDPOD1L1)

c eval itemnbr = *blanks
C MOVEl(p) PO109 ITEMNBR
C ITEMNBR CHAIN DDMF4101_2
C IF %FOUND(DDMF4101_2)
C EVAL KMMCU = *BLANKS
C EVAL KMITM = IMITM
C EVAL KUMUM = 'EA'
C EVAL KUMRUM = 'LB'
C K41002 CHAIN DDMF41002
C IF %FOUND(DDMF41002)
C EVAL CUR03B = PO102 * (UMCONV * .00000
C EVAL WGTACCUM = WGTACCUM + CUR03B
C UPDATE F850D1
C END
C END

C POD1KEY READE EDPOD1L1
C ENDDO
C EVAL HCUR03 = WGTACCUM
C** UPDATE F850H1
C CLEAR WGTACCUM
C ENDIF
C** READ EDPOH1L1
C** ENDDO
C** EVAL *INLR = *ON

C* FIRST TIME PROCESSING
C *INZSR BEGSR
C POD1KEY KLIST
C KFLD HPARTID
C KFLD HPONUM
C KFLD HST02
C KFLD HMAILID
C K41002 KLIST
C KFLD KMMCU
C KFLD KMITM
C KFLD KUMUM
C KFLD KUMRUM
C ENDSR


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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

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

Please contact support@xxxxxxxxxxxx for any subscription related questions.

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.