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



Oddly enough chain partially supports %eof.  Seems to me that %eof and
%found were designed to emulate the behavior of the file op indicators
which leads to results that aren't intuitive to everyone.  Here's an
excerpt from the v5r2 RPG Reference:

The following operations, if successful, set %EOF(filename) off. If the
operation is not successful, %EOF(filename) is not changed. %EOF with no
parameter is not changed by these operations.

    * CHAIN (Random Retrieval from a File)
    * OPEN (Open File for Processing)
    * SETGT (Set Greater Than)
    * SETLL (Set Lower Limit)



-----Original Message-----
From: rpg400-l-bounces+jfritz=sharperimage.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+jfritz=sharperimage.com@xxxxxxxxxxxx] On Behalf
Of Paul Morgan
Sent: Tuesday, March 29, 2005 9:20 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Chain doesn't set %EOF

A new %DATA BIF would work but why add a new BIF that isn't really
needed?

The same %EOF vs %FOUND argument could be made about a ReadE.  When I do
a ReadE and it sets on %EOF it's not really at End Of File but at the
end of the read group.  As far as I'm concerned a Chain opcode is really
just a shortcut opcode for a SetLL/ReadE combo.  It should function the
same way.
I'd also mention the %EQUAL BIF set by the SELL opcode isn't set by the
CHAIN opcode.

Paul

--
Paul Morgan
Senior Programmer Analyst - Retail
J. Jill Group
100 Birch Pond Drive, PO Box 2009
Tilton, NH 03276-2009
Phone: (603) 266-2117
Fax:   (603) 266-2333

"Joe Pluta" wrote

> Hi Paul!
>
> The thinking is that you didn't actually hit end of file.  Only a READ

> can hit the end of file; CHAIN can only either find or not find a
> record.  Yeah, it's a pain in the butt because it blows up the
> shortcut that many of us have used for 20 years or so.
>
> I understand the thinking that %EOF and %FOUND are different.  How
> about a new BIF that does what we want?  Like %DATA.  If a CHAIN *or*
> a READ are successful in putting data into the buffer, then %DATA is
> true.  We could then do this:
>
> Chain ( SomeKey ) File;
> DoW %Data( File );
>    // do something
>    ReadE ( SomeKey ) File;
> EndDo;
>
> Joe



--
This is the RPG programming on the AS400 / 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.


*****************************
NOTICE:
All e-mail sent to or from this e-mail address will be received or otherwise 
recorded by
The Sharper Image corporate e-mail system and is subject to archival, 
monitoring,
and review by and/or disclosure to Sharper Image security and other management.
This message is intended only for the use of the addressee and may contain 
information
that is privileged and confidential.

The contents of this message may contain personal views which are not the views 
of The Sharper Image.
If you are not the intended recipient, dissemination of this communication is 
prohibited.
*****************************


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.