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



Sounds like a perfect candicate for an RPG program and a logical file

Albert

----- Original Message -----
From: "Hohlen, Kent" <Kent.Hohlen@xxxxxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Subject: How To Create On The Fly Sort Field
Date: Tue, 21 Jul 2009 15:21:28 -0500


Hello,

I'm trying to figure out a way to create a sort field that will have
different values based on the value of different fields in each record
retrieved by a SQL statement in a RPG program. For example, if the
record returned has a "P" in the hinge field, I want this record to have
a sort value of 3. Else if the height is greater then 72, then the sort
value should be a 2. Else if the width is greater then 48, then the
sort value should also be a 2. If none of these conditions are true,
then the sort field should have a value of 1. Then I would like to use
the sort field in the ORDER BY clause.

I'm not having any luck figuring out how to create the condition syntax
and getting the sort field to work.

Any help is greatly appreciated.

Thanks,
Kent

--
This is the RPG programming on the IBM i / System i (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.




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.