How to add a field to a PF and compile it without loss of data?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Answer / mohan
The New field of the exisitng records would have a default
value
Is This Answer Correct ? | 1 Yes | 1 No |
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 | 1 No |
WHAT IS THE DIFFERENCE BETWEEN 'COLHDG' AND 'ALIAS'?
A pf containing 100 records... my query is how to display from 11th record in the pf?
How can we handle errors in RPG?
YOU CAN DELETE THE RECORD SPACE PERMENANTLY IN PHYSICALFILE THROUGH CL?
Suppose I have a pf,it contains 5 members,how to access particular member data from logical file ?and what is the use of member in pf?
Define interactive jobs and batch jobs
what is open data path? and what is the diff b/w access path and open data path?
What is the purpose of the chain and setll and setgt?
Where the QTEMP library will get created? if the the answer is QSYS, then howcome more than one job can create same library name(QTEMP) in QSYS? what is the uniqueness of QTEMP? For example, run the below command in different workstation WRKOBJ QSYS/QTEMP And take 8 in the option to check the description. both will have different info. so where(which LIB) exactly the QTEMP is stored?
can any one pls tell me some differences between a LF and command OPNQRYF?
3 Answers Accenture, Cognizant, eFunds,
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?
how to update physical file using logucal file with example