There are several ways to move/copy a file from a library to a directory or folder. You may want to start with a look at commands such as CPYTOPCD and CPYTOSTMF. Without knowing what you are actually trying to accomplish though, it's difficult to give you more direction.
Last Wiki Answer Submitted: January 3, 2008 6:52 pm by bvining6,055 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
No, you can’t move a file to a folder. You can copy the content to a folder with CPYTOPCD, but a file from a library cannot exist in a folder. The two different file systems are incompatible. They don’t hold the same kinds of objects.
Actually, you can move an LIBRARY based object to the IFS based object. Use the MOV or MOVE command and reference the LIBRARY based object using IFS nomenclature.
I’ve tried this on a V6R1 OS and it worked .
The command looked like this:
MOV OBJ(‘QSYS.LIBMYLIB.LIBTESTMOV.FILETESTMOV.MBR’) TODIR(‘.’)
TOOBJ(testmov.file)
TOCCSID(*PCASCII)
DTAFMT(*TEXT)
the TODIR = ‘.’ will be your user profile home directory. You can be specific if you want. You can find your home directory with the DSPUSRPRF command (look at the last page of attributes).
Something else I noticed as I played with it a little more yesterday. It doesn’t move the file, it only moves the member within the file, leaving the file short the member you moved.
I meant to move the file to a folder
No, you can’t move a file to a folder. You can copy the content to a folder with CPYTOPCD, but a file from a library cannot exist in a folder. The two different file systems are incompatible. They don’t hold the same kinds of objects.
You can’t move; you have to copy.
Tom
Actually, you can move an LIBRARY based object to the IFS based object. Use the MOV or MOVE command and reference the LIBRARY based object using IFS nomenclature.
I’ve tried this on a V6R1 OS and it worked .
The command looked like this:
MOV OBJ(‘QSYS.LIBMYLIB.LIBTESTMOV.FILETESTMOV.MBR’)
TODIR(‘.’)
TOOBJ(testmov.file)
TOCCSID(*PCASCII)
DTAFMT(*TEXT)
the TODIR = ‘.’ will be your user profile home directory. You can be specific if you want. You can find your home directory with the DSPUSRPRF command (look at the last page of attributes).
Ooops. some slashes disappeared from my posting:
there should be a single slash before each of the following:
QSYS.LIB
MYLIB.LIB
TESTMOV.FILE
TESTMOV.MBR
Here’s another shot at it:
OBJ(’\QSYS.LIB\MYLIB.LIB\TESTMOV.FILE\TESTMOV.MBR’)
Actually, you can move an LIBRARY based object to the IFS based object.
Yes, you’re right. It only requires a program-described file or a single-data-field source file. Good catch.
Tom
Something else I noticed as I played with it a little more yesterday. It doesn’t move the file, it only moves the member within the file, leaving the file short the member you moved.