45 pts.
 Add field without altering Record Format Level Identifier
Hi, Is it possible to alter a file (say adding a new field or deleting a existing field) without altering format level indentifier? if yes? please tell me how? Tanx

Software/Hardware used:
ASKED: February 17, 2009  11:56 AM
UPDATED: February 20, 2009  1:55 PM

Answer Wiki:
Hi, As far as I know, it's not possible to add or delete a field definition without altering the record format level identifier. The level ID is calculated based on the field definitions. Regards, Martin Gilbert. I concur with Martin. This cannot be done and it's a good thing. The level identifier is used by RPG(LE) and COBOL programs when they use Externally defined files to make certain that the data map they were compiled with is current. On crtpf or chgpf you can set the Record format level check . . . *NO and the programs will not abort but this is a really bad idea. The correct process is to recomile all of the programs that use the datafile when it's changed. The DSPFD will show the level identifier and the DSPPGMREF shows the level identifiers of the files that the program was compiled with. SQL can avoid some of these issues when field names are used. Phil Hi, I have small question about above answers, if we do CHGPF on Phisical File after addition of one field ihave seen with DSPFD on file, there is no change of Level Identifier. if we add or delete any field in PF and after that if we compile it then Level Identifier will change Please find below example: Level Identifier in PF before any changes to it is: 28C5A9410A6DD Level Identifier in PF after addition of one field to it and CHGPF is: 28C5A9410A6DD(above and this is same) Level Identifier in PF after addition of one field to it and Compile PF is: 2B4E71BDCD54D(now it has changed). my conclusion is we can add one extra field to PF without changing of Level Identifier Please tell me whether i am correct or not ? ////////////////////////////////////////////////////////////////// Sorry, you are wrong. I think that when you did the CHGPF you failed to identify the source member (see below example) and the field wasn't added. The CHGPF can also be used for changing a number of other parameters so it doesn't assume that it should get the source and add in the new fields. CHGPF FILE(Myfile) SRCFILE(mylib/QDDSSRC) SRCMBR(Myfile) The level identifier will always be created from the file structure, that's it's purpose. Phil
Last Wiki Answer Submitted:  February 20, 2009  1:55 pm  by  Mohan K   695 pts.
All Answer Wiki Contributors:  Mohan K   695 pts. , philpl1jb   44,220 pts. , Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Add your new field at the end of the record. You will be re-compiling any programs that use this new field, so no problem there. For programs that do not reference the new field, use an OVRDBF LVLCHK(*NO) command. As time permits, re-compile these other programs and removed the OVRDBF commands.

 830 pts.