Logical File without Keyfield

25 pts.
Tags:
Logical Files
RPG
If i am using a logical file without key fields in RPG program , it will show any error ?

 

Jayanta

Answer Wiki

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

A logical file is a view over a physical file.
Most times it is created to define a specific access path.
But you could also create one to select only specific fields from the Physical File

————–
Good CharlieBrown, but there is word confusion – an SQL view is somethine very different from a logical file .. it just feels the same. In native mode an RPG program can use a logical file without the ‘K’ in the ‘F’ spec. It can setll on *loval and read records from the file. I don’t think you can have an expectation of the record order when you do that.

Phil

===============================================

Both physical files and logical files can be created without keys or with keys. Both can be accessed by RPG with keys and without keys. A PF or LF that was created with keys can be accessed by RPG without keys — the sequence will simply be “arrival sequence”, the order that the rows appear on physical disk. This is not an error that will be signaled.

A SQL TABLE is implemented as a special case of a PF. A SQL VIEW is implemented as a special case of a LF. Note that although LFs may have keys, a SQL VIEW cannot have a key.

Tom

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.

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
  • Yorkshireman
    The unkeyed logical file can also be accomplishing a file join. thus your program has a 'virtual' record containing data from several files, selected as to field values. It would be 'normal' to control the presentation sequence, though if you need to process all records (having selected the content by the *select on the file, then you may gain performance by omitting the key. 'What is the total value of XYZ - sum all records - no sequence needed. Yes - I can see that working..
    5,580 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