Hi,
Please help refresh my memory and/or figure this out...
A while back, I created a process that includes a CLLE program (called from an RPG that first calls it with parm "LIST" and later repeatedly with "GET" for each file) that runs an FTP script that goes out to a (non IBM i) FTP server to first get a list of files and then pulls them down and processes each one. It's been running great twice a day for a couple of years. It does this:
The FTP script "FTPECIMP01" that gets the list of files looks like this:
This morning, it suddenly isn't pulling down the list of files, but is instead timing out on the host server. Today the job takes a long time and then ends, and when I look in the FTP log after my LS (DISK command, it says first "229 Extended Passive mode OK (|||31770|)" and then "No response from remote host; all connections closed." At first I thought maybe it is a problem with the host FTP server, but I am able to FTP manually with FileZilla and see the files there. I also noticed in my program's joblog that I get the message that file LSOUTPUT does not exist, and sure enough I do not see LSOUTPUT on my system. Not sure if that message is usually there or not or if that's the problem or not? I override it to another file FECLIST anyway, so I'm not actually even populating LSOUTPUT.
Question: How does LSOUTPUT initially get created? I don't recall manually creating it way back when but maybe I did? Or should it get created automatically when I do "LS (DISK" ?
I then tried creating LSOUTPUT manually with CRTPF FILE(LSOUTPUT) RCDLEN(256) MAXMBRS(*NOMAX) and then rerunning the process, but although I don't get the message in the joblog about LSOUTPUT not existing anymore, it still takes a long time and I do not get the listing.
Not sure if I need to contact the server people at the place where I'm getting the files, or if the problem is mine.
Any insight would be appreciated. Thanks.
Please help refresh my memory and/or figure this out...
A while back, I created a process that includes a CLLE program (called from an RPG that first calls it with parm "LIST" and later repeatedly with "GET" for each file) that runs an FTP script that goes out to a (non IBM i) FTP server to first get a list of files and then pulls them down and processes each one. It's been running great twice a day for a couple of years. It does this:
Code:
PGM PARM(&FUNC)
DCL VAR(&FUNC) TYPE(*CHAR) LEN(4)
/*-- Set up FTP script to execute based on incoming function parm */
IF COND(&FUNC *EQ 'LIST') THEN(CALLSUBR SUBR(LIST))
IF COND(&FUNC *EQ 'GET ') THEN(CALLSUBR SUBR(GET))
/*-- Execute FTP script */
STRTCPFTP RMTSYS('xx.xxx.xxx.xx') CCSID(*DFT) PORT(21) +
TBLFTPOUT(QASCII)
/*-- Delete overrides */
DLTOVR FILE(*ALL) LVL(*JOB)
/*------------------------------------------------------------------*/
/* LIST: Get the list of files to be processed from FTP server */
/*------------------------------------------------------------------*/
SUBR SUBR(LIST)
CHGCURLIB CURLIB(MYLIB)
/*-- Specify the PF to receive the list of file names and get it ready */
OVRDBF FILE(LSOUTPUT) TOFILE(MYLIB/FECLIST) +
MBR(FECLIST) OVRSCOPE(*JOB)
CLRPFM FILE(MYLIB/FECLIST)
/*-- Set up the FTP script and FTP log file to be used to list files */
OVRDBF FILE(INPUT) TOFILE(MYLIB/MYSRCF) +
MBR(FTPECIMP01) OVRSCOPE(*JOB)
OVRDBF FILE(OUTPUT) TOFILE(MYLIB/FTPECLOG) +
MBR(ECIMP01) OVRSCOPE(*JOB)
/*-- Clear FTP log file */
CLRPFM FILE(MYLIB/FTPECLOG) MBR(ECIMP01)
ENDSUBR
/*-------------------------------------------------------------------*/
/* GET: Pick up the order file from the remote FTP server */
/*-------------------------------------------------------------------*/
SUBR SUBR(GET)
/*-- Set up the FTP script and FTP log file to be used to pick up files */
OVRDBF FILE(INPUT) TOFILE(MYLIB/MYSRCF) +
MBR(FTPECIMP02) OVRSCOPE(*JOB)
OVRDBF FILE(OUTPUT) TOFILE(MYLIB/FTPECLOG) +
MBR(ECIMP02) OVRSCOPE(*JOB)
/*-- Clear FTP log file */
CLRPFM FILE(MYLIB/FTPECLOG) MBR(ECIMP02)
ENDSUBR
/*-------------------------------------------------------------------*/
QUIT: ENDPGM
Code:
OPEN 'xx.xxx.xxx.xx' USER myusername mypassword ASCII Namefmt 1 LS (Disk CLOSE QUIT
Question: How does LSOUTPUT initially get created? I don't recall manually creating it way back when but maybe I did? Or should it get created automatically when I do "LS (DISK" ?
I then tried creating LSOUTPUT manually with CRTPF FILE(LSOUTPUT) RCDLEN(256) MAXMBRS(*NOMAX) and then rerunning the process, but although I don't get the message in the joblog about LSOUTPUT not existing anymore, it still takes a long time and I do not get the listing.
Not sure if I need to contact the server people at the place where I'm getting the files, or if the problem is mine.
Any insight would be appreciated. Thanks.





Comment