Link to home
Start Free TrialLog in
Avatar of boukaka
boukakaFlag for Canada

asked on

ftp truncating records

Hi,

I have a vba application that is sending an ascii file via ftp to a server. There is a header, records and a footer in the file. Each record consists of a certain amount of text and ends with 1600 blank spaces. The ftp sends the file but truncates from the first blank space of the 1600 space section in the first record in the file right through to the footer but INCLUDES the footer.

I am sending using the following where nChars = 6047 (each record is 6046 chars long)

SendCommand("site lrecl=nChars recfm=fb cy pri=1000 sec=150")

So instead of, for example: (stuff in curly brackets is information - not actual data)

test header
test record1 {space}{space}{space}{space}{space} {etc...}
test record2 {space}{space}{space}{space}{space} {etc...}
test record3 {space}{space}{space}{space}{space} {etc...}
test footer

The ftp transfer is sending this:

test header
test record1 {no space}
{all other records truncated}
test footer

Can anyone help me send this file without truncating all that data?
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

What client are you using to send the data?  Have you tried another client?  If another client does the same thing, then I would suspect something within the structure of your file.

I would also check the transmission method; ASCII or binary.  You should be using ASCII.

And as a side issue why all the blanks spaces?

Jim.
Avatar of boukaka

ASKER

Have tried using multiple clients - same issue

I am sending using  vba code. We don't think it's the structure its just a basic text file - no special characters etc and if I send it using wraprecord, the whole file goes across (but of course with a line feed every 256 chars which is no good).

Have to send the blank spaces because the file format IBM is insisting on includes those blank spaces. They aren't about to change their ingestion program to accommodate little old me :(

I tried SendCommand("site trim=0 lrecl=nChars recfm=fb cy pri=1000 sec=150") but that didn't work either...
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of boukaka

ASKER

As a test, I just tried sending the file with no trailing spaces and it still says that it was truncated. I am attaching a sample of the file with spaces and without.
T3-spaces.txt
T3.txt
Avatar of boukaka

ASKER

Binary seems to have worked!!! I will confirm and then award points.
Avatar of boukaka

ASKER

That worked - the file is not humanly readable but we can work with it. Thank you.