I am trying to divide MF PS into several datasets.
e.g. If I have a Dataset containg 600 recs, I want to divide this into 6 files with 100 records each. Is it possible to do this using JCL sort?
Jcl sort to divide Mainframe Dataset
jclmainframesorting
Related Topic
- Python – How to sort a dictionary by value
- Javascript – Sort array of objects by string property value
- R – How to sort a dataframe by multiple column(s)
- Php – How to Sort a Multi-dimensional Array by Value
- Java – Sort ArrayList of custom Objects by property
- C# – How to Sort a List
by a property in the object
Best Answer
The below JCL uses DFSORT to split DD SOTRIN evenly across 3 output DATASETS (OUT1,OUT2 and OUT3), to do it across 6 add in 3 more output DD statements and add them in to the FNAMES statement.
SORT FIELDS=(21,5,FS,A) is how you want the sortint dataset sorted, below is what this fields statement means
21 beginning of field to be sorted
5 Length of field to be sorted
FS Floating Sign (Signed Numeric)
A Ascending order
DFSORT Getting Started Manual
Smart DFSORT Tricks has lots of useful examples and a couple of other ways to split the records out of a dataset