Search code examples
mainframevsam

How to manually edit the key of a KSDS VSAM file?


I have a KSDS file. I want to change the key of the file for testing purposes. I am unable to edit the key in File-Aid. Is there any way to do that ?

I have searched multiple forums, unable to find an answer.


Solution

  • You can change by following procedure

    • Copy your KSDS dataset to ESDS dataset in File-Aid.
    • Edit the key part of KSDS in ESDS file now, as it is not protected/key anymore.
    • Copy the edited ESDS file to another KSDS file by allocating the key length and index file.

    This has worked for me. Suggest if any better approach is there.

    Edit

    Alternate Method in File-Aid.
    Open the KSDS file on edit mode in File-Aid.
    - Use repeat command R before the key or RR on the block of records you want to edit.
    - On the newly created repetitive record(s) you can edit as per your wish on the key area.
    - After editing the new repetitive record(s), delete the original record(s).
    - Use SORT command on the command line to sort the sequence of the keys. (This will prevent from any key sequence error while editing by copying to a PS file or ESDS file.)
    - Use SAVE command to save the edited VSAM.