Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.
Gilly400 | Apr 1 2008 12:33PM GMT
Hi,
I also have a PC batch file (for windows XP) which I sometimes use for basic FTP transfers. This doesn’t do any error checking, it’s just a quick and dirty front end to <a href="http://FTP." rel="nofollow">FTP.</a> Just cut and paste the text under this into a PC text file and save as something like FTPFIL.BAT
Cheers,
Martin Gilbert.
@REM
@REM *****************************************
@REM *** FTPFIL.BAT ***
@REM *** ============= ***
@REM *** FTP file between PC and AS400s ***
@REM *** ***
@REM *** Written by Martin Gilbert ***
@REM *** October 2007 ***
@REM *** V1.0 ***
@REM *** ***
@REM *****************************************
@REM
@color 0c
@cls
@REM *****************************************
@REM First enter all the parameters necessary
@REM ========================================
@REM
@REM cls between system name, user id password
@REM and putget to avoid showing all these
@REM parameters on the screen at the same time
@REM
@REM *****************************************
@echo .
@set /p sysnam=Please enter the AS400 system name………………:
@if “%sysnam%”=="" goto nosysnam
@cls
@echo .
@set /p user=Please enter your User Id………………………:
@if “%user%”=="" goto nouser
@cls
@echo .
@set /p pass=Please enter your password……………………..:
@if “%pass%”=="" goto nopass
@cls
@echo .
@set /p putget=Please enter put (to as400) or get (from as400)…..:
@if “%putget%”=="" goto noputget
@echo .
@set /p pcfile=Please enter the PC file name…………………..:
@if “%pcfile%”=="" goto nopcfile
@echo .
@set /p aslib=Please enter the AS400 library………………….:
@if “%aslib%”=="" goto noaslib
@echo .
@set /p asfile=Please enter the AS400 file name………………..:
@if “%asfile%”=="" goto noasfile
@echo .
@set /p mode=Please enter the ASCII or BIN for transfer mode…..:
@if “%mode%”=="" goto nomode
@echo .
@cls
@REM *****************************************
@REM Show status messages
@REM *****************************************
@echo .
@if “%putget%”=="put” echo Sending file %pcfile%
@if “%putget%”=="put” echo To system %sysnam%
@if “%putget%”=="put” echo In library %aslib% as %asfile%
@if “%putget%”=="get” echo Retrieving file %asfile% In library %aslib%
@if “%putget%”=="get” echo From system %sysnam%
@if “%putget%”=="get” echo To file %pcfile%
@echo Using %mode% mode
@echo Please wait
@REM *****************************************
@REM Delete old files
@REM *****************************************
@echo .
@if exist FTPFIL.FTP del /Q FTPFIL.FTP > NUL
@if exist FTPFIL.LOG del /Q FTPFIL.LOG > NUL
@REM *****************************************
@REM Build FTP script
@REM *****************************************
@echo .
@echo Building FTP script
@echo .
@echo %user% > FTPFIL.FTP
@echo %pass% >> FTPFIL.FTP
@echo %mode% >> FTPFIL.FTP
@echo CD %aslib% >> FTPFIL.FTP
@if “%putget%”=="put” echo put %pcfile% %asfile% >> FTPFIL.FTP
@if “%putget%”=="get” echo get %asfile% %pcfile% >> FTPFIL.FTP
@echo quit >> FTPFIL.FTP
@REM *****************************************
@REM Run the FTP script
@REM *****************************************
@FTP -s:FTPFIL.FTP %sysnam% > FTPFIL.LOG
@cls
@REM *****************************************
@REM Delete the FTP script IMPORTANT !
@REM FTP script contains user and password !
@REM *****************************************
@if exist FTPFIL.FTP del /Q FTPFIL.FTP > NUL
@REM *****************************************
@REM Send completion message
@REM *****************************************
@echo .
@echo FTP session completed
@echo .
@goto end
@REM
@REM *****************************************
@REM *** Error handling. ***
@REM *****************************************
@REM
@REM *****************************************
:nosysnam
@echo .
@echo AS400 system name not entered
@echo Please try again
@echo .
@goto end
@REM *****************************************
:nouser
@echo .
@echo No user entered
@echo Please try again
@echo .
@goto end
@REM *****************************************
:nopass
@echo .
@echo No password entered
@echo Please try again
@echo .
@goto end
@REM *****************************************
:noputget
@echo .
@echo put or get must be entered
@echo Please try again
@echo .
@goto end
@REM *****************************************
:nopcfile
@echo .
@echo PC file name not entered
@echo Please try again
@echo .
@goto end
@REM *****************************************
:noaslib
@echo .
@echo AS400 library name not entered
@echo Please try again
@echo .
@goto end
@REM *****************************************
:noasfile
@echo .
@echo AS400 file name not entered
@echo Please try again
@echo .
@goto end
@REM *****************************************
:nomode
@echo .
@echo Transfer mode not entered
@echo Enter ASCII or BIN
@echo Please try again
@echo .
@goto end
@REM *****************************************
@REM *** End of program. ***
@REM *****************************************
@REM
:end
@pause
:exit