Let us sort records in the bookstore data set by specifying multiple control fields. When you specify two or more control fields, you specify them in the order of greater to a lesser priority.
Note that control fields might overlap or be contained within other control fields.
I want to sort in the following fields:
- Course department
- Course number
- Instructor’s last name
- Instructor’s initials
- Book title
So, if two records have the same department, they are sorted by course number. If they also have the same course number, they are sorted by instructor’s last name.
If they also have the same last name, they are sorted by initials. Finally, if they also have the same initials, they are sorted by title.
Syntax to Sort Multiple Fields
SORT FIELDS=(11ð,5,CH,A,115,5,CH,A,145,15,CH,A,16ð,2,CH,A,1,75,CH,A)
Related Posts







One response
[…] Sorting Multiple Fields in DFSORT […]
LikeLike