It's not clear what you want to do. You mention a sortkey, but it isn't clear what that sortkey is. It isn't clear if you want to keep records with the latest datetime of all of the records, or of each set of records with a particular key.
You need to do a better job of explaining what you want to do. Show a better example of the records in your input file with multiple sets of records to be kept if that's relevant, and your expected output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields and keys.
I wish to sort this file based on update date and then extract the records which were updated latest (the latest may/ may not be current date - Please give solution for both - 1. If i need to extract the file based on update date=current date - how to dynamically retrieve the system date and hence extract those records? 2. If i need to extract the records updated latest which is not equal to current date, then i should sort based on update date in descending order and then extract top few records till the update date doesn't change for the consecutive record from the previous one).