[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Not coming in record by record (was: Changing Local Directory)
owner-ftpapi@xxxxxxxxxxxxx wrote on 02/09/2005 09:53:01
AM:
> 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 = ''
> 
>      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
> 
I took your program and placed it on our iSeries and
only changed the user, pass, and paths.  When I try to run it, I receive
the following error:
DSPLY  Unable to build a physical file to receive
data into
Job log looks like this:
0: FTPAPI version 2.0beta3 released on 2004-06-24
      
5: 220-QTCP at LOCALHOST.        
                     
5: 220 Connection will close if idle more than 5 minutes
5: > USER beckenrod        
                     
       
5: 331 Enter password.        
                     
       
5: > PASS **********        
                     
         
5: 230 BECKENROD logged on.        
                     
   
5: > TYPE I          
                     
                
5: 200 Representation type is binary IMAGE.  
              
5: > SIZE /QSYS.LIB/EDFTPTEST.LIB/ TESTFILE.FILE/TESTFILE.MB
5: 500 Subcommand SIZE not valid.      
                    
File TESTFILE in library BECKENROD already exists.
         
DSPLY  Unable to build a physical file to receive
data into 
5: > QUIT            
                     
                
5: 221 QUIT subcommand received.
For some reason it is not allowing the file to be
replaced.  I checked permissions on the target file and *PUBLIC has
*ALL, so that should not be an issue.
I rebuilt the API using the XML install (did not download
again, just rebuilt from what I had).
Any ideas?
Thanks again,
Brian