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



Boy, I wonder if it weren't possible to write and IN() function in RPG. Maybe pass in the variable you are testing and have an array of the values to test, use some way to vary the count, and return an indicator. Woohoo!!!

Vern

Bryce Martin wrote:
Well, I have never programmed cobol. But that is very readable. Now, the PERFORM keyword wouldn't be neccessary.

For the record, I often wishing that I had SQL's IN() in RPGLE and elsewhere.


Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777



"Dennis Lovelady" <iseries@xxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx
03/04/2010 08:53 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
"'RPG programming on the IBM i / System i'" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: AW: More on RPG style






I remember back in college I loved the idea of a "readable" language.
One
where you wouldn't need !=, ||, && and the like. You could just say
things like NOT, EQUAL, AND, XOR, etc. There are some languages that
implement many of these common ones now days. SQL seems to be the
closest
that I've seen actually, and that is only a query language.

I am not trying to sell COBOL to this list (and I know I was taking my life
in my hands when talking about C on a list monitored by Simon [Hi,
Simon!])... but that language comes closest to any that I've seen -
including SQL - to natural language. Of course, look where that has gotten
it - but that aside, I do find merit in reading (but not typing)

IF sales-Amount IS NOT LESS THAN discount-Break-Point PERFORM discounting-routine
ELSE
PERFORM non-discounting-routine
End-if

Here's a COBOL feature that should be in every language:
IF discount-Code is equal to discount1 or discount2 or discount3 or
discount4 ...
(equally valid is "if dis-cod = d1 or d2 or d3 or d4" - it doesn't HAVE
to be wordy)
(Why make me say "is equal to" four times for such a test?) SQL at least
has the (welcomed) IN (list) phrase, which comes close.
I'll shut up now.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"I knew I was an unwanted baby when I saw that my bath toys were a toaster
and a radio."
-- Joan Rivers



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.