Maybe you could give us a little background on what you’re trying to do.
If this is homework, you’ve failed to read the assignment.
DB2/400 logical files are very useful to me.
Why do I need logical file in DB2/400?
You don’t need them. Why do you think they are ‘needed’ rather than simply ‘useful’?
Logical files are very usefull in getting the selective fields and also selective records from the physical file….
need of logical files is scenario dependent….
If logical files were not need then why do they exist ?There is a benefit and programmers now how to take advantage of them.
If logical files were not need then why do they exist ?
Many things exist that are not needed. A need can be reduced or eliminated by newer technology. How needed is the CABEQ op-code in RPG IV?
My point initially was differentiating between “need” and “utility”. LFs are useful, though not actually “needed”. The differentiation was to get the OP to clarify the question in order to raise it above the homework research level.
using logical file:
. We can view , insert, update, delete data of a physical file without any worry about deleting the data while compiling, hence provides security to data.
No, if you add/change/delete data “in the logical file” you are adding/changing/deleting data from the physical file as well.
Logical file, we can say as a mirror image or the view of the physical file
if you want to go with the mirror analogy, a logical is like a FUNHOUSE mirror, you can see the object (or part of it) in a different way, but you can’t see anything that isn’t already there.
Another reason for a LF is security. For example PAYMAST might be secured to just HR, but a LF over PAYMAST could include only a few fields, so an employee number or address lookup could be authorized to add’l people, such as those doing internal mailing.
Another reason for a LF is security.
But again, that’s become a “utility” issue rather than a “need”. Since SQL column-level security, and with embedded SQL, DDS LFs for security are no longer the only method.
I should mention that I do use DDS LFs (and LFs created/implemented by SQL). I just recognize that there are ways not to use them although alternatives are sometimes not as straightforward.