I believe if you search this forum you will find some answers. I had
luck in the past searching this forum for FTP CL examples.
that 1 guy
This is a discussion on FTP from an internet site to an AS400 - IBM AS400 ; I am trying to create a CL that will FTP from an Internet FTP site to a 400. I have never done this before. Can someone offer guidance as how to code this or where some code may already exist ...
I am trying to create a CL that will FTP from an Internet FTP site to
a 400. I have never done this before. Can someone offer guidance as
how to code this or where some code may already exist ?
I believe if you search this forum you will find some answers. I had
luck in the past searching this forum for FTP CL examples.
that 1 guy
il 06/02/2007 21.18, Scrive jay 40699704:
> I am trying to create a CL that will FTP from an Internet FTP site to
> a 400. I have never done this before. Can someone offer guidance as
> how to code this or where some code may already exist ?
>
FTP client get its input from a file named INPUT and puts its output in
a file named OUTPUT, if not found uses the screen. Knowing that, you can
override INPUT and OUTPUT to a source file members before entering FTP
command. In particular in INPUT member you should put all ftp commands
as you would enter through the keyboard.
A tipical FTP session would be:
open remote_ftp_host_or_IP_address
user user_id user_password
get input_file
gut output_file
quit
To use the above session, assuming they are records of INPUT member of
QTXTSRC file, the cl whould do:
CLRPFM FILE(QTXTSRC) MBR(OUTPUT)
OVRDBF FILE(INPUT) TOFILE(QTXTSRC) MBR(INPUT)
OVRDBF FILE(OUTPUT) TOFILE(QTXTSRC) MBR(OUTPUT)
FTP dummy_host_name
DLTOVR FILE(INPUT)
DLTOVR FILE(OUTPUT)
You can avoid OUTPUT override, in this case if the cl will run in batch
it will output in a spooled file, interactive to the screen.
The dummy_host_name could be the name of a remote host or just a dummy
name if you put the open ftp command as in the example above.
--
Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'
I think the Dr U has answered your question but to finesse a tad.
I like to do this
RTVSYSVAL SYSVAL(QTIME) RTNVAR(&TIME)
CHGVAR VAR(&AUDIT) VALUE('R' *TCAT &time)
OVRDBF FILE(QSYSPRT) TOFILE(*LIBL/SYSPRT) MBR(&AUDIT)
Thus I can keep the spoolfile in an ever extending file for audit
reasons but more importantly I can text search the file for strings I
find of interest via an error checking program or just browse using a
simple sub-file program.
I can post source if you want but I do code like a drunken monkey.