+1 again! on Scott's work. As I said in another post, every step can be
monitored. This means that you don't have to scan the output for errors.
With a script, the FTP client will try to run everything, even when an
error has occurred. Even when login failed, for example.
Use the API!!
Vern
On 3/10/2013 4:00 PM, Alan Campin wrote:
Usa Scott's FTPAPI. You will find a utility at
www.think400.dk/downloads.htmunder FTPOBJ. It has all the code you
would need to use Scott's utility.
On Sun, Mar 10, 2013 at 2:19 PM, Booth Martin <booth@xxxxxxxxxxxx> wrote:
Here is what I did 15 years ago:
...
CPYF FROMFILE(FTP20P2) TOFILE(QTEMP/FTP20P2)
FROMMBR(*ALL) TOMBR(*FROMMBR) +
MBROPT(*NONE) CRTFILE(*YES)
MONMSG MSGID(CPF2817)
CLRPFM FILE(QTEMP/FTP20P2) MBR(FTPCMDS)
OVRDBF FILE(FTP20P2) TOFILE(QTEMP/FTP20P2) MBR(FTPCMDS)
OVRDBF FILE(INPUT) TOFILE(QTEMP/FTP20P2) MBR(FTPCMDS)
/* OVRDBF FILE(OUTPUT) TOFILE(QTEMP/FTP20P2) MBR(FTPLOG) */
/* By commenting this command the FTP process prints the +
log file to the screen. Uncommenting the command will +
print and save the log in ____/FTP20P2/FTPLOG */
IF COND(&EXIT *EQ 'LOG') THEN(OVRDBF FILE(OUTPUT)
TOFILE(QTEMP/FTP20P2) +
MBR(FTPLOG))
FTP RMTSYS(&M1HOST)
...
File FTP20P2 is a script file built with RPG that has the script for the
FTP session. That is pretty straight forward to do, including catting
in the file name for each FTP session.
The whole process is shown at
http://www.martinvt.com/Subfiles/FTP_Utility/ftp_utility.html
But all you are really interested in is the idea of creating the script
file and then copying it to QTEMP and then overriding the file INPUT to
the script's QTEMP/file/member.
On 3/9/2013 10:41 AM, Eric Lehti wrote:
Issue: Want FTP to run unattended in batch mode, and transmit a
different file name each time.
Do you have a suggestion?
The base code I am working from is :
http://www.itjungle.com/tfh/tfh070703-story04.html
The published example shows the FTP script of subcommands stored in a
source member in a source physical file, which I edited with SEU.
Example:
REIN
USER [username] [password]
locsite namefmt 1
CD INBOUND
LCD /QSYS.LIB/C130308A.LIB
ASCII
PUT BATCHSCRIP.FILE
QUIT
/END
The file name BATCHSRIP.FILE is hard-coded in the source member.
Users want the FTP to run every hour and transmit a different file name
each time.
File name would need to be supplied as a parameter.
Appears to me that I would need to recreate the source member every
hour, changing the put statement with the new file name.
Seems very cumbersome to do it this way.
Is there a better technique for transmitting files whose names change
all the time?
--
Booth Martin
802-461-5349
http://www.martinvt.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.