AS/400 (language – RPGLE)

Tags:
AS/400
RPGLE
I want to fetch combination of some records from PF file, so how should I do that?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

We use something like this for pulling in a group of orders based on a wildcard portion of the purchase order

C/EXEC SQL                                                           
C+    DECLARE OHBPO CURSOR FOR                                       
C+       SELECT OHORD#, OHBTKY, OHSPO#, OHENTD, OHHOLD, OHFF3, OHSM  
C+       FROM  OH                                                    
C+       WHERE OHHOLD = 'E' AND OHFF3 <> ' '                         
C+       AND OHSPO# LIKE '%' concat Trim(:INPO) concat '%'           
C+          AND OHBTKY = :INCUST                                     
C/END-EXEC                                                           
C/EXEC SQL                                                           
C+    OPEN OHBPO                                                     
C/END-EXEC                                                           

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Splat
    Depends on the combination you want to fetch. You can embed SQL in RPGLE.
    12,895 pointsBadges:
    report
  • ToddN2000
    What are you looking to do with the data retrieved, build a table or data set for some other purpose. Is this code going to be SQL, stored procedure or other method. Post your code and any errors you are getting.
    133,595 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: