Moving File to a Directory in AS/400

15 pts.
Tags:
AS/400
I would like to move a physical file on an AS400 to a directory on the same AS400. Is there a command to do this?
ASKED: January 3, 2008  5:50 PM
UPDATED: March 9, 2010  2:58 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Det
    I meant to move the file to a folder
    15 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • NullFields
    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).
    880 pointsBadges:
    report
  • NullFields
    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’)
    880 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • NullFields
    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.
    880 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following