× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: FTP Scripting
  • From: "Christopher A. Libby" <clibby@xxxxxxxxxxx>
  • Date: Tue, 1 Jun 1999 08:54:08 -0400

Here's some source code I took from an IBM manual...everything is located in
the same library and source file.  It's actually pretty straight forward
once you get going. - Chris

CL Source -
-----------------
PGM
/*,*-----CLEAR FTPLOGS--------------------------------------------*?*/
             CLRPFM     FILE(MISCLIBR/QCLSRC) MBR(FTPLOGS)
/*,*-----FTP FILE TO MPS------------------------------------------*?*/
         OVRDBF         FILE(INPUT)              +
                        TOFILE(MISCLIBR/QCLSRC)   +
                              MBR(FTPCMDS)
         OVRDBF         FILE(OUTPUT)             +
                        TOFILE(MISCLIBR/QCLSRC)   +
                              MBR(FTPLOGS)
         FTP            RMTSYS('')
         DLTOVR         FILE(INPUT OUTPUT)
/*,*-----TELL USER TO END FTP SERVER ON MPS-----------------------*?*/
             DSPPFM     FILE(MISCLIBR/QCLSRC) MBR(FTPLOGS)
             CPYF       FROMFILE(MISCLIBR/QCLSRC) TOFILE(*PRINT) +
                          FROMMBR(FTPLOGS)
 ENDALL:
 END:        ENDPGM

FTPCMD File (Edited) -
----------------------------------
OPEN '***.*.*.***'
USER ****** *******
CD APCUST
LCD APCUST
STR R
EBC
PUT APPBR
CLOSE
QUIT

Sample FTPLOG File (Edited) -
---------------------------------------------
Output redirected to a file.
Input read from specified override file.
Number of arguments not valid for subcommand CONNECT.
Enter an FTP subcommand.
> OPEN '***.*.*.***'
Connecting to remote host ***.*.*.*** using port 21.
220-QTCP at MPS.
220 Connection will close if idle more than 5 minutes.
 OS/400 is the remote operating system. The TCP/IP version is "V4R2M0".
Enter an FTP subcommand.
> USER ****** *******
331 Enter password.
230 AM2000 logged on.
250  Now using naming format "0".
257 "QGPL" is current library.
Enter an FTP subcommand.
> CD APCUST
250 Current library changed to APCUST.
Enter an FTP subcommand.
> LCD APCUST
Local working directory is APCUST
Enter an FTP subcommand.
> STR R
250 Data structure is record.
Using structure R to transfer files.
Enter an FTP subcommand.
> EBC
200 Representation type is EBCDIC nonprint.
Enter an FTP subcommand.
> PUT APPBR
250  Now using naming format "0".
257 "APCUST" is current library.
200 PORT subcommand request successful.
150 Sending file to member APPBR in file APPBR in library APCUST.
250 File transfer completed successfully.
2016 bytes transferred in 0.425 seconds. Transfer rate 4.746 KB/sec.
Enter an FTP subcommand.
> CLOSE
221 QUIT subcommand received.
Enter an FTP subcommand.
> QUIT


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.