.st0{fill:#FFFFFF;}

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 TABLE DEVNLITTEN/CRMAPIORDERS_CM1082P TO CRMAPIORDERS_PROCS
FOR SYSTEM NAME CM1082PRC

 

rename an as400 file using sql

NickLitten


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"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

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

>