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



Joe,
I was mostly looking for a concept that I could use. It was not just for the IN function (table lookup), but for other things that could be done using one statement in SQL vs multiple lines of code in RPG.
The solutions provided by Vern and Rob gave me the answers that I was looking for.

I appreciate all the help and suggestions provided.
This list is *the* place to go to get expert technical help.

Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2
IBM Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3









----- Original Message ----
From: Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Sent: Monday, February 4, 2008 12:25:00 PM
Subject: Re: SQL Question

Jeff Young wrote:
What I am looking for is a method to test conditions in a field I have already read from the file (or screen).
Basically a shortcut method using SQL instead of multiple and/or conditions in an IF statement.
ie: Test field Order_Line_Code for values 'MS', M1',MO','LS' ....
In SQL, I can just list the values to test using the IN condition, but in RPG I would have to test each value separately.
I do not know if this can be done, but figured that if it could, than this list was the place to find out.

%LOOKUP works very well for this. SETLL isn't too bad, either,
especially if the codes can change. If you start hardcoding lists of
values in SQL statements, you're setting yourself up for a maintenance
nightmare down the road.

Joe

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.