In your CL program do:
CHKOBJ OBJ(&FILE) OBJTYPE(*FILE)
MONMSG CPF9801 EXEC(GOTO FOUND)
** Do your rename here
You may rename a file by right-clicking and selecting ‘Rename’ – but as your question has a Database tag and a reference to CL, I am thinking that you mean something much more specific than your question indicates. Could you supply more information?