Adding a field to a physical files which has logical files

Recent versions of OS/400 have made it easier to add fields to existing files.

On older versions of the operating system, You had to:

1)  Rename the Physical File (not the DDS, the database file).
2)  Delete any associated logical files.
3)  Add the new field in the DDS for the Physical File.
4)  Compile the DDS.
5)  Use CPYF to copy the data from the old, renamed physical file. You had to use FMTOPT(*MAP).
6)  Recompile the logical files.
7)  Recompile any programs that use the file.

With newer versions of OS/400, the steps are:

1)  Add the new field in the DDS of the Physical File
2)  Key CHGPF and hit F4. Fill in your file name.
     Hit F10 and fill in the location of your DDS.
     OS/400 changes the physical file and rebuilds the logical files.
3)  Recompile any programs that use the file.

To recompile any programs that use the file:

STRPDM
Select 2 to work with objects.
Use Q* as the mask for the object name.
Put 25 next to QRPGSRC and QRPGLESRC.
For "Find", key in a mask that will find the physical and logical files.
For "Option", key in 14.
Hit ENTER and let PDM find and compile all your programs.

 

Back to Basic 400 Skills   |   Main Page