This is not difficult to do, but why do you want to do this??? What will be done with this data after it has been altered? I strongly suspect the "reason" for this task is completely specious. ("Specious" is a word that means the reason you are specifying this task is wrong; worse, the updated data may prove to be useless.)
- You need a program to do this. "JCL" is used to specify the environment used to execute a program. That is all "JCL" can do. "JCL" cannot copy data or alter data records as they are being copied.
- Many people know how to persuade a sort program that is run using JCL to do this task. I am not an expert in sort programs, so I cannot help you.
- The documentation for the IBM DFSORT program is online. The JCL used to run DFSORT and the DFSORT control statements is collectively call "JCL," but only the statements that start with // is JCL. The data used to direct DFSORT's functioning, while it is frequently included with the JCL statements used to run DFSORT is not JCL.
- Many mainframe sites use another sort program called Syncsort. The documentation for Syncsort is not online, though it appears many users find the JCL and control statements for Syncsort to be similar (and often identical) to the JCL and control statements for DFSORT. Both are outstanding programs; as sort programs there is little to differentiate them. DFSORT is better in some extreme circumstances, just as Syncsort is better in other extreme situations. "Better" just describes the system resources required to run the program; the limits of the programs are rarely encountered in practice.