AS/400: Add some fields in the physical file

2475 pts.
Tags:
AS/400
CHGPF
Physical File
Hi! Actually I have a physical file containing 400,000 records. I just want to add some fields in that file and it is referred by many programs. I know that I can use CHGPF. But I'm a bit afraid to change a big database. What are the necessary steps I can take on these process and proceed further? Surey.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 8  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • azohawk

    Make a copy of the file befor using the chgpf so you can copy it back if something goes wrong.

    Make a copy of the file and practice the chgpf on it.

    Note, objects not recompiled will not recognize the new fields.  If prgmA uses logicalA of physicalA.  Unless logicalA is recompiled, prgmA can be recompiled and still not recognize the new fields in physicalA

     

    655 pointsBadges:
    report
  • philpl1jb

    1 backup the file and the system

    2. use the CHGPF .. this should change all related logical files that use the physical file format but not those that enumerate their own field list.  Check all logicals.

    3.  recompile all rpg and cobol programs that use this file or any of it's logicals and CL programs that use this file or it's logicals in a DCLF command.

    51,235 pointsBadges:
    report
  • CharlieBrowne
    IF you do not recompilke the RPG / COBOL / CL programs, you will get a LVLCHK. You would need to do a CHGPF LVLCHK(*NO) if you wanted to use the 1st suggestion.
    41,380 pointsBadges:
    report
  • philpl1jb

    Charlie Browne is correct but beware, LVLCHK(*NO) is a dangerious way to go.

    You should also check the RPG and COBOL to determine that it all uses the External Definition.  Otherwise you may need to make changes in the programs.

    51,235 pointsBadges:
    report
  • aceofdelts

    Good to add the new fields at the end of the file. That way, existing field positions do not change.

    Also nice if all new fields are alpha. A new numeric field would be problematic if you try to short-cut the recompiles.

    1,960 pointsBadges:
    report
  • BigKat
    numeric fields can be added as long as the LAST new field is alpha when you try and do this.
    8,350 pointsBadges:
    report
  • philpl1jb

    The preferred practice is:

    Change the file

    LVLCHK(*YES)

    Recompile programs.  Any programs that do not use the External file definitions may need to be updated. 

    51,235 pointsBadges:
    report
  • BigKat
    it is a given that this is NOT the preferred practice, but I think Sureyz understands that.  His issue is that since he HAS to do this what does he need to know to make it work  :)
    8,350 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following