MainRecord function

Create MAIN code record.