ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

copy file from ifs to file server or PC

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • copy file from ifs to file server or PC

    Im trying to copy a file that is part of my virtual tape drive.
    I need to do this in batch
    I can do this interactively ok with this
    STRPCCMD PCCMD('Copy z:folder1\file1 +
    n:\folder1\folder2') PAUSE(*NO)

    But when I do this in batch with this
    OVRDBF FILE(INPUT) TOFILE(*LIBL/CPYVRT1)
    FTP RMTSYS('123.45.67.89')

    My flat file contains this. I have tried both copy and cp
    file (CPYVRT1)
    USERID password
    copy z:\folder1\file1 n:\folder1\folder2
    quit

    It fails and does not copy the file.
    it sees my user id and accepts that and the password then error
    > copy ******************** *************************
    Subcommand 'copy' not valid.

    Then quits ok.

    If I run the same command from a command prompt it works fine but need to use copy not cp.

    So is it the syntax that I have wrong.
    any help to get this to work
    cheers

  • #2
    Re: copy file from ifs to file server or PC

    If I run the same command from a command prompt it works fine but need to use copy not cp.
    Same command? What command? COPY? FTP? STRPCCMD?

    Command prompt? What command prompt? Where? On a PC? On the AS/400?

    It fails and does not copy the file.
    it sees my user id and accepts that and the password then error
    > copy ******************** *************************
    Subcommand 'copy' not valid.
    That's because FTP doesn't have a "copy" subcommand. You can't use "copy" in a FTP script. Use "put" instead of "copy".

    But it's not clear why you must use FTP at all. Can't you just copy the file straight to the file server through the /QNTC file system?
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment

    Working...
    X