|
Dan - A transfer message in the range of 100000 bytes and higher will use the first position. Here is what I use for a multiple file transfer: /* Override the files for the FTP. OVRDBF FILE(INPUT) TOFILE(FTPPARMS) MBR(*FIRST) OVRDBF FILE(OUTPUT) TOFILE(FTPOUT) MBR(&PGM) /* Run the FTP command. FTP RMTSYS(&SYSTEM) /* Delete the Override. DLTOVR FILE(INPUT OUTPUT) /* Ignore Level Checking for the subsequent Receive File command. OVRDBF FILE(FTPOUT) TOFILE(FTPOUT) MBR(&PGM) + LVLCHK(*NO) /* Read each record in the FTP Output file for Errors or Success. LOOP: RCVF /* End of file detected without a Success or Failure message. MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(FTPERROR)) /* Check for a Failure. IF COND((%SST(&FTPOUT 1 1) *EQ '4') *OR + (%SST(&FTPOUT 1 1) *EQ '5')) THEN(GOTO + CMDLBL(FTPERROR)) /* Check for a Success. IF COND(%SST(&FTPOUT 1 3) *EQ '250') THEN(GOTO + CMDLBL(CONT)) GOTO CMDLBL(LOOP) /* Get the FTP Transfer message when a successful FTP. CONT: RCVF /* Send the FTP Transfer message to the Requestor. SNDMSG MSG(&FTPOUT) TOUSR(*REQUESTER) /* This procedure should transfer THREE or FOUR files. CHGVAR VAR(&COUNTER) VALUE(&COUNTER + 1) IF COND(&COUNTER *LT &NOFILES) THEN(GOTO + CMDLBL(LOOP)) CHGVAR VAR(&CHARNO) VALUE(&NOFILES) SNDPGMMSG MSG('Transferred' *BCAT &CHARNO *BCAT + 'Files....') By checking for a successful message, usually 226 or 250 you can send the "123 bytes transferred" message to the display or a log file and avoid reading it as an error. The actual message code and verbage vary somewhat between different servers, so your mileage may vary.... Regards, Scott Ingvaldson AS/400 System Administrator GuideOne Insurance Group -----Original Message----- Date: Wed, 29 Jan 2003 10:41:09 -0800 (PST) From: Dan <dbcemid@yahoo.com> Subject: Re: FTP log error checker Great article! Looks like I'm going to search for reply codes > 299 to determine whether an error occurred. This will be used to notify the user that "there *may* have been a problem, look at the log to verify." Can anyone tell me whether "123 bytes transferred", where 123 is any 3-digit number, will ever start in position 1 of the log? Or should I scan for "bytes transferred" to be on the safe side? Are there any other messages that have the potential of showing a 3-digit number in the first 3 positions of the log? - Dan
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.