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

RE: Not coming in record by record (was: Changing Local Directory)



Sender: "Calabro, Buck" <Buck.Calabro@xxxxxxxxxxxx>

Hi Brian,

> I am FTP'ing to/from the same iSeries, 
> just for testing.  I have a physical 
> file in a library called EDFTPTEST and 
> the file is called TESTFILE. 

The same box shouldn't be a problem.  At least, it works here.

> I connect to the local iSeries, 
> change to that library, and then 
> pull the file back as 
> \qsys.lib\mylib.lib\testfile.file\testfile.mbr.  
> I am using BINARY mode.  
>
> The FTP completes normally with no issues, 
> but only the first record of the file is 
> brought back.  

I replicated this as closely as I could.  I copied an existing file called MASTER to a new file called FTPS and also to FTPD (FTP source and destination respectively).  I changed the member names to FTPS and FTPD, and cleared FTPD.  Now, I have a scenario that matches yours.  A source (from) database file that is described via DDS and a destination (to) database file that is it's exact clone, but empty.  I ran this program:
     h/copy qrpglesrc,stdhspec
      * dbgview(*list)

      /copy ftpapisrc,ftpapi_h

     d fd              s             10i 0
     d rc              s             10i 0
     d src             s             52a
     d dst             s             52a
     d myMachine       s             10a   inz('localhost')
     d myUser          s             10a   inz('BUCK')
     d myPass          s             10a   inz('mypass')
     d msg             s             52a

     c                   eval      fd = ftp_conn(myMachine:
     c                                           myUser:
     c                                           myPass)

     c                   eval      src = '/QSYS.LIB/BUCK.LIB/+
     c                                    FTPS.FILE/FTPS.MBR'

     c                   eval      dst = '/QSYS.LIB/BUCK.LIB/+
     c                                    FTPD.FILE/FTPD.MBR'

     c                   callp     ftp_binary(*on)

     c                   eval      rc = ftp_get(fd: src: dst)
     c                   if        rc <> 0
     c                   eval      msg = ftp_error
     c     msg           dsply
     c                   endif

     c                   callp     ftp_quit(fd)
     c                   eval      *inlr = *on

Note that I'm hard coding the full path name, which I think is the only difference from your scenario.  When this runs, CMPPFM shows that they are identical.  Here is what shows up in my job log:

call ftptst          
220-QTCP at LOOPBACK.
220 Connection will close if idle more than 5 minutes.
> USER BUCK                                           
331 Enter password.                                   
> PASS **********                                     
230 BUCK logged on.                                   
> SIZE /QSYS.LIB/BUCK.LIB/FTPS.FILE/FTPS.MBR          
500 Subcommand SIZE not valid.                        
> TYPE I                                              
200 Representation type is binary IMAGE.              
> PORT 127,0,0,1,20,114                               
200 PORT subcommand request successful.               
> RETR /QSYS.LIB/BUCK.LIB/FTPS.FILE/FTPS.MBR          
150-NAMEFMT set to 1.                                   
150 Retrieving member FTPS in file FTPS in library BUCK.
250 File transfer completed successfully.               
> QUIT                                                  
221 QUIT subcommand received.                           


> I did think of the manual FTP last 
> night after I sent my email and I tried it.  
> The file came over with no issues with 
> all the records filled in. 

Does this little program behave the same way on your machine?  I have a binding directory with FTPAPIR4 *LIBL in it which makes it easier for me to compile using my standard H spec.  If this program doesn't run for you the same as it does for me, I'm thinking that you have some issues with the service program.  Either re-create the service program from your current source or download the latest copy and re-create that.
  --buck


The information contained in this electronic mail transmission is intended by Communications Software Consultants, Inc. for the use of the named individual or entity to which it is directed
and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please notify the sender immediately and delete this
message from your system without copying or forwarding it.

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------