Rename file in CL

265 pts.
Tags:
CL Procedure
CL Program
RENAME statement
Hi all. I need to check if the file exist, and rename it. t How do I check file existing in CL? Thank you.

Answer Wiki

Thanks. We'll let you know when a new response is added.

In your CL program do:
CHKOBJ OBJ(&FILE) OBJTYPE(*FILE)
MONMSG CPF9801 EXEC(GOTO FOUND)
** Do your rename here
FOUND:

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?

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Perhaps simplest is just to rename it. If it doesn't exist, ignore the error. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following