How to FTP a file from PC to my personal library?

10 pts.
Tags:
AS/400
AS/400 FTP
RPG ILE
RPG IV
RPGLE
How to FTP a file from PC to my personal library?
ASKED: April 1, 2008  11:14 AM
UPDATED: April 1, 2008  12:33 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

1. Start an FTP session from your PC to your AS/400. From command type FTP hostname. (replace hostname with your hostname or IP address).

2. Type your user id and password when prompted.

3. Change working directory on your PC to where your file is. lcd directoryname.

4. Change working directory on AS/400 to your personal library. cd libraryname.

5. Select binary or ascii if necessary. BIN or ASC. You probably don’t need to do this if you’re just transferring text.

6. Transfer the file. PUT pcfilename as400filename (where pcfilename is the filename with the extension e.g. myfile.txt and the as400filename is a valid AS/400 object name – <= 10 characters long).

7. Exit the FTP session. quit.

That should be enough to get your file to the AS/400.

Regards,

Martin Gilbert.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Gilly400
    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 FTP. 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
    23,730 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following