**********************************************************************************************
      * DBG190R4: Work with Output WRKOUTQ-WRKSPLF - Batch FTP setup
      * Copyright (C) 2000  Martin Rowe   <martin@dbg400.net>
      *
      * This program is free software; you can redistribute it and/or modify
      * it under the terms of the GNU General Public License as published by
      * the Free Software Foundation; either version 2 of the License, or
      * (at your option) any later version.
      *
      * This program is distributed in the hope that it will be useful,
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      * GNU General Public License for more details.
      *
      * You should have received a copy of the GNU General Public License
      * along with this program; if not, write to the Free Software
      * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
      **********************************************************************************************
     H DATEDIT(*YMD) DEBUG(*YES) OPTION(*NODEBUGIO : *SRCSTMT)
      **********************************************************************************************
      * FILES:
      **********************************************************************************************
     FFTPSRC    O    E             DISK    RENAME(FTPSRC : FTPDATA)
      **********************************************************************************************
      * WORK FIELDS:
      **********************************************************************************************
     D P#File          S             50A
     D P#FileExt       S              5A
     D P#FTPDir        S             60A
     D P#StmfDir       S             60A
     D P#RmtIP         S             15A
     D P#RmtUser       S             10A
     D P#RmtPass       S             10A
      **********************************************************************************************
      * ENTRY PARAMETERS:
      **********************************************************************************************
     C     *ENTRY        PLIST
     C                   PARM                    P#File
     C                   PARM                    P#FileExt
     C                   PARM                    P#StmfDir
     C                   PARM                    P#FTPDir
     C                   PARM                    P#RmtIP
     C                   PARM                    P#RmtUser
     C                   PARM                    P#RmtPass
      **********************************************************************************************
      * MAINLINE:
      **********************************************************************************************
     C                   EVAL      SRCDTA = 'open ' + P#RmtIP
     C                   WRITE     FTPDATA
     C                   EVAL      SRCDTA = 'user ' + %TRIM(P#RmtUser) +
     C                             ' ' + P#RmtPass
     C                   WRITE     FTPDATA
     C                   EVAL      SRCDTA = 'namefmt 1'
     C                   WRITE     FTPDATA
     C                   EVAL      SRCDTA = 'lcd ' + P#StmfDir
     C                   WRITE     FTPDATA
B001 C                   IF        P#FTPDir <> ' '
     C                   EVAL      SRCDTA = 'cd ' + P#FTPDir
     C                   WRITE     FTPDATA
E001 C                   ENDIF
     C                   EVAL      SRCDTA = 'put ' + %TRIM(P#File) +
     C                             P#FileExt + ' ' + %TRIM(P#File) + '.tmp'
     C                   WRITE     FTPDATA
     C                   EVAL      SRCDTA = 'rename ' + %TRIM(P#File) + '.tmp' +
     C                             ' ' + %TRIM(P#File) + P#FileExt
     C                   WRITE     FTPDATA
     C                   EVAL      SRCDTA = 'quit'
     C                   WRITE     FTPDATA
     C                   EVAL      *INLR = *on
     C                   RETURN
      **************************************************************************
Topic revision: r1 - 26 May 2005 - 19:43:41 - MartinRowe
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding DBG/400? Send feedback