as we know the records can be accessed randomly .
move the key value into keyfield
chek if end of file if it is it is the last record.
In ksds u really cannot tell whether the record can be stored in the last position as the records are organized by the unique key field.I think that could be possible in esds.