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 is the necessary keyword for non-join logical file?

1163


what are the different opcodes available in rpg for database access ?

802


what are different types of substems?

1334


when should I use method get, and when should I use method post in my cgis?

603


can we define multi-dimensional arrays in rpg ?

927






what are the different methods to access seu?

620


Can we debug the MSGW JOBS?

927


Which command is used to replace CDUP command in FTP IF i WANT TO USE SFTP?

1775


what is a join logical file?

746


how to declare a constant variable in the freeformat?

957


is it there an easy way to determine if an html section is available to issue a wrtsection upon?

560


Explain The Keywords Edtcde & Edtwrd?

829


how do you specify page overflow indicator for printer files in rpg?

1457


what is message file?

594


What is dynslt?

776