z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 1. Merge with EQUALS

z/OS DFSORT Application Programming Guide
SC23-6878-00

INPUT
Blocked fixed-length records on disk
OUTPUT
Blocked fixed-length records on 3390
WORK DATA SETS
Not applicable
USER EXITS
None
FUNCTIONS/OPTIONS
EQUALS
//EXAMP    JOB A400,PROGRAMMER                                  01
//STEP1    EXEC PGM=SORT                                        02
//SYSOUT   DD   SYSOUT=A                                        03
//SORTIN01 DD   DSN=M1234.INPUT1,DISP=SHR                       04
//SORTIN02 DD   DSN=M1234.INPUT2,DISP=SHR                       05
//SORTIN03 DD   DSN=M1234.INPUT3,DISP=SHR                       06
//SORTOUT  DD   DSN=M1234.MERGOUT,DISP=(,KEEP),                 07
//  SPACE=(CYL,(2,4)),UNIT=3390                                 08
//SYSIN    DD *                                                 09
    MERGE FIELDS=(1,8,CH,A,20,4,PD,A)                           10
    OPTION EQUALS                                               11
Line
Explanation
01
JOB statement. Introduces this job to the operating system.
02
EXEC statement. Calls DFSORT directly by its alias SORT.
03
SYSOUT DD statement. Directs DFSORT messages and control statements to sysout class A.
04
SORTIN01 DD statement. The first input data set is named M1234.INPUT1 and is cataloged. DFSORT determines the RECFM, LRECL and BLKSIZE from the data set label.
05
SORTIN02 DD statement. The second input data set is named M1234.INPUT2 and is cataloged. DFSORT determines the RECFM, LRECL and BLKSIZE from the data set label.
06
SORTIN03 DD statement. The third input data set is named M1234.INPUT3 and is cataloged. DFSORT determines the RECFM, LRECL and BLKSIZE from the data set label.
07-08
SORTOUT DD statement. The output data set is named M1234.MERGOUT and is to be allocated on 3390 and kept. DFSORT sets the RECFM and LRECL from the SORTINnn data sets and selects an appropriate BLKSIZE.
09
SYSIN DD statement. DFSORT control statements follow.
10
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.
25
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.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014