SORT operator with JOINKEYS example
Here is an example of using one SORT operator for a simple JOINKEYS application.
//SRTJK EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//JNA DD DSN=MY.INPUTA,DISP=SHR
//JNB DD DSN=MY.INPUTB,DISP=SHR
//OUT DD SYSOUT=*
//TOOLIN DD *
* SORT operator with JOINKEYS application.
SORT JKFROM TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
* JOINKEYS application control statements for SORT operator.
JOINKEYS F1=JNA,FIELDS=(5,4,A)
JOINKEYS F2=JNB,FIELDS=(11,4,A),SORTED
REFORMAT FIELDS=(F1:1,20,F2:5,15)
* Main task control statement for SORT operator
* (operates on joined records).
OPTION EQUALS
SORT FIELDS=(1,3,ZD,A)
/*