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

what is general and type of general

1 Answers   Active Brains,


There is one string as A B C and wanted to display string as Shri A Shri B Shri C, how we can do this in sql? If we have around 100 values in string like this, each value should be displayed with initials as Shri.

0 Answers  


how can we write LF using flatfile.

9 Answers  


What is the interactive job?

0 Answers  


Last statement of any rpg program is lr?

0 Answers  






CRTDTA AND CRTARA should be used along with?

2 Answers  


what is use of self join and which cases you will use this join

1 Answers   TCS,


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?

9 Answers   Mind Tree, TCS,


Is Constent can be define as a key field?

3 Answers  


pls anyone explain about compile time array,pre run time array run time array

4 Answers  


If we use the file level keywords like LIFO, FIFO, FCFO in a file, can we see the impact of it by doing the run query of the file? if not how can we see the impact of these keywords.

2 Answers  


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

5 Answers   Infosys,


Categories