This seems to be a very basic question.
You need to look at the IBM manual for CL commands to get all the information
You specify the From file and the to file
You have options to add or replace records in the to file.
You can select only certain records ffrom the from file.
If you files are externally defined you need to see if the names match and what option of the FMTOPT parm to use.