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



All of these selection types can be accomplished via RPG.  The best
thing to do is diagram out the decision tree on a large peice of
paper.  Then, break down the items into groups.  Ask yourself, what is
the purpose of each item in the decision tree?  How can it be
simplified or consolidated.  Sometimes it makes sense to define a
logical instead of read through every record in the file.

The comparison operators you are looking at in RPG are as follows:

Query      RPG
GE          >=
LE           <=
LIKE        %Scan   (If 0<>%Scan('AN':COAT1);    <--- This will return
true if 'AN' is contained in the COAT1 field)
NLIKE      %Scan (change the 0 to a 1 in the test above)


Hope this helps.


On Fri, 11 Mar 2005 13:02:58 -0800, Willie J. Moore
<WJMoore@xxxxxxxxxxxxxxx> wrote:
> 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.
> 
> 


-- 
"Enter any 11-digit prime number to continue..."

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.