JFILE and OPNQRYF

2430 pts.
Tags:
JFILE
OPNQRY
RPGLE - subfile
Hi !

I have two PF's named A and B,
A is having EMPID,EMPNAM,EMPADDR,etc, here EMPID is the Key field.
B is having STKID,STKYR,STKSR,EMPCOD,STKDET,etc, here STKID and STKYR are key fields but not unique, STKSR is unique for a STKID.

Now i wanted to display the list of all EMPID and details(if EMPID, exist in B) of a given STKID.

How can i create a LF and i need to use OPNQRYF to pass the values to a subfile.


Surey.



Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta

    From what you showed and explained, you can't join those files in a meaningful way. You need to explain what the EMPCOD field contains, since it seems to be the only likely join field. If it actually holds a EMPID value, then it's reasonable to use it as a join field. (If it's a EMPID value, then it's named badly.)

    It's almost certainly not a good idea to create a basic JOIN LF and use OPNQRYF, though. A simple SQL SELECT statement seems to be all that's needed.

    Tom

    125,585 pointsBadges:
    report
  • Sureyz
    Yes Tom,

    EMPCOD is holding the value of EMPID. That is what i was thinking to go for SQLRPGLE subfile program. Because I'm not a lazy programmer. But lack of knowledge in subfile programming in SQLRPGLE.

    Can you give a small idea how can i implement this in SQLRPGLE subfile.

    Surey.
    2,430 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following