Hallo!
Ist an und für sich keine große Sache, wenn du ein wenig CLP programmieren kannst.
Du musst eine AS/400 Datenbank Datei erstellen, die den FTP Transfer steuert und dann die Eingabedatei des FTP Befehls mit OVRDBF überschreiben. Siehe den Auszug aus dem Infocenter zur AS/400
FTP as batch job
In addition to running the FTP client interactively, you can run the FTP client in an unattended mode. This topic provides two examples of this method: a simple example and a complex example. You can also refer to Section 6.7, Batch FTP, of V4 TCP/IP for AS/400(R): More Cool Things Than Ever (about 744 pages) for another example.
Batch FTP: A simple example
The following is a simple example of a batch file transfer that involves the successful transfer of one file from a remote system.
The components are as follows:
A CL program
An input file of FTP commands
An output file of FTP messages
The CL Program
************************************************************
ITSOLIB1/QCLSRC BATCHFTP:
----------------------
PGM
OVRDBF FILE(INPUT) TOFILE(ITSOLIB1/QCLSRC) MBR(FTPCMDS)
OVRDBF FILE(OUTPUT) TOFILE(ITSOLIB1/QCLSRC) MBR(OUT)
FTP RMTSYS(SYSxxx)
ENDPGM
************************************************************
Note: To make this sample work when written with ILECL, you must add OVRSCOPE(*CALLLVL) to the OVRDBF commands.
The BATCHFTP program overrides the INPUT parameter to the source physical file ITSOLIB1/QCLSRC MBR(FTPCMDS). The output is sent to MBR(OUT).
The Input Commands File
************************************************************
ITSOLIB1/QCLSRC FTPCMDS:
---------------------
ITSO ITSO
CD ITSOLIB1
SYSCMD CHGCURLIB ITSOLIB2
GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE
QUIT
************************************************************
The FTP subcommands required are shown in the FTPCMDS file.
The Output Messages File
************************************************************
FTP Output Redirected to a File
FTP Input from Overridden File
Connecting to host name SYSxxx
at address x.xxx.xx.xxx using port 21.
220-QTCP at SYSxxx.sysnam123.ibm.com.
220 Connection will close if idle more than 5 minutes.
Enter login ID (itso):
> ITSO ITSO
331 Enter password.
230 ITSO logged on.
OS/400 is the remote operating system. The TCP/IP version is "V3R1M0".
250 Now using naming format "0".
257 "QGPL" is current library.
Enter an FTP subcommand.
> CD ITSOLIB1
Enter an FTP subcommand.
250 Current library changed to ITSOLIB1.
> SYSCMD CHGCURLIB ITSOLIB2
Enter an FTP subcommand.
> GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE
200 PORT subcommand request successful.
150 Retrieving member BATCHFTP in file QCLSRC in library ITSOLIB1.
250 File transfer completed successfully.
147 bytes transferred in 0.487 seconds. Transfer rate 0.302 KB/sec.
Enter an FTP subcommand.
> QUIT
221 QUIT subcommand received.
************************************************************
The output file is shown. It is a straightforward matter to write a program to process this file and display an error message on QSYSOPR if there are any error messages. FTP error messages have numbers that start with a 4 or 5.
Falls du noch Hilfe dazubrauchst, oder spezielle Fragen dazu hast, kannst du Sie gerne posten.
Grüße
Ralf