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
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.
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).
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
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.
How to get IBM i command line during runtime using System Request 3
How to Install IBM Access Client Solutions (ACS)
IBM i Data Obfuscation – Making Data Foggy Murky and Squinty
How to rename Fresche (BCD) Presto Library – XL_PRESTO
What is AS400 modernization?
IBM i ACS 5250 EMULATOR FONT – and other ridiculous mumbo jumbo
IBM i SQL statement to convert or compare hundred year date format
How to compare ‘100 Year Date’ to a Timestamp – aka – Weird AS400 iSeries Date formats
Modernize AS400 iSeries Queries – Convert to IBM i SQL