JCL sort example using dfsort (Stop sort after number of rows).

Community Help: JCL Sort - Example of using JCL and dfsort (stop after specific number)

Share your own experience     View front page

JCL sort is actually really easy to do. You simply just call the sort job, pass it the files, and tell it the parms on what type of sorting you want. For example, if you want your JCL to stop processing after the first 10 rows, just use the sample parms on your sysin as shown:
//SYSIN DD *
SORT FIELDS=COPY
OPTION STOPAFT=10

This above simply means you are going to stop processing after 10 rows, so only the top 10 would be copied in this situation.