What you’re asking isn’t possible. The fields in a logical are a “view” of the fields in the physical – the fields have to exist in the physical first, before they can be used in the logical.
Gilbert is right, as always. But give us an idea of what you’re trying to do, perhaps we can make some recommendations.
Dido… but why not just add it to the PF and NOT COMPILE. Just do a CHGPF and specify *NO for record level check. If you compile it it will make all the other programs using that file to not work. So changing it will get your new field in the file. You might have to do it on your logical too.. I can’t remember if you have to or not.
I would agree that adding the field to the source and then doing a CHGPF to update the physical file is the best way to go. The logical files automatically get updated. But I disagree with specifying level check = *NO. It’s best to identify where those files are used and recompile all those programs once you have done your CHGPF.
I think Tod’s right on this. LVLCHK(*NO) is (in my opinion) a last resort option to get/keep things working. It’s something I would only use when I have no source for one of the programs that uses the file or for some reason can’t re-compile the program.
If you change the PF and want to use the LVLCHK(*NO) you should add the field to the end of the record format otherwise your programs wil give bad results without being compiled. I would not recommend doing this except in a have to situation.
WOW. lol.. I agree but its a solution. It all depends on the system avaialbility etc. *no level check is vert dangerouse… Be carefull.. If you only have a few programs using it then great. But if you have a few thousand using the file then it might take some time to compile.