Previous Topic: Prefix (Concatenated Key) Resolution (Step 4)Next Topic: Prefix Update (Step 6)


Workfile Hierarchical Sort (Step 5)

The JCL to hierarchically sort the workfile from Step 4 is shown below:

Workfile Hierarchical Sort (Step 5) (z/OS)

//SORT  EXEC  SORT
//SORTIN DD DSN=step4.workfile,DISP=OLD,UNIT=TAPE
//SORTOUT DD DSN=step5.workfile,DISP=OLD,UNIT=TAPE
//SORTWK01 DD UNIT=DISK,SPACE=(CYL,(1),,CONTIG)
//SORTWKO2 DD UNIT=DISK,SPACE=(CYL,(1),,CONTIG)
//SORTWK03 DD UNIT=DISK,SPACE=(CYL,(1),,CONTIG)
//SYSIN  DD *
SORT  FIELDS=(17,8,BI,A)
/*
//

Note: This step requires that you use your own sort/merge facility.

step4.workfile

the workfile output from Step 4

step5.workfile

hierarchically sorted workfile output by this step

Workfile Hierarchical Sort (Step 5) (z/VSE)

// TLBL SORTIN1,'hierarchic.workfile',,SD
// ASSGN  SYS001,nnn
// TLBL  SORTOUT,'final.workfile',,SD
// ASSGN  SYS002,nnn
// DLBL  SORTWK1,'work.file1',,SD
// EXTENT  SYS003,1,0,ssss,llll
// ASSGN  SYS003,DISK,VOL=nnnnnn,SHR
// DLBL  SORTWK2,'work.file2',,SD
// EXTENT  SYS004,1,0,ssss,llll
// ASSGN  SYS004,DISK,VOL=nnnnnn,SHR
// DLBL  SORTWK3,'work.file3'
// EXTENT  SYS005,ERES00,1,0,ssss,llll
// ASSGN  SYS005,DISK,VOL=nnnnnn,SHR
// EXEC SORT
   SORT FIELDS=(17,8,BI,A),FILES=1,WORK=3
   RECORD TYPE=F,LENGTH=288
   INPFIL BLKSIZE=32544
   OUTFIL BLKSIZE=32544
/*

hierarchic.workfile

data set name of the output from the PFXR step

final.workfile

data set name of the sorted workfile produced by this SORT step

nnn

cuu address of the tape unit

nnnnnn

volume serial number of the disk unit

work.file1

file id of the third SORT work file

work.file2

file id of the second SORT work file

work.file3

file id of the third SORT work file

ssss

starting track in disk extent

llll

number of tracks in disk extent