/************************************************************************/ /* File: FTPCPP.QRPGLESRC Precompiler for generic Compile of objects */ /* Copyright (C) 2002 Dieter Bender */ /* */ /* 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. */ /* */ /* 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 */ /* You might find a version at http://www.gnu.org */ /************************************************************************/ H copyright('Dieter Bender 03/2002 ') FQFTPSRC UF A E K DISK USROPN F RENAME(QFTPSRC:QFTPSRCR) /* compile with PreCompiler CRTCPP or use: D*B CRTRPGMOD FTPCPP D*B+ DBGVIEW(*SOURCE) D*B+ REPLACE(*YES) D*B CRTPGM FTPCPP ACTGRP(FTPCPP) BNDDIR(QC2LE) D*B+ DETAIL(*FULL) /*--- import Prototypes /COPY QRPGLEH,SYSTEM /COPY QRPGLEH,FTPCPP /*--- local Prototypes D Work PR /*--- Constants D TRUE C *ON D FALSE C *OFF /*--- Main Interface D FTPCPP PI D SystemName 32A CONST D FtpUser 10A CONST D Password 10A CONST D FtpMode 10A CONST D Direction 3A CONST D Fromfile 32A CONST D Tofile 32A CONST /*--- very unimportant procedure main ------------------------*/ C C Callp Work C return /*============================================================*/ P Work B /*------------------------------------------------------------*/ C callp system('DLTF QTEMP/QFTPSRC') C callp system('CRTSRCPF QTEMP/QFTPSRC') C callp system('ADDPFM QTEMP/QFTPSRC IN') C callp system('ADDPFM QTEMP/QFTPSRC OUT') c C callp system('OVRDBF QFTPSRC QTEMP/QFTPSRC' C + ' IN OVRSCOPE(*JOB)') C open QFTPSRC C eval SRCDTA = FtpUser + ' ' + Password C write QFTPSRCR C eval SRCDTA = FtpMode C write QFTPSRCR C eval SRCDTA = Direction + ' ' + C %trim(FromFile) + ' ' + C %trim(ToFile) C write QFTPSRCR C eval SRCDTA = 'quit' C write QFTPSRCR c C close QFTPSRC C callp system('DLTOVR QFTPSRC LVL(*JOB)') c c callp system('OVRDBF INPUT QTEMP/QFTPSRC' C + ' IN OVRSCOPE(*JOB)') c callp system('OVRDBF OUTPUT QTEMP/QFTPSRC' C + ' OUT OVRSCOPE(*JOB)') c callp system('FTP ' + %trim(SystemName)) c callp system('CPYSRCF QTEMP/QFTPSRC ' c + '*PRINT OUT') c callp system('DLTOVR *ALL LVL(*JOB)') c C return P Work E