how to change the length of the field in a physicalfile?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

519


Explain mdt?

667


Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?

1466


What is a record lock error?

1270


How Chain operation copies the record's data to the input buffer for the program?

1084






We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?

774


If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?

624


how do I play {insert rpg system here}?

588


are there any useful c runtime apis that I can call from rpg iv?

702


what was the robotech rpg?

689


What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?

2521


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

2056


can I touch the array during treatments?

760


how does the rpg element work?

720


which program rpg or cl is efficent to update a transaction onto a database file and why ?

749