Jim Thedorf (jthe...@mcc-net.com)
To do that you just need 2 source file members.
Name the first member INPUT and put into your "ftp scrip", name the second
OUTPUT : it will receive the log of the ftp session.
In your CLP, before starting FTP, add 2 ovrdbf, because "Batch" ftp uses
files named INPUT and OUTPUT.
Example :
(My FTP source file is called FTP)
Attention : The first line contains the remote user profile followed by the
password. If you can't use anonymous access it can be a security issue. I
don't know how to hide password, if someone knows...
CLP :
----------------------------------------------------------------------------
------------------
OVRDBF FILE(INPUT) TOFILE(QGPL/FTP) MBR(INPUT)
OVRDBF FILE(OUTPUT) TOFILE(QGPL/FTP) MBR(OUTPUT)
CLRPFM QGPL/FTP OUTPUT
FTP RMTSYS(IpAddress or name)
----------------------------------------------------------------------------
------------------
Exemple of member INPUT :
----------------------------------------------------------------------------
------------------
0001.00 USERPRF PASSWORD
0002.00 BIN
0003.00 PUT FROMLIB/FROMFILE TOLIB/TOFILE
0004.00 QUIT
----------------------------------------------------------------------------
------------------
Jean-Michel Penasse
EXPERIA Europe
jmpe...@experia.com
_____________________________________________
Jim Thedorf wrote :
Jim Thedorf
>Is it possible to create a CL program that can FTP to another AS400 and
>then perform downloads/uploads without user intervention?
>
>
>
>Jim Thedorf (jthe...@mcc-net.com)
>
>
>
>
In short, yes.
The actual process is not quite so simple. To perform an
unattended/batch FTP file transfer, the following steps need to take
place:
1. Create a script in a source physical file of the commands to be
run in the FTP session. If you want to perform the same transfer each
time, then this is a one-off manual task, but if you will be
transferring different files each time, then a program will need to be
written (not in CL, unless someone can come up with a method of
writing records to a physical file in a CL program) to dynamically
create this script each time.
Another factor to bear in mind is that this script will contain an
unencrypted user name and password that the local AS/400 will use to
sign on to the remote system.
2. Override file INPUT to the script member created.
3. Override file OUTPUT to an empty source physical file member.
When the transfer is performed, STRTCPFTP will write the output that
would normally be displayed on screen into this member.
4. Run the transfer using STRTCPFTP.
5. Check the output member created to ensure that the transfer
completed. This can be done by searching for the "Transfer complete"
messages.
More information about performing FTP file transfers in batch is
contained in the "TCP/IP Configuration & Reference" manual.
Regards,
Steven Kendall
Just in case it's useful to someone someday, CL can write (or more
accurately, cause to write) records to files in a couple of ways. One
way that I very rarely see used is via the Sort APIs.
CL can call the APIs and provide record data in an input buffer (which
can be a *CHAR variable). The APIs do the writes. I have a couple
command shells for these APIs that make reading/writing possible in CL
without needing to DCLF the file(s). Not a pretty solution when packed
numerics are involved, etc., but it's better than nothing when needed.
Tom Liotta
In article <380f71a1...@news.xtra.co.nz>,
--
Tom Liotta
AS/400 systems programmer
Sent via Deja.com http://www.deja.com/
Before you buy.
"JeanMichel" <jmpe...@experia.com> wrote:
<SNIP>
I don't know how to hide password, if someone knows...
<SNIP>
Jean-Michel -
Somewhere on this NG, there is a thread regarding SEU colors and
displays which tells which hex value to insert into an SEU line to
cause it to be non-displayed. This would hide the password (and the
user profile) in the SEU member. Unfortunately, it would not encrypt
the password (either on the /400 or on the network) but it's a start.
HTH,
Steve
Steve,
I've tried with non display attribute (X'27') and it works obviously in SEU.
The password becomes "hidden"
But, unfortunatly, FTP uses this character as part of either usrprf or
password and fails !
jeanmichel
I tried it, and haven't been able to get it to work. When I execute the
command, it references programs I don't see as a part of the zip file.
Then again, I'm not an RPG wonk. I just loaded each src file into a
*SRC member, and tried compiling. The compiles worked.
=== Al