[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using FTPAPI to transfer physical files



   Michael - Yes; the file name is being trimmed:



   // Get files in compile-time array
   If Not P_Error;
     For X = 1 To %ELEM(File_Name);
       If Ftp_Get(Socket : %TRIM(File_Name(X))) < 0;
         P_Error = *ON;
         Msg = %TRIM(Msg) + ' ' + Ftp_Error();
         Leave;
       Endif;
     Endfor;
   Endif;

   This is what the compile-time array looks like:

   **CTDATA File_Name
   /QSYS.LIB/ARDTACM.LIB/ARVAL.FILE/ARVAL.MBR
   /QSYS.LIB/SHRDATALIB.LIB/SHUSR.FILE.SHUSR.MBR
   /QSYS.LIB/SHRDATALIB.LIB/SHNTU.FILE.SHNTU.MBR
   /QSYS.LIB/SHRDATALIB.LIB/SHXAS.FILE.SHXAS.MBR
   /QSYS.LIB/SHRDATALIB.LIB/SHXNT.FILE.SHXNT.MBR

   It's defined as

   D File_Name S 80A Dim(5) Ctdata Perrcd(1)

   On 7/23/08, Michael Ryan <[1]michaelrtr@xxxxxxxxx> wrote:

     Are you %TRIMming the names? Here's how I do it:
     // Get the file   (Session:Remote:Local)
     FmName = 'Weekly_Prodview.csv';
     ToName = '/wcslog/Weekly_Prodview.csv';
     If ftp_get(sess: %Trim(FmName): %Trim(ToName)) < 0;
     Logger('Could not get file...': *NULL);
     Success = -1;
     EndIf;
     - Michael
     On Tue, Jul 22, 2008 at 5:10 PM, Francis Lapeyre
     <[2]flapeyre@xxxxxxxxx> wrote:
     >
     >   Maybe I'm not understanding, but I'm having difficulty getting
     this to
     >   work.
     >
     >   In the olden days, without FTPAPI, I'd log into the other
     AS/400, set
     >   the mode to BINARY, cd [remotelib}, LCD [locallib], and then
     GET file
     >   (replace.
     >
     >   So, I'm trying to do the same with FTPAPI, and things are not
     working.
     >   I have enabled logging, and here is what I get:
     >
     >   2: 220-QTCP at [1][3]sblahblah.blahblah.com.
     >
     >   2: 220 Connection will close if idle more than 5 minutes.
     >
     >   2: > USER blahblah
     >
     >   2: 331 Enter password.
     >
     >   2: > PASS **********
     >
     >   2: 230 blahblah logged on.
     >
     >   2: > SITE NAMEFMT 1
     >
     >   2: 250 Now using naming format "1".
     >
     >   2: > TYPE I
     >
     >   2: 200 Representation type is binary IMAGE.
     >
     >   2: > SIZE '/QSYS.LIB/ARDTACM.LIB/ARVAL.FILE/ARVAL.MBR'
     >
     >   2: 500 Subcommand SIZE not valid.
     >
     >   2: > TYPE I
     >
     >   2: 200 Representation type is binary IMAGE.
     >
     >   2: > SIZE '/QSYS.LIB/SHRDATALIB.LIB/SHUSR.FILE.SHUSR.MBR'
     >
     >   2: 500 Subcommand SIZE not valid.
     >
     >   FTP_ERROR returns 'A path name is too long.' - but FTPAPI has a
     >   capacity of 256 bytes for the path name.
     >
     >   What could I be doing wrong?
     >
     >
     >
     >   --
     >   Francis Lapeyre
     >   Nullum gratuitum prandium.
     >
     > References
     >
     >   1. [4]http://sblahblah.blahblah.com/
     >
     >
     -------------------------------------------------------------------
     ----
     > This is the FTPAPI mailing list.  To unsubscribe, please go to:
     > [5]http://www.scottklement.com/mailman/listinfo/ftpapi
     >
     -------------------------------------------------------------------
     ----
     >
     >
     -------------------------------------------------------------------
     ----
     This is the FTPAPI mailing list.  To unsubscribe, please go to:
     [6]http://www.scottklement.com/mailman/listinfo/ftpapi
     -------------------------------------------------------------------
     ----

   --
   Francis Lapeyre
   Nullum gratuitum prandium.

References

   1. mailto:michaelrtr@xxxxxxxxx
   2. mailto:flapeyre@xxxxxxxxx
   3. http://sblahblah.blahblah.com/
   4. http://sblahblah.blahblah.com/
   5. http://www.scottklement.com/mailman/listinfo/ftpapi
   6. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------