|
Dan: This is a portion of a program we run to see if our FTP was successful. Its a Simple example but it works: I just sent the portion because there is a lot of other stuff being done that will just confuse the situation. The INPUT is built containing the FTP commands prior to the FTP seen below. DCL VAR(&SYS) TYPE(*CHAR) LEN(48) + /* System name of the system that the file + transfer is going to occur on. */ DCL VAR(&PORT) TYPE(*CHAR) LEN(5) /* Port Number + for use with FTP command. This field is + alpha for use as PARM, but is handled as + numeric within $FTPXFR program. */ DCL VAR(&RMV) TYPE(*CHAR) LEN(1) /* + Remove file if successful send + Y = Yes remove the File after Transfer + N = DO not remove the file */ DCL VAR(&DIR) TYPE(*CHAR) LEN(1) /* Direction + that the data is being transferred. + 1 = Sending AS400 to another system + 2 = Receiving from another system to AS400 */ File Name */ /* */ /* DECLARE TEMPORARY FILE TO CHECK AFTER FILE HAS BEEN */ /* TRANSFERRED. */ /* */ DCLF FILE(*LIBL/SYTXO) OVRDBF FILE(INPUT) TOFILE(QTEMP/SYTXI) MBR(*FIRST) OVRDBF FILE(OUTPUT) TOFILE(QTEMP/SYTXO) MBR(*FIRST) /* */ /* SEND MESSAGE TO USER'S DISPLAY STATING THAT THE COMMAND */ /* US RUNNING. */ /* */ SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) + MSGDTA('File transfer is being executed.') + TOPGMQ(*EXT) MSGTYPE(*STATUS) /* EXECUTE FTP COMMAND */ /* */ FTP RMTSYS(&SYS) PORT(&PORT) OVRDBF FILE(SYTXO) TOFILE(QTEMP/SYTXO) MBR(*FIRST) READNEXT: RCVF /* */ /* CHECK FOR END OF FILE */ /* */ MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(MSG)) /* + Monitor for End of File Message. Go to + end of program when end of file is + encountered. */ CHGVAR VAR(&CMPRCD) VALUE(&XORCD) IF COND(&CMPRCD *EQ '226 Transfer complete.') + THEN(DO) CHGVAR VAR(&TRANS) VALUE('Y') /* TRANSFER WAS SUCESSFUL. CHECK TO SEE IF THE FILE SHOULD BE */ /* REMOVED. */ IF COND((&RMV = 'Y') *AND (&DIR = '1')) THEN(DO) /* RMVLNK TO REMOVE FILES OUT OF THE IFS */ RMVLNK &LCLNM MONMSG MSGID(CPF0000) EXEC(DO) /* IF RMVLNK DOES NOT WORK TRY THE DLTF */ DLTF FILE(&FLIB/&FFILE) MONMSG MSGID(CPF0000) ENDDO ENDDO GOTO CMDLBL(DLTOVR) ENDDO GOTO CMDLBL(READNEXT) /* */ /* IF WE are HERE, THE TRANSFER DID NOT WORK */ /* */ MSG: OVRPRTF FILE(QSYSPRT) OUTQ(JOBLOG) FORMTYPE(DAYS30) + HOLD(*YES) /* */ /* PRINT COPIES OF THE FTP FILE TRANSFER COMMANDS. */ /* */ /******** CPYF FROMFILE(QTEMP/SYTXI) TOFILE(*PRINT) *********/ CPYF FROMFILE(QTEMP/SYTXO) TOFILE(*PRINT) /* */ /* RETRIEVE USER ID OF PERSON RUNNING THIS JOB */ /* */ RTVJOBA USER(&USRID) ....We then inform the user if it did not work Dan wrote: >Does anyone have a program / routine that will read through an FTP log >and check for errors? Searching the archives turned up someone who >said they had something that did this, but gave no details. >TIA, 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.