Hello,
Yes it is recommended to clear the COGI before period close, else you have to change the posting date if period is closed.
COGI replace the posting date with function 'Replace -> Date but it may lead to cost difference.
Best Regards,
R.Brahmankar