[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>

You are on a later version of FTPAPI than I am.  May not be significant, but that's one difference.  Have you stepped through the service program in debug?  Here's mine, after I created a pair of flat files with the same record length and used the exact same program I sent you:

Break here: eval      rc = ftp_get(fd: src: dst) and F22 to step into the function.
EVAL peSocket
PESOCKET = 0                                                            
EVAL peRemote                                                           
PEREMOTE =                                                              
          ....5...10...15...20...25...30...35...40...45...50...55...60  
     1   '/QSYS.LIB/BUCK.LIB/FTPS.FILE/FTPS.MBR                       ' 
EVAL peLocal                                                            
PELOCAL =                                                               
          ....5...10...15...20...25...30...35...40...45...50...55...60  
     1   '/QSYS.LIB/BUCK.LIB/FTPD.FILE/FTPD.MBR                       ' 

it does FTP_size() which fails (that's OK)
it does OpnFile() which succeeds
EVAL wwFD  
WWFD = 1

We're at the comment saying 'download into the file'
Step into FTP_getraw() with F22

SetType() OK
portcmd() OK
SendLine('RETR') OK

We're at the comment saying '150 opening transfer'
Reply() OK

We're at the comment saying 'Do the actual file transfer'
EVAL wkLineMode  
WKLINEMODE = 'R' 
Step into getbyrec() with F22

We're at 'get data connexions'
Check your record length!
EVAL peRecLen    
PERECLEN = 80    

We're at the DOU 1=0
FD_ZERO() OK
FD_SET() OK
select() OK
FD_ISSET() true (OK)

We're at 'receive the data'
step over recv() and check wwRC
 EVAL wwRC 
 WWRC = 80  (in my case, the record length is 80, so this is right.)

This satisfies the DOu wwNeeded=0, and we drop through to add peReclen to wwBytes.  
Then the write_data() OK.  You may want to step into write_data() and watch what happens with peBuffer and RI_nBytes.  This has now put the first record into the file.  The loop spins to the top for the second record.  Step into the write_data() procedure with F22

You should now be in rf_write()  Look at peBuffer
EVAL peBuffer                                                            
PEBUFFER =                                                               
          ....5...10...15...20...25...30...35...40...45...50...55...60   
     1   'line2                                                       '  

Rwrite() OK
EVAL RI_nbytes 
RI_NBYTES = 80 

When we come out, wwRC should be 80, too.  And so on.  

When I let it run to completion, my FTPD file now has the exact same record count as FTPS.

Sorry to take up all the bandwidth, but I wanted to show how easy it is to track through the code with F22, and watch the data move between the source and destination.

Of course, now that I think you are using flat files (remember me saying I used identical DDS described files?) I think you have two different record lengths.  Do a DSPFFD on each file and check to make sure they are really identical.
  --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
-----------------------------------------------------------------------