Midrange News for the IBM i Community


Posted by: renojim
Move file from one machine to another
has no ratings.
Published: 30 Sep 2011
Revised: 23 Jan 2013 - 1583 days ago
Last viewed on: 24 May 2017 (3835 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Move file from one machine to another Published by: renojim on 30 Sep 2011 view comments(12)

What's are the best (read 'easy') alternatives to FTP for moving an IFS file from one machine/partition to another?

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Move file from one machine to another
Posted: 5 years 7 months 26 days 1 hours 39 minutes ago

Define both IFS locations as shared drives on your PC, and drag/drop the file from one shared drive to the other.

Posted by: renojim
Premium member *
Comment on: Move file from one machine to another
Posted: 5 years 7 months 26 days 1 hours 17 minutes ago

No pc in the middle. i to i.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Move file from one machine to another
Posted: 5 years 7 months 26 days 1 hours 7 minutes ago

If you've got ObjectConnect installed (free but optional feature of OS), you can use SAVRST command. This requires an SNA connection, but you can use HPR IP or AnyNet.

You could also look into using NetServer and /QNTC. NetServer makes the share visible (SAMBA server). The /QNTC file system works as the client. Once the share is available, you MKDIR '/QNTC/servername/sharename'. Once you have that going, just CP or MV the files; you can also open, read, write, etc. from a program. You don't authenticate explicitly when you MKDIR; user name must exist on both servers with the same password. The other thing is directories under /QNTC do not survive IPL; if you want them available all the time, you need to do the MKDIR in your IPL startup program.

Posted by: renojim
Premium member *
Comment on: Move file from one machine to another
Posted: 5 years 7 months 26 days 53 minutes ago

Shoo-be-doo-ah!

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Move file from one machine to another
Posted: 5 years 7 months 23 days 8 hours 16 minutes ago

Well unless you are using a real honest 5250 dumb terminal, then there is a PC in the middle...

The one that you are running the 5250 emulation on.  Frequently in the past I have set up IFS locations as a shared drive on my PC, so that I can generate files (typically html, xml or comma delimited files) on my PC and just drop them onto the IFS.  I then switch to my 5250 emulator and run an upload program to pull the data from the IFS to the main application data base files.  And where I have more than 1 AS400 running, I will have many shared drives, one for each system.  It's then very painless to transfer files between IFS's, as far as windoze is concerned they are just another microsoft compatible non-local hard drive. Cool

Posted by: clbirk
Premium member *
Comment on: Move file from one machine to another
Posted: 5 years 7 months 23 days 47 minutes ago

A real easy way assuming each are on a network is to use DDM and use cpyf. Bascially you will create a file (CRTDDMF) (on local machine) and you will give the remote file name/ip address and give it some name on the local machine and be done with it. I do it all the time. The only requirement is that machine A has some sort of "network" connection to machine B. That could be both are on same local lan or across a vpn, etc.

I must be missing something that one would want to mess with the IFS to do something that is simple.

 

 

 

Posted by: clbirk
Premium member *
Comment on: Move file from one machine to another
Posted: 5 years 7 months 23 days 36 minutes ago

Let me expand a bit, say the file on machine b is called masterfile and it is in mylibrary. Lets also say that the ip address of machine b is 192.168.1.101.

So on machine a, type:

CRTDDMF FILE(MYLIB/OTHERFILE) RMTFILE(MYLIBRARY/MASTERFILE) RMTLOCNAME('192.168.1.101 *IP)

 

The above creates a ddm file on machine A with a "dummy name" of "otherfile" and puts it in mylib.

 

Now lets say the file that you want to copy is called master2 and located in funlib.

CPYF FROMFILE(FUNLIB/MASTER2) TOFILE(MYLIB/OTHERFILE) MBROPT(*REPLACE) CRTFILE(*NO)

 

Of course it could be called masterfile and be located in mylibrary on machine a and so you could say:

 

CPYF FROMFILE(MYLIBRARY/MASTERFILE) TOFILE(MYLIB/OTHERFILE) MBROPT(*REPLACE) CRTFILE(*NO)



 


 

Posted by: clbirk
Premium member *
Comment on: Move file from one machine to another
Posted: 5 years 7 months 23 days 34 minutes ago

OOPS I didn't read very closely, I see it is an IFS file that you want to move...  sorry...

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Move file from one machine to another
Posted: 5 years 7 months 22 days 8 hours 18 minutes ago

"Well unless you are using a real honest 5250 dumb terminal, then there is a PC in the middle..."

Not a safe assumption. He could have been asking about a batch file transfer. (renojim, perhaps you could clarify the question?)

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Move file from one machine to another
Posted: 5 years 7 months 22 days 8 hours 12 minutes ago

While I'm thinking of it, even if there is a PC "in the middle", using it may not be practical. I'm working from home at the moment via VPN, with servers on the corporate intranet. Unless I'm moving a very small file, ...

Posted by: TFisher
Premium member *
Comment on: Move file from one machine to another
Posted: 5 years 7 months 20 days 7 hours 1 minutes ago

Short from writing your own utility, FTP may be the easiest way unless you are willing to use mapped drives. 

You would think that since you can see OS/400 libraries in the /QSYS.LIB directory that there would be a way to see other remote system's /QSYS.LIB also.  And from there be able to access the IFS on those remote systems.  Something like using mapped drives from within the IFS.

 

 

Posted by: BrianR
Premium member *
Green Bay, WI
Comment on: Move file from one machine to another
Posted: 5 years 7 months 19 days 6 hours 3 minutes ago

I believe you could also use the QFileSvr.400 directory to establish a link to the remote system, then just copy the file from the remote system to the local system or vice versa.

From what I read, QFileSvr.400 is sort of like DDM for the IFS.