How to add a field to a PF and compile it without loss of data?

Answers were Sorted based on User's Feedback



How to add a field to a PF and compile it without loss of data?..

Answer / s.kumar

First Add the fields whatever you want

then use CHGPF command

Physical file . . . . . . . . . > MyPf
Library . . . . . . . . . . . MyLib
System . . . . . . . . . . . . . *LCL
Source file . . . . . . . . . . MYSourceFile
Library . . . . . . . . . . . MyLib

Update the Physical file.No need to compile again.

Is This Answer Correct ?    24 Yes 0 No

How to add a field to a PF and compile it without loss of data?..

Answer / vijay

add the field in the last and don't change the sequence of the old field then only you can used the CHGPF effectively

Is This Answer Correct ?    9 Yes 2 No

How to add a field to a PF and compile it without loss of data?..

Answer / m.gupta

First add the field to existing pf for that u can do like this

2)Press 2 option for edit mode

3)Then go to the editor then u add the field in that editor what ever field u want

4)press f10 and write 'FILE' for saving file

5)Then u can write 'CHGPF'

6) Physical file . . . . FILE DEPT
Library . . . . . . MVLGUPTA2
System . . . . . . . . . . . . . SYSTEM *LCL
Source file . . . . . . SRCFILE QDDSSRC
Library . . . . . . MVLGUPTA2
7)Then click enter enter for 2 times

8)Then click UD and insert data

Is This Answer Correct ?    7 Yes 1 No

How to add a field to a PF and compile it without loss of data?..

Answer / ravi

Using CHGPF and CPYF you can add fields to a PF without
loss of data.

Thanks,

Is This Answer Correct ?    1 Yes 1 No

How to add a field to a PF and compile it without loss of data?..

Answer / mohan

The New field of the exisitng records would have a default
value

Is This Answer Correct ?    1 Yes 1 No

How to add a field to a PF and compile it without loss of data?..

Answer / mahalakshmi

ovrdbf command wuth out losing of data

Is This Answer Correct ?    0 Yes 1 No

How to add a field to a PF and compile it without loss of data?..

Answer / vishal

You can use ALTER TABLE in SQL to add a new field without compiling file or losing data

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More DB400 Interview Questions

CRTDTA AND CRTARA should be used along with?

2 Answers  


I have physical file with 100 records,there is no any duplicate records in this pf.based on this pf one logical file I have used.but this lf is viewing only 80 records only of that pf?what is the reason for this?

0 Answers  


Why we create the Physical File Member?

5 Answers  


What is the difference between access path and open data path?

0 Answers  


In a CL Program after executing a SQL SP how to receive a Output value from the SP. Just to make it clear I am sending 2 input and 1 output parameter to the SQL Stored Procedure. Now while receiving it output parm it is failing.

0 Answers   Nous,


How to know logical file belongs to which physical file without source?

1 Answers  


I had created one physical file tell me command to enter data in to?

1 Answers  


hi iam very new to as400. i had created one physical file can any one tell command to enter data in to that

9 Answers   Encore,


How to update physical file using logical file with example?

0 Answers  


Last statement of any rpg program is lr?

0 Answers  


Last statement of any RPG pgm is LR?

5 Answers  


one physical file can have how many max of logical files? what is the primary file?

3 Answers   Four soft,


Categories