|
A useful trick that was passed onto me for these sorts of things is to use the if/else. The idea is to select all of the records you don't want with the if statement, then immediately have an Else line. It simplifies many filters. For instance, an if statement listing all of the States excepting Oregon could as easily be an if Oregon, Else. I am not sure if that is a relevent solution though. Also, you could have a file as output from the query and then process the new file with your new RPG program. --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 03/11/05 15:07:07 To: rpg400-l@xxxxxxxxxxxx Subject: Convert QUERY record select to RPG We have a query that has the following record select tests: AND/OR Field Test Value SIZE GE cotsz1 AND COTSZ1 GE '0' AND COAT1 NLIKE '%AN%' OR SIZE LE '00014' AND SIZE NLIKE '%X%' AND SIZE NLIKE '%S%' OR SIZE LE SZDIA1 OR COTSZ2 LE COTSZ1 AND COTSZ2 GT '0' AND SIZE NLIKE '%B%' OR UTS GE 820000 OR WGT LE 0 OR UTS LT YTS OR DESC LIKE '%NOMAT%' AND SIZE NLIKE '%BX%' Field def.: Size 15 A Cotsz1 20 A Coat1 3 A Cotsz2 20 A UTS 7.0 D YTS 7.0 D WGT 9.3 D DESC 30 A I have been asked to program this in RPG. My question is can this be done in RPG? One thought that our network person had who does Java. Is to pass the data from the RPG program to Java and let Java do the checking. Then pass a Y (record passed) or N (record did not pass) back the RPG program. I could also write the record out to a database file then call the that the Java program. Can this be done? Any and all ideals and help would be appreciated, William Moore -- This is the RPG programming on the AS400 / iSeries (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 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.