I want to change the attribute of field or want to add new
field in existing PF but condition is format level
identifier should not change, is it possible?

Answers were Sorted based on User's Feedback



I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / subbareddy

by using CHGPF command we can change the file field
attributes as wells as we can add the new field to the
existing file without loss of existing data.

Is This Answer Correct ?    31 Yes 5 No

I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / pramod.r.nair

Whenever a file is changed (by adding or deleting a field),
Format level dentifier is also changed, even if u are using
CHGPF. So all the programs using this file needs to be
compiled again. You can avoid recompiling programs by
setting Format Level Check parameter to *NO in command
CRTPF. But this is not a good method, since it may affect
the program.

Is This Answer Correct ?    18 Yes 1 No

I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / srikanth h

File format ID is built based on such record format
attributes as the total length of the record format, the
record format name, the number and order of fields defined,
the data type, the size of the fields, the field names, the
number of decimal positions in the field, and whether the
field allows the null value. Changes to such attributes in
a record format cause the level format ID to change.

When you append new field(s) at the end the the existing
record format, the format level ID of the file with the new
record format will change. If your existing programs have
no need to use the new appended field(s) and you do not
want to recompile the programs, then you can run the
existing programs but you must turn off the level checking
either by specifying LVLCHK(*NO) for the CHGPF or, if you
prefer to leave LVLCHK(*YES) for CHGPF, use OVRDBF with
LVLCHK(*NO) for the existing programs to still work on the
file with the new record format. If your existing programs
need to use the new field(s), you must recompile the
programs because you will have to modify the codes.

Decreasing or increasing existing fields' length also
changes file level ID and the same idea applies. But using
LVLCHK(*NO) can produce different results in different
cases. It can be unpredictable because some details are
involved. So, recompiling programs is always a good thing
to do. If you cannot afford the recompilation for some
reasons, you need to do a test in a test environment to see
the effect. The worse case scenario is to turn off the
level checking (with varying degree of possible risk) for
you to make changes to the record format.

The following changes do not change the format level ID and
thus do not need recompilation or turning off of the level
checking:
• TEXT keyword
• COLHDG keyword
• CHECK keyword
• EDTCDE keyword
• EDTWRD keyword
• REF keyword
• REFFLD keyword
• CMP, RANGE, and VALUES keywords
• TRNTBL keyword
• REFSHIFT keyword
• DFT keyword
• CCSID keyword
• Join specifications and join keywords
• Key fields
• Access path keywords
• Select/omit fields

Is This Answer Correct ?    11 Yes 0 No

I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / jimbob

It depends on what attribute you are changing. If you change
the text, for example, then there is no change to the format
level id. But if you change the field's length or decimal
places, for example, then the format level id is definitely
changed.

Is This Answer Correct ?    5 Yes 0 No

I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / chandrababu

I have file EMP with Record level identifier is 20A2E063B4AD5 and I have added one new field to that file.
Below are different level identifiers with diff parm LVLCHK of CHGPF.


1)3C540B0837B35 ---> LVLCHK(*YES)
2)3C54AB58D8549 ---> LVLCHK(*SAME)
3)3C554BA978F5D ---> LVLCHK(*NO)

So we cant get the same level identifier if changes any attribute or adding the new fields.

Thanks,
Chandra

Is This Answer Correct ?    1 Yes 0 No

I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / dinesh

All the above answers are not given correct solution, so CHGPF is it to avoid record loss only not for avoiding the recompilation the programs....any one can give exact answer for this questions

Is This Answer Correct ?    0 Yes 1 No

I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / suji

When ever we change attributes of a field ,File Level
identifier will change.NO way to stop that.I agree with sonu

Is This Answer Correct ?    1 Yes 5 No

I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / suj

After changing the attributes of a record format, instead
of compiling, use CHGPF take F4 and give Record format
level check (LVLCHK) as *SAME, this doesn't change the
level check value.

Is This Answer Correct ?    3 Yes 7 No

I want to change the attribute of field or want to add new field in existing PF but condition is f..

Answer / sonu

No. Whenever a format is changed or touched the format
level identifier is always changed.

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More DB400 Interview Questions

How many libraries can be there in a library list?

2 Answers  


How to read a pf in reverse(from last record to first) using cl?

0 Answers  


How to find the list of source physical files in a library?? Is there any way to get a list??

5 Answers   Infosys,


what is the purpus of the chain and setll and setgt ?

2 Answers   Four soft,


how to add a new field to a file without compiling it?

1 Answers  






what is the difference between adding keys & constraints into a phisical file

4 Answers   HSBC,


How to update physical file using logical file with example?

0 Answers  


what is the difference between adding keys & constraints into a phisical file

6 Answers   HSBC,


What is the purpose of the chain and setll and setgt?

0 Answers  


Why we create the Physical File Member?

5 Answers  


what is open data path? and what is the diff b/w access path and open data path?

3 Answers   Cap Gemini,


how to update physical file using logucal file with example

1 Answers   Wipro,


Categories