|
Hi,
Just use SQL in RPG:
Exec SQL Set :Flag = Case When :MyFld in ('MS', 'M1', 'M2', ... 'LS')
Then '1'
Else '0'
End;
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Jeff Young
Gesendet: Monday, February 04, 2008 18:05
An: Midrange Systems Technical Discussion
Betreff: Re: SQL Question
Eric,
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.
Thanks,
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
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.