I have to add some new fileds to an existing PF without compiling the PF how can i do that? can i use this updated PF in my RPG ILE program without facing any error/exception?
Software/Hardware used:
ASKED:
May 19, 2008 6:50 AM
UPDATED:
April 21, 2010 2:54 PM
if i have data in existing file and i add some new fields to PF then i have to re-compile PF again, but i will re-compile PF then existing data will be erased, but i don’t want to erase the existing data and i want use updated PF in my RPG program then what i have to do?
Using CHGPF command
First change the Fields thru the DDS of the file
then Use CHGPF Command.
Hi,
If you use the CHGPF command you won’t need to recompile the PF (the CHGPF command updates the format of the file using your DDS) and your data should stay intact, although I suggest you take a copy first, just in case. You will probably need to recompile your RPG program to reference the new file format, otherwise you’ll get level check errors at runtime.
Regards,
Martin Gilbert.
You will probably need to recompile your RPG program to reference the new file format…
This is one of the reasons that LFs exist — so that you can change the underlying PF without needing to recompile programs. A PF probably should only be referenced in a single ‘maintenance’ program. All other programs should be compiled over appropriate LFs. The LFs should have explicit field lists rather than defaulting to “all fields”.
If an application is written correctly, PFs can be modified in a variety of ways, giving new format level IDs every time, and requiring just a single ‘maintenance’ program to be recompiled.
A field may be added to a PF. Until the field is added to an existing LF, programs using that LF can be left alone. In many cases, a new LF can be created where the new field is exposed. A new field often has very limited exposure, so it’s possible to keep changes very limited.
Tom
You may use SQL to add coloumn(s):
The add fieldheading(s):
Not: each headerline takes 20 chars.
DanF
Ouup….
my previous went wron.. Here’s my new try:
You may use SQL to add coloumn(s):
Then add fieldheading(s):
Note: each headerline takes 20 chars.
DanF