The MERGE control statement must be used when a merge operation is to be performed; this statement describes the control fields in the input records on which the input data sets have previously been sorted. Use the MERGE control statement:
V | >>-MERGE--FIELDS=--+-(----p,m,f,s-+--)----------------------+---> | .-,---------------. | | V | | +-(----p,m,--+----+--s-+--)--,--FORMAT=f-+ | '-f,-' | '-COPY-----------------------------------' >--+--------------------------+-------------------------------->< | .-,------------------. | | V | | '-,---+-+-EQUALS---+---+-+-' | '-NOEQUALS-' | +-FILES=n--------+ +-+-FILSZ=x-+----+ | '-SIZE=y--' | +-SKIPREC=z------+ +-STOPAFT=n------+ '-Y2PAST=--+-s-+-' '-f-'
Operand | Description |
FIELDS | Specify as p, m, f, or s. |
FIELDS=COPY or FIELDS=(COPY) | Copies one or more input files to an output file. When FIELDS=COPY: Ignores all other MERGE operands, except SKIPREC and STOPAFT. CSI-SORT terminates when specified with SUM or INREC control statement. Default—None; optional. |
FORMAT | Use only when all control fields in the entire FIELDS expression have the same format. Default—None; must specify if not included in FIELDS operand. |
EQUALS NOEQUALS | Override options available at installation, such as DIAG, and Supply optional information, such as ADDROUT and LABEL. |
FILES/FILSZ | Specifies number of input files to be merged or copied. Specify as FILES=n, where n is any number from 1 through 9. Default—None; must specify for merge applications; 1 for copy applications. FILSZ – Total number of records in input dataset. |
SKIPREC | Specify as SKIPREC=n. |
STOPAFT | Specify as STOPAFT=n. |
Y2PAST | Temporarily overrides the Y2PAST installation option, which specifies the sliding (s) or fixed (f) century window. The century window is used with DFSORT’s Y2 formats to correctly interpret two-digit year data values as four-digit year data values. Note: CENTURY=value and CENTWIN=value can be used instead of Y2PAST=value. |
Additional information to know about the MERGE control statement is:
MERGE FIELDS=COPY
FIELDS: Indicates copy the input file to the output file without merging. This is treated like a SORT of no fields.
MERGE FIELDS=(2,5,CH,A),FILES=3
The FIELDS control field:
FILES shows merge three input files
MERGE FIELDS=(2,5,CH,A),FILSZ=29483
The FIELDS control field:
FILSZ input data sets contain exactly 29483 records.
MERGE FIELDS=(25,4,A,48,8,A),FORMAT=ZD,FILES=9
MERGE FIELDS=(25,4,ZD,A,48,8,ZD,A),FILES=9
FIELDS major control field:
FIELDS second control field:
FORMAT operand is used because both control fields have the same data format—zoned decimal.
FILES indicates merging nine files.
MERGE FIELDS=(3,8,ZD,E,40,6,CH,D)
The FIELDS control field:
MERGE FIELDS=(25,4,A,48,8,A),FORMAT=ZD
The FIELDS control field:
MERGE FIELDS=(1,8,CH,A,20,4,PD,A) OPTION EQUALS
MERGE statement– FIELDS specifies an ascending 8-byte character control field starting at position 1 and an ascending 4-byte packed-decimal field starting at position 20. The records in each input data set must already be in the order specified.
OPTION statement– EQUALS specifies that the order of output records with equal control fields is to be based on the file number of the input data sets and the original order of the records within each input data set.
ICETOOL Utilities – MERGE Examples
A well-maintained product backlog is crucial for successful product development. It serves as a single…
Incremental value to the customer refers to the gradual delivery of small, functional parts of…
A Product Market refers to the group of potential customers who might be interested in…
The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…
The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…
Choosing the right Scrum Master Certification depends on your current experience and career goals. If…