key list in RPG/400

1150 pts.
Tags:
RPG/400
RPG/400 Subfile
Hi, i have a physical file with a composite key of 6 fields. I am writing a single page subfile program in which the program is supplied with two field values from the screen or another program. Now whenever i am chaining using the two fields under the keylist the errors are shown like the key fields too lenghty and key field different etc. How to rectify this problem and retrieve values onto the subfile screen. I am not supposed to use any logicals here...thanks

Answer Wiki

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

Hi,

Your keylist has to match the sequence of key fields in your physical file – you can use the first and second key fields, but you can’t use the first and third for example. The definitions of the fields also have to match.

Regards,

Martin Gilbert.

And you may need to put the missing keys (key2 in Martin’s example) in the subfile record as hidden fields.

Phil

Discuss This Question: 6  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
  • RonKoontz
    Do emmbeded SQL.. Use the fetch function to get records. Then just pass the parms into the SQL statement within your RPG program to create the temp file. I do this all the time instead of logicals. You can sort this data also in your RPG program.
    1,780 pointsBadges:
    report
  • Cwc
    Why are you using RPG III/400 for this? That version of the language is obsolete. RPG IV/ILE is where you should be focusing your effort if you're using RPG.
    4,290 pointsBadges:
    report
  • RonKoontz
    Who said anything about RPG III here. Why would you even use it anymore. There is a free convertion program.
    1,780 pointsBadges:
    report
  • Cwc
    RPG/400, which is essentially RPG III, is the subject of the question in which it was implied this is a new program. My point is that a person learning RPG should not waste their time on an old version.
    4,290 pointsBadges:
    report
  • RonKoontz
    I read it as RPG being the language the programmer is writting the new program in. A general term. Like VB. VB is a language. I also assumed the programmer is writting it using RPG IV. You can not embed SQL in RPG III. I guess I needed to be more clear. Who uses RPG III anymore. There are lots more benedits even if you just convert it. Its more efficient
    1,780 pointsBadges:
    report
  • Gilly400
    Hi, You can embed SQL in RPG/400 (ie not ILE RPG). You do not need to use ILE RPG for SQL. Of course you have much more functionality in ILE. You can use the CRTSQLRPG command to compile RPG/400 with embedded SQL and the CRTSQLRPGI command to create ILE RPG with embedded SQL. All the different terminologies for the different flavours of RPG make this all a bit confusing - I tend to use the following :- RPGII - S/36 and older RPG. RPGIII - S/38 RPG. RPG/400 - AS/400/i-series RPG (not ILE). RPG/IV or ILE/RPG - the new (ILE enabled) one.... Regards, Martin Gilbert.
    23,730 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