I have a DS defined as below -
D MyDSArr DS qualified dim(999)
D MyDsKey
D field1 10A overlay(MyDsKey:*next)
D field2 10A overlay(MyDsKey:*next)
D field3 10A overlay(MyDsKey:*next)
D field4 7S 0
D date 8A
D time 6A
Now, my requirement is to sort the DS first by date in descending order, followed by time in descending order.
For a single field, I know that i can sort as below -
SortA(D) %Subarr(MyDsArr(*).date:1:i)
And this works fine too. But, is there a way to sort 2 fields? I have read about QSORT utility, but is there any other way to do this?
D MyDSArr DS qualified dim(999)
D MyDsKey
D field1 10A overlay(MyDsKey:*next)
D field2 10A overlay(MyDsKey:*next)
D field3 10A overlay(MyDsKey:*next)
D field4 7S 0
D date 8A
D time 6A
Now, my requirement is to sort the DS first by date in descending order, followed by time in descending order.
For a single field, I know that i can sort as below -
SortA(D) %Subarr(MyDsArr(*).date:1:i)
And this works fine too. But, is there a way to sort 2 fields? I have read about QSORT utility, but is there any other way to do this?
Comment