What is the difference between a Physical File & a Logical?

Answer Posted / godwin sf

Physical files hold the actual data of a database file. The data is written in arrival sequence.
Physical files are not required to have keyed fields. If a physical file has key fields, this is the order that an RPG program will read the data if the File Spec in the program indicates to read the data in keyed sequence.
Also, with a keyed field, an RPG program can CHAIN, SETLL, READE and READP.
A simple logical file is a different view of the physical file. It is actually a list of pointers to the physical file. Most of the time, a logical file is nothing more than a way of accessing the physical file with different key fields.
With the standard AS/400 supplied tools, it is hard to see the logical file. One way is to use the copy file CPYF to copy the logical file to a new physical file. Then, look at the physical file... it will be in the same order as the logical file.
The AS/400 Database is full featured. Logical files can join multiple files and select and create new fields.

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are necessary keywords to code message subfile?

1011


How we will get issues on AS/400 technology ? I mean which issue/Defect Tracking tool is using in all companies when any issue comes? Can anybody explain about the work flow of AS/400 project ? plzzz

1154


what is a non-join logical file?

971


In 'o' Specs What Is The Opcode For Write?

700


maximum number of subfiles that can be active for a single file is?

972






To Add A File To The 'file Selection' Option Of A Query, The Function Key To Be Pressed Is?

792


What Is The Object Type Of Pf, Lf, Printer File & Display File?

701


how do you pass parameters in cl?

1045


what are different types of substems?

1338


Write a CL program which will run a batch job at 1 am every night

669


How to reverse the string in rpg

1202


how do you use commitment control in rpg program ?

1275


what is scan and xlate?

1081


how can you specify no duplicate key?

699


WHICH REPLY CODE IS USED BT sftp ? ... (e.g.226 is used by FTP IF FILE IS TRANSFERED)

1718