Are you sure the error is not just in response to the typo that caused you to have too long a name in the last FILENAME statement? "myfileclear" is 10 characters and filerefs (and librefs) can have a max of 8 characters.
You do not need to include keyword CLEAR to "close" a fileref. Just issue the FILENAME statement without anything after the fileref name value.