CPF327E Unable to move file into a new library 

 March 17, 2016

By  NickLitten

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 an as400 file using sql


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad 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 remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Get In Touch

I’m always looking for awesome input, feedback and critique!


Snug CBD

 20% Discount

I have partnered with SNUG CBD givING you Organic CBD
20% discount code "NL20"