Problem solve Get help with specific problems with your technologies, process and projects.

Can I key the physical file?

You Can View User Feedback To This Expert Response

I am being told by several programmers that you should never key the physical file, but instead, build logicals to process by key. This goes against what I have always done. I built my payroll master file keyed by social security number and didn't need the additional logical file object as overhead. What is the story on this?

This issue on many occasions is ground for "theoretical wars". The rational of using lf for unique key instead of key definition in the physical file is to separate data representation and data view. However, key definition over the PF is simple and I could not see any disadvantage of using it.

So, in theory or "by the book", you do have to use lf for unique key over a file, in practice you will find it quick and simple to use key over the physical file.


  • I just viewed your response to the programmer who asked you why you should never key a physical file, when you needed only one key, so why waste space with a logical file. When you have a hard error either interactively or in a batch (like the elusive decimal data error) and you need to view the record itself to figure out why you got the error, it seems that you make it much more difficult when you key the physical files. With a sequential physical file you can look under WRKACTJOB, work with...option, then display open files to see the record # the program errored on. If the physical files are sequential you can view the record easily through PDM. When they are keyed, you cannot find the record by the record #. From a support after the program is written standpoint, am I missing some other functionality, because it would seem that using sequential physical files makes things easier? -- Jean Turner


Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

The Best Web Links: Tips, tutorials and more.

Dig Deeper on FTP

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.