Rexx and FTP 
Author Message
 Rexx and FTP

I'm trying to whip up a short little rexx script to
FTP a set of files.  This way, I can d/l an index of files
from hobbes, edit the index and than use the file as input
to my rexx script to go out and get a bunch of files.
Now, my problem is that, while the ftp functions SEEM to be loaded,
when I try to call one of them I get an error that the routine
is not found.  The error message I captured from pmrexx
is:
   23 *-*   If ftpsetuser(targetsite, username, password) <> 0;
    23 +++   If ftpsetuser(targetsite, username, password) <> 0;
REX0043: Error 43 running D:\FTPREXX\ftprexx.cmd, line 23: Routine not found

The program is:
/* This program will, ftp a set of files  from an anonymous ftp site */
/* As parameters, this program takes: the host to connect to followed */
/* by the filename of the list of files to be ftpd */
trace i

Parse Arg targetsite ftpfiles remainder
username = "anonymous"

/* If the FtpSetUser function is not loaded, load it */
if RxFuncQuery('FtpLogoff') <> 0 then
  rc = RxFuncAdd('FtpLogoff','rxftp','FtpLogoff')

/* If the FtpGet function is not loaded, load it */
if  RxFuncQuery('FtpGet') <> 0 then
  rc = RxFuncAdd('FtpGet','rxftp','FtpGet')

/* open connection, if unsuccessfull report error and exit */
 if ftpsetuser(targetsite,username,password) <> 0 then
do
  say "Connect unsuccessfull, error was "||ftperrno
  exit(0)
end

/* While there are lines in the ftp file list, retrieve the */
/* filename of from each line, if it has a txt or TXT */
/* extention, set the ftp transfer type to aschii, otherwise it is binary */
/* The localname should be set to the remote name and place in the */
/* directory ftprexx on d */
do while Lines(ftpfiles) <> 0
   fileninfo = Linein(ftpfiles)
   Parse fileinfo remotefile remainder
   if (Pos('.txt.',remotefile) <> 0) | (Pos('.TXT',remotefile <> 0) then
     filetype  = 'aschii'
   else
     filetype = 'binary'
   pathlen = Lastpos("\",remotefile)
   localfile = "d:\ftprexx\"||delstr(remotefile,1,pathlen)

  /* Copies a single file from a remote
    host to your workstation          */
say "Retreiving "||remotefile||" as "||localfile||" using "||filetype
 rc = FtpGet(localfile,remotefile,filetype)

if rc = 0 then
  say "Successfull completion of retrieval"
else
  say "Retrieval unsuccessfull, error was "||ftperrno
end /* do */

/* Close the ftp file list */
rc = lineout(ftpfiles)

 /* Ends all FTP sessions with the
    remote host                     */

 rc = FtpLogoff()

/* quit */
exit(0)

So, does anyone have any idea why this is failing?  Am I
missing something dreadfully obvious here or what?

-Gary Mort



Tue, 30 Sep 1997 03:00:00 GMT  
 Rexx and FTP

Quote:

>Now, my problem is that, while the ftp functions SEEM to be loaded,
>when I try to call one of them I get an error that the routine
>is not found.  The error message I captured from pmrexx
>is:
>   23 *-*   If ftpsetuser(targetsite, username, password) <> 0;
>    23 +++   If ftpsetuser(targetsite, username, password) <> 0;
>REX0043: Error 43 running D:\FTPREXX\ftprexx.cmd, line 23: Routine not found
>-Gary Mort


Gary -

What happens if you try FtpSetUser instead of ftpsetuser?

- Keith

--
--------------------------------------------------------------------------
Keith Bennett                             Bennett Business Solutions, Inc.
Silver Spring, MD USA                     OS/2 & DOS Software Development



Sun, 09 Nov 1997 03:00:00 GMT  
 Rexx and FTP

Quote:

>>Now, my problem is that, while the ftp functions SEEM to be loaded,
>>when I try to call one of them I get an error that the routine
>>is not found.  The error message I captured from pmrexx
>>is:
>>   23 *-*   If ftpsetuser(targetsite, username, password) <> 0;
>>    23 +++   If ftpsetuser(targetsite, username, password) <> 0;
>>REX0043: Error 43 running D:\FTPREXX\ftprexx.cmd, line 23: Routine not found
>>-Gary Mort

>What happens if you try FtpSetUser instead of ftpsetuser?

Hiya, Keith, :)

Should be no difference whatsoever, as REXX converts the symbol that
is the function name (ftpsetuser) to uppercase before calling, anyhoo
(TRL2, pg. 21).

Most likely, Gary, you ended up registering the RxFtp package by
following the marvelously incorrect .INF file - the third parameter
in the RxFuncAdd call *must* be FtpLoadFuncs, *not* FTPLoadFuncs, as
is described there.  There is actually an APAR open against this. ;>

Quote:
>- Keith

---
/============\   Jason Tiller  /======================================\
| Welcome to |                 | Voyager 2 emits less power than your |
| -> JPL <-/=======================\refrigerator light bulb - yet we  |
\==========|  Do *you* know where  |track it 6.4 *billion* km away!   |
   The     |  your spacecraft is?  |==================================/



Sun, 09 Nov 1997 03:00:00 GMT  
 Rexx and FTP

Quote:

>>Now, my problem is that, while the ftp functions SEEM to be loaded,
>>when I try to call one of them I get an error that the routine
>>is not found.  The error message I captured from pmrexx
>>is:
>>   23 *-*   If ftpsetuser(targetsite, username, password) <> 0;
>>    23 +++   If ftpsetuser(targetsite, username, password) <> 0;
>>REX0043: Error 43 running D:\FTPREXX\ftprexx.cmd, line 23: Routine not found

>What happens if you try FtpSetUser instead of ftpsetuser?

There's a case sensitivity problem, but it's at the point where the
rxFuncAdd() function is called with FtpLoadFuncs.  Use the exact
same case as in the following:

  rc = RxFuncAdd("FtpLoadFuncs","RxFtp","FtpLoadFuncs")

Patrick Mueller  | IBM Software Solutions, Cary NC; 919-469-7242, tie 883

                 | home page: http://pmuellr.cary.ibm.com (sorry, IBMer's only)



Mon, 10 Nov 1997 03:00:00 GMT  
 Rexx and FTP
:>Most likely, Gary, you ended up registering the RxFtp package by
:>following the marvelously incorrect .INF file - the third parameter
:>in the RxFuncAdd call *must* be FtpLoadFuncs, *not* FTPLoadFuncs, as
:>is described there.  There is actually an APAR open against this. ;>
What package is this and where can I get it?

Greetings,

  Erik Hendrix
  [TEAM OS/2]  [ACTIVE MEMBER OS/2 USERGROUP BELGIUM]

   Sysop of THE ULTIMATE BBS  (32-3-6452744)

 Ways to contact me :


 Fidonet  : 2:292/833.0
 OS2Net   : 81:432/202.0



Wed, 12 Nov 1997 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. IBM Object Rexx and FTP

2. rexx and FTP

3. REXX and FTP API's

4. rexx and ftp

5. REXX and FTP

6. Can Rexx issue ftp commands in OS/2?

7. using REXX with FTP under OS2

8. REXX and FTP

9. Squeak FTP site established: ftp://ftp.create.ucsb.edu/pub/Smalltalk/Squeak

10. My ftp site (ftp://ftp.iag.net/pub/clipper)

11. Rexx ftp problem

12. FTP in OS/390 MVS REXX

 

 
Powered by phpBB® Forum Software