1,150 pts.
 key list in RPG/400
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

Software/Hardware used:
ASKED: April 27, 2009  8:38 AM
UPDATED: May 6, 2009  1:42 PM

Answer Wiki:
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
Last Wiki Answer Submitted:  April 27, 2009  12:51 pm  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 

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,275 pts.

 

Who said anything about RPG III here. Why would you even use it anymore. There is a free convertion program.

 1,780 pts.

 

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,275 pts.

 

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

 

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,625 pts.