Page 1 of 1

how do i reverse the records in a dataset .

PostPosted: Fri Oct 04, 2013 12:32 am
by logeshwari
hi,


how do i reverse the records in a dataset (esds,ksds).. what are all the ways that i can make it ?

Re: how do i reverse the records in a dataset .

PostPosted: Fri Oct 04, 2013 12:48 am
by Akatsukami
First, it is a very bad idea to overwrite a data set.

Now, suppose your requirement is to create a second data set, with the records in reverse order from the first. For a PS data set or a VSAM ESDS, you're better off using your sort product; put a counter on the end of the record and then sort in descending order.

For a VSAM KSDS, perform a logical NOT on the key.