?
Solved

FTP from AS400 to other server

Posted on 2003-03-18
5
Medium Priority
?
416 Views
Last Modified: 2007-12-19
I want to be able to use the FTP command on the AS/400 (V4R5) to transfer files from our AS400 to another server (unknown type at present) and when done, to retrieve a file from the other server. This process has to be automated so it can recur every 5 minutes. The file transfers will only occur if the files have changed.

How can I do this?
WebSphere is NOT an option.
0
Comment
Question by:bhlang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 8162319
Start ftp by running the FTP command, followed by the other server name or IP address.
This IP address must be quoted with single quotes:

e.g. FTP '155.30.64.12'

To automate this, you can define a input file for the commands and outputfile for the log.

(use OVRDBF for this)

The inputfile can hold all the ftp commands you need.

If you like an example of the input-file or CL or both please let me know.

cheers
0
 

Author Comment

by:bhlang
ID: 8162613
An example of both would be great!
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 8167922
Will send it first thing in the morning CET
0
 
LVL 16

Accepted Solution

by:
theo kouwenhoven earned 500 total points
ID: 8172399
OK the CL

/* Execute FTP Commands */
             OVRDBF     FILE(INPUT) TOFILE(FTPINP) MBR(SNDDEF)
             OVRDBF     FILE(OUTPUT) TOFILE(FTPOUT) MBR(LOGTXT)  
             STRTCPFTP  RMTSYS(*NONE)                          
             DLTOVR     FILE(*ALL)                              

The FTPINP and FTPOUT files are Sourcefiles

(contents of a FTPINP member)

OPEN 123.123.123.123                    
USER myuserid mypassword
LOCSIte Trim 0                      
CD /mypcdir
LCD /my400lib                        
PUT my400file mypcfile.tmp
REN mypcfile.tmp my400file.txt
CLOSE                                
QUIT                          


I do the rename because the destination server is running a proccess every 5 minutes that will process all *.txt files. If the FTP PUT command is interrupted the remote process can not process a incomplete file.

The "LOCSIte Trim 0" will send the file as it is on the 400, if you don't specifie this the trailing blanks of each transfered record will be striped.

Have fun!!!
0
 

Author Comment

by:bhlang
ID: 8302832
Thank you. Your answer did exactly as I needed.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question