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



Hi David.

It's better and much more flexible using SQL for this task.

I know starting with dynamic SQL constructing the SQL with Select, Order By etc.
and implementing the processing of Declare, Open, Fetch etc. can be a challenge,
but done once I believe you would never go back using various SETLL, READE processing.

Brgds
Helge


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: Thursday, February 24, 2011 1:01 PM
To: RPG programming on the IBM i / System i
Subject: READE on a file selected by user

Hi,

I'm sure someone must have already run into this problem :

User types in search criteria.

Program performs
SETLL searchFile
DOU %eof (searchFile)
READE(searchFile)

etc etc and loads a subfile with the results.


A new search field is added and a different searchFile must be used, depending upon the search criteria used by the user.

So I could do

if searchType1
SETLL searchFile1
else
SETLL searchFile2

etc,

Very messy modified code!

I could copy and paste the original code and execute one or the other ( lots of duplicate code)
I could use an SQL cursor. In this case I would have a lot more modifications to make.

Any tips would be greatly appreciated.

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.