how to change the length of the field in a physicalfile?
Answers were Sorted based on User's Feedback
Answer / shanky
CHGPF Command:-
You need to Change DDS of Physical file for Changing Fileds
Length. and after det u need to complie it but if you
complie it then u will loose Existing Data of ur File.
So By Using CHGPF Command u can Keep ur Existing Data with
Compilation Of changed fields(DDS).
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / vani
i think by using the CHGPF it is possible.if anybody tell
me is it right or wrong
| Is This Answer Correct ? | 18 Yes | 9 No |
Answer / gautam
As per my understanding,we can not change length of a field
in a physical file using command CHGPF.Using this command
we can change number of records and so on.
If we want to change length of a field then we have to
change its source where we previously defined the size of
the field and then requires a compilation.After compiling it
we delete all logicals based on this physical file then
file is re-build in respective file groups from where
prorams use records.
Please let me know if there is any issues!
| Is This Answer Correct ? | 13 Yes | 5 No |
Answer / sachin
By Using CHGPF, We can Change Length add New field or
change field Attributes in PF
| Is This Answer Correct ? | 8 Yes | 3 No |
Answer / abhishek bajpai
Hi All,
Just to elaborate on the above answers..offcourse CHGPF is
correct and we can just press enter on this command and it
modifies the object based on the current DDS keeping the
data intact. But there are a couple of things to be taken
care of in this:
1.> If we are increasing the field lenghts then there is no
problem at all and chgpf runs absolutely fine.
2.> If we are decreasing the field length, then in case of
character field it will give warning as the existing
records might be truncated because of the shortened length.
But in case of numeric field the caommand will fail because
OS400 cannot truncate the existing numeric data and the
command blows up.
3.> If suppose the command is successfully run and the
field length is changed in the PF then there r chances that
the LF wont reflect the change. If in LF Pfile is mentioned
and no fields (that means the whole record format is copied
from PF) then it will reflect the new length. But in case
you have mentioned certain fields in LF then it will keep
on showing the old lenght inspite of the fact that in PF
the lenght is changed. This is because here the field
attributes are copied to LF from the PF when it is compiled
and it keeps on showing that length only.
Thanks
Abhishek Bajpai
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / ramaraju
By using CHGPF comaand we can change the pf attribute size.
And another way is
copy the physical file into another dummy file(for that
use Cpyf)
and change the physical file field length ,compile it
Then again copy the data from dummy file to original file
| Is This Answer Correct ? | 4 Yes | 4 No |
Answer / abhishek kumar
I agree that we can do this using the command CHGPF but
whether any one can tell which paramter we need to change
in CHGPF?
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / manu som
By using CHGPF comaand we can change the pf attribute size.
And another way is
copy the physical file into another dummy file(for that
use Cpyf)
and change the physical file field length ,compile it
Then again copy the data from dummy file to original file
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / swapnil sanghai
Hi All,
just wanted to check if it works for PF ( Flat Physiccal
File ). I do not see option for changing the length of
file. Can you please correct me if im wrong .
| Is This Answer Correct ? | 0 Yes | 2 No |
how can we can we the data decimal error?how can we open such file in support
I have some doubts on subfile----------- -----I wrote a prog on subfile to display the records. Every thing is clear but i defined a field called "opt" as input field in subfile record format from that input field i wish to enter into new screen called "EDIT" which i created it as a separate RCD in display file. i gave opt as 2 for edit just like in WRKMBRPDM screen please telll me the code and how can i code for it in RPG.
how do u find whether a record is locked or not??
Why we need to give File and To file Names While we are using OVRDBF. What is your understanding related to this?
what procedure should we use to find whether the following operations are successful or not setll setgt chain read reade readp pls tell with example i'm not lazy to read the manual or not lazy to do anything.but sometimes i cannot understand the things given in manual in high level english its little bit complicated for me,i can't understand their way of writing thats why i ask these questions here and find the solution in simple words that i can understand thats the real reason sir.sorry if i had hurt you or disturbed you.please understand my situation.
in which journalling which attributes are necessary??/
how to check on which PF , the LF is dependant ?
i'm working on progA , in that program i want to see the userids of the users who work on this program?
I have learnt through Net that Debugging a Batch job involves 1. Submit the job with the HOLD (*YES) parameter: SBMJOB HOLD(*YES) or Hold the job queue that before submitting the job by using the HLDJOBQ command. 2. Determine the job name, user, and number of the submitted job by using the WRKSBMJOB command. 3. Type the Start Service Job command on your screen: STRSRVJOB JOB(job name/user/number) 4. Type the Start Debug command on your screen: STRDBG 5. Release the job in the jobq. Type WRKSBMJOB and then put a 6 beside the job to be released and press enter, or, if the job queue was put on hold, release the job queue with the RLSJOBQ command. 6. A display appears when the job is ready to start, saying that you can now begin debugging the job. Press F10 to show the Command Entry display. 7. Now you can start debugging by entering an Add Break Point command: ADDBKP 8.ENDDBG 9.ENDSRVJOB I tried this for RPG/400 Program and up to six steps of the above it's ok,but for me no source is displayed and i typed DSPMODSRC in Command line but still i can't see the sourceif i press F.10 and enter command ADDBKP i don't know how to add break points through it,usually i add break points using F.6 for Interactive job debugs,but since this is batch i don't know sir,Please help me out. I was asked this question in a interview,i know only RPG/400 and i’m asking for debugging of RPG/400 program only sir. or is it only possible to debug BATCH RPG ILE JOB and it is not possible to debug BATCH RPG/400 JOB kindly help me out sir
1.How can you search an entire source file for a particular field name? 2.How can you find the differences between two versions of the source for the same program? 3.What is a hidden field as it relates to a sub file? 4.How do you display a sub file that has no records in the sub file?
Are all these RPG/400 Interviewed Questions being asked recently? are current?
How to declare the more than one file in cl/400.