Page 1 of 1
MERGE FIELDS=COPY and SORT FIELDS=COPY.
Posted: Sun Nov 15, 2015 8:15 pm
by Sachin S
Hi,
What is the difference between the following two statements:
MERGE FIELDS=COPY and SORT FIELDS=COPY
can you please help. I've also used them interchangbliy an not sure if there is a difference between them.
Re: MERGE FIELDS=COPY and SORT FIELDS=COPY.
Posted: Sun Nov 15, 2015 10:14 pm
by Robert Sample
From the manual:
Specifying COPY on the SORT, MERGE, or OPTION statement
z/OS DFSORT: Getting Started
SC23-6880-00
The SORT and MERGE statements change very little when you specify COPY. Just replace the information you usually put in parentheses with the word COPY:
SORT FIELDS=COPY
MERGE FIELDS=COPY
You can also specify COPY on the OPTION statement:
OPTION COPY
All three of these statements have identical results.
Re: MERGE FIELDS=COPY and SORT FIELDS=COPY.
Posted: Mon Nov 16, 2015 8:56 am
by Anuj Dhawan
MERGE is used to combine multiple sorted files into a single file. The MERGE process presumes that the specified input files are already in sorted order by the key field. But it is with when you use key fields with MERGE statement. As Robert has indicated, if you are using these keywords with COPY - they all are just identical and somewhat misnomer too...IMHO.
Re: MERGE FIELDS=COPY and SORT FIELDS=COPY.
Posted: Mon Nov 16, 2015 8:47 pm
by William Collins
OPTION COPY solves the misnomer issue.
MERGE FIELDS=COPY can then be use for multiple input files not suitable for concatenation, like VSAM.