Creating a Logical File

20 pts.
Tags:
as-400 rpgle
AS/400
I have a class in ILE RPG. My current task is to create a logical file(or an SQL index) sorted by a specific field(SNAME). The file provided is a *file.pf-dta and it has a member inside of which holds data. How would I go across creating a logical file and keying it by SNAME? This is the only file provided.


Software/Hardware used:
I am using RDi (Rational Developer for I) to do this task.
1

Answer Wiki

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

Depends on the use of the LF as to which way I would go. IF creating the DDS it’s like 2 lines on code/definition. the R definition for the record format name as well as the PFILE definition . Second is the K definition for the key field name.  You can get fancy by specifying ascending/descending  or adding a few S definition for special conditions like including or omitting records from the file.

Discuss This Question: 1  Reply

 
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.
  • TheRealRaven
    For a native LF, you do it by entering the DDS source for the LF into a source file member, then compiling it with the CRTLF command. For a SQL INDEX, you execute a CREATE INDEX statement. The details of either are up to you.
    34,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.

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

Following

Share this item with your network: