× 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've never used *START.
But it seems to me the %EQUAL has no meaning when you are not providing key values to the SETLL op code.



-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Peter Dow
Sent: Thursday, March 16, 2023 5:20 PM
To: rpg400-l <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: SETLL *START and %EQUAL

I have a program that has

 SETLL *START MyFile;
 IF %EQUAL();
       READ MyFile;
 ELSE;
      do something different;
 ENDIF;

In debug, I discovered that it does something different. My first thought was that maybe it's because the file is empty, but it wasn't.

After reading the manual, the closest thing I can see to saying why %EQUAL was *OFF was this:

"You can specify an indicator in positions 75-76 that is set on when a record is present whose key or relative record number is equal to the search argument. This information can also be obtained from the %EQUAL built-in function, which returns '1' if an exact match is found."

I guess there's an argument to be made that *START is not an exact match with whatever is in the first record, but one could also say that the first record is always a match for the first record.

I also noticed that the manual does not say what the effect of () around the search argument is.  My assumption there is that the () define a list of values that are converted to match the related key fields, but the manual does not say that.

Where is this stuff actually stated?

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx
pdow@xxxxxxxxxxxxxx

/
--
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@xxxxxxxxxxxxxxxxxxxx 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.