Thank you for the question
Sure it is possible.
I have created a working example.
Download zip file
extract all files into c:\support folder.
Basically you need to identify the last record in the group
HDR,100,xxx,xxx,xxx,xxx,xxx,xxx,xxx
DTL,100,xxx,xxx,xxx,xx,xx,xxx,xxx,xxxx,xxx,xx,xxx,
RSN,100,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx <=== last record
HDR,200,xxx,xxx,xxx,xxx,xxx,xxx,xxx
DTL,200,xxx,xxx,xxx,xx,xx,xxx,xxx,xxxx,xxx,xx,xxx,
RSN,200,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx
RSN,200,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx
RSN,200,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx <=== last record
HDR,300,xxx,xxx,xxx,xxx,xxx,xxx,xxx
DTL,300,xxx,xxx,xxx,xx,xx,xxx,xxx,xxxx,xxx,xx,xxx,
RSN,300,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx
RSN,300,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx <=== last record
This can be done by generation row number and sorting the data twice
So the record with number 1 indicates last record
Than we clone last record and use lookup to get record from the file
Mike