× 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.



Hi Aaron,

I've called FTP from an RPG program with QCMDEXC before, so for what it's
worth, it's possible :)

One idea would be the scope of your override.  Remember, when you call
QCMDEXC with an OVRDBF, it will scope the override to the same actgrp as
your RPG program.  That's well and good, but the FTP command is what needs
to use it, not the RPG program :)

so, if your RPG program is not compiled with DFTACTGRP(*YES), your code
won't work.   In fact, you'd probably have to change the OVRDBF to do a
OVRSCOPE(*JOB).   (Which I really don't like to use....)

The next idea is...  you aren't checking for the CALL to QCMDEXC to fail.
What if it fails, then what?   You really should be finding some way to
find out which error message has occurred, and report it somehow.
Otherwise, when something goes wrong, all you can do is trial-and-error,
since you don't know what happened :)

As Dan pointed out, you might also want to try putting quotes around the
IP address.

You also might find my FTPAPI service program helpful.  The difference
there is that you issue the FTP commands yourself, instead of writing a
script, and then calling IBM's command.   Sure, writing an FTP script is
very simple, easy to do, etc...   but it's only easy if the FTP works all
of the time, and we all know that's not going to happen :)   With FTPAPI,
you can determine if things worked or didn't work much easier, you can
handle errors much better, you can handle "conditional situations" much
better (for example, doing something differently when a file exists or
doesn't exist)

And FTPAPI is open-source and completely free of charge.   So, it may be
worth a look :)


On Thu, 25 Apr 2002, Bartell, Aaron L. (TC) wrote:
>
> I know how to dynamically build an FTP script in an RPG program and then
> execute that script from a CL program with the FTP CL command, but I am
> wondering if I can do a QCMDEXC from within a RPG program and get the same
> results?
>
> I am basically trying to take all of the FTP processes out of the CL program
> and put it into the RPG program for reasons I don't wish to take the time to
> explain.
>
> Here is what I am doing, but it doesn't seem to be executing the FTP
> command.
>
>          qCmdCmd = 'OVRDBF FILE(INPUT) TOFILE(QTEMP/QFTPSRC)
> MBR(FTPSCRIPT)';
>          exsr $qCmdExc;
>
>          qCmdCmd = 'FTP RMTSYS(172.99.99.99)';
>          exsr $qCmdExc;
>
>        . . .
>
>      C     $qCmdExc      BEGSR
>      C                   call      'QCMDEXC'                            01
>      C                   parm                    qCmdCmd
>      C                   parm                    qCmdLen
>      C                   ENDSR
>
> note: Member FTPSCRIPT does have FTP commands in it to process.
>
> Anybody got any suggestions,
> Aaron Bartell
>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.