× 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 prefer the DOW method.

I was always told, check to enter a loop and check to leave a loop.

ITER! GOTO in wolf's clothing?

Liam.




Liam Henderson | Application Consultant
Getronics
T. +441908992044 | M. +447985875181 | E. Liam.Henderson@xxxxxxxxxxxxx | W. www.getronics.com









Getronics Services UK Limited - Registered in England and Wales with No: 07966594. VAT No: GB 130 6848 20.
Registered Office - Getronics, Holland House, 4 Bury Street, London, EC3A 5AW, UK

The information transmitted is intended only for use by the addressee and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of it, or the taking of any action in reliance upon this information by persons and/or entities other than the intended recipient is prohibited. If you received this in error, please inform the sender and/or addressee immediately and delete the material. Thank you.

Legal disclaimer: http://www.getronics.com/legal/

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of mlazarus
Sent: 12 November 2019 05:31
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: IF NOT %FOUND

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Roger, Don,

I personally like it, since it's concise and doesn't require an additional %EOF() test, but it doesn't lend itself to using the ITER opcode.

-mark

On 11/11/2019 11:25 PM, Don Brown via RPG400-L wrote:
+1



Don Brown


From: "Roger Harman"<roger.harman@xxxxxxxxxxx>
To: "RPG programming on IBM i"<rpg400-l@xxxxxxxxxxxxxxxxxx>
Date: 12/11/2019 02:08 PM
Subject: RE: IF NOT %FOUND
Sent by: "RPG400-L"<rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>



Well, not trying to (re)start the top/middle-tested loop argument, but
I've always preferred this...

setll (field1: field2) file1;
reade (field1: field2) file1;
dow NOT %eof(file1);

if someConditionIsMet;
...doStuff();
endif;

reade (field1: field2) file1;
enddo;


Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power



-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf
Of Joe Pluta
Sent: Monday, November 11, 2019 1:34 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: IF NOT %FOUND

Yes, this is my standard process now as well.

I put a slight tweak on it:

setll (field1: field2) file1r;
dou %eof(file1);

reade (field1: field2) file1r;
if %eof(file1);
leave;
endif;

if someConditionNotMet;
iter;
endif;

...doStuff

enddo;


On 11/11/2019 3:12 PM, Greg Wilburn wrote:

I've always done mine like this

setll (field1: field2) file1r;
dou %eof(file1);
reade (field1: field2) file1r;
if not %eof(file1);
... stuff
endif;
enddo;

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf
Of

SReeves@xxxxxxxxxxxxxxxxxx

Sent: Monday, November 11, 2019 3:13 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: RE: IF NOT %FOUND

Well that explains why it didn't work.

Doesn't explain why no one noticed it in over a decade ;)

Thanks






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

message: 4
date: Mon, 11 Nov 2019 18:55:45 +0000
from: Kevin Bucknum<Kevin@xxxxxxxxxxxxxxxxxxx>
subject: RE: IF NOT %FOUND

%Found isn't set on for a read.


https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzasd/bbfound
.htm#bbfound




End of RPG400-L Digest, Vol 18, Issue 651
*****************************************





--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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: https://amazon.midrange.com

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.