× 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 group,

I'm in the middle of writing my first program using Scott's FTPAPI service
program.

For some reason I cannot seem to get it to work using LIB/FILE.MEMBER
format, but it does work when using /qsys.lib notation.

What could I be doing wrong? The communication is between 2 iSeries
servers, both at V5R3:

d connection s 10i 0 inz
d objnampr s 10a inz('M08')
d objlibpr s 10a inz('PDMEXT')
d objtyppr s 10a inz('*FILE')
d returnpr s n inz
d msg_locked s 80a inz('The reservation file is -
d locked, try again when it is -
d available')
d msg_error s 80a inz
d msg_Ok s 80a inz('The reservation file was -
d copied to the PDM zone')
d rc s 10i 0 inz
****** constanten
d c_host c '********'
d c_user c '********'
d c_pass c '********'
d c_remote c '/qsys.lib/MCSDTA.lib/M08.file'
d c_local c '/qsys.lib/PDMEXT.lib/M08.file'
** Program ds
/COPY qrpglecpy,DSSTATUS
****** Constanten
** prototypes
/copy qrpglecpy,prqc2le
/copy qrpglecpy,ftpapi_h
/copy qrpglecpy,prpdsyov05
/copy qrpglecpy,prpdsydt01

//**----------------------------------------------------------------***
//** parameter list *entry ***

//**----------------------------------------------------------------***

DPDIFPR33 PR

DPDIFPR33 PI

/free

Reset msg_locked;
Reset objnampr;
Reset objlibpr;
Reset objtyppr;
Reset returnpr;
Callp pdsyov05(objnampr:
objlibpr:
objtyppr:
returnpr);
If returnpr = *off;
Exsr GetFileFTP;
Else;
Callp pdsydt01(msg_locked);
EndIf;

*inlr = *on;
Return;

BegSr GetFileFTP;
connection = FTP_Conn(c_host:
c_user:
c_pass);
If connection < *zeros;
Callp pdsydt01(msg_error);
Else;
rc = FTP_NamFmt(connection:
1);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
rc = FTP_Sizereq(connection:
*off);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
rc = FTP_Logging(connection:
*on);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
rc = FTP_BinaryMode(connection:
*on);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
rc = FTP_get(connection:
c_remote:
c_local);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
callp pdsydt01(msg_ok);
EndIf;
EndIf;
EndIf;
EndIf;
EndIf;
rc = FTP_quit(connection);
EndIf;
EndSr;

If I do a call of FTP_NamFmt(connection:0) and use 'MCSDTA/M08' resp.
'PDMEXT/M08' for remote and local, the FTP_get returns an FTP_Errormsg
that says "No such path or directory."

Thanks,

Peter Colpaert
Application Developer
PLI - IT - Kontich, Belgium
-----
Yoda of Borg are we. Futile is resistance, assimilated will you be.
-----

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.