CPF327E Unable to move file into a new library

Mar 17

So, just when I thought I had seen it all, I got this error message “Unable to move file into a new library” when I was just moving a file to a new library in my lovely IBM i System. Nothing weird about this file (or so I thought) and I was just going a simple MOVOBJ to move it. But it farted, belched and complained… leaving me scratching my head

What did I do to get this weird error!

I created a work file in my library, by copying an existing file from another library. I tinkered with it, loaded it with data and then wanted to rename it and store it alongside the original file in the original library. Simple enough one would think?

I renamed it in my library (simply by adding a suffix) and then tried to move it back into the original library but *boom* IBM i gets very upset and will not let me move it reporting an error message: CPF327E Alternative name for file FILENAME not allowed.

What prevents a file moving to another library when it’s got a unique name?

The problem here is – it actually hasn’t got a unique name. I just thought it had. But it’s got a sneaky SQL long name which already exists in the original library (schema).

Unable to move file into a new library

Because I had created this file by using CPYF into my library – IBM i had created the file in my library with the name I specified but it had also carried across the SQL long name for the file as well. Remember that IBM i files are 10 character but they can also have long names in SQL.

Simply use SQL to rename the files short name and/or its long name like this:

 

RENAME TABLE DEVNLITTEN/CRMAPIORDERS_CM1082P TO CRMAPIORDERS_PROCS
FOR SYSTEM NAME CM1082PRC

 

rename an as400 file using sql

Follow

About the Author

IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Alpha Nerd and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and in the words of the most interesting man in the world: Stay thirsty my friend.