//sysin dd *
sort fields=(1,10,ch,a)
sum fields=none
*
//*
sort fields=(1,10,ch,a)
- this means that you are sorting position 1 with length 10 telling mainframe that the values inside will be treated as characters and arrange it in ascending order. In using the above dd statement, the mainframe will use the keys(1,10) and remove other records with the same value.
Sample:
dataset contains the following values
0000000001AAAA
0000000001AAAA
0000000001AAAA
0000000001AAAA
0000000002AAAA
0000000002BAAA
0000000002BAAA
0000000001AAAA
using the DD statement above, the sortout dataset will contain
0000000001AAAA
0000000002AAAA
0000000002BAAA