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

How to avoid using indicators in ile ?

954


what is overlay?

880


What is the Difference between command attention key and command function key ?

1014


what is sflinz and sflrna?

1230


http default port 80 is used by some other production http service. How can I create an http instance on another port to run cgidev2 and my future cgi developments?

818






what is a query can be run in which mode?

1030


how can you execute a command from within an rpg program without calling a clp program?

1498


define a shared access path?

1264


Can you summarize the steps I have to go through in writing my first cgi?

827


can a single screen format occupy a screen area above and below a subfile format ?

1282


if dspatr(pc) and csrloc were specified for a format, which keyword would have priority?

1302


How do I remove a flag or check no. or name when a user opens too many sessions?

1964


define the purpose of the *cat function?

1251


how to pick up the changed records every time in a subfile after the first change made ?

1409


how can you detect overflow for a print program that prints multiple lines per cycle?

1278