Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


ftp truncating records

Posted on 2012-08-13
Medium Priority
Last Modified: 2012-08-13

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?
Question by:boukaka
  • 4
LVL 58
ID: 38288611
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?


Author Comment

ID: 38288648
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...
LVL 84

Accepted Solution

Dave Baldwin earned 1500 total points
ID: 38288659
Send it as 'binary' so that text mangling for line endings does not occur.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 38288671
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.

Author Comment

ID: 38288677
Binary seems to have worked!!! I will confirm and then award points.

Author Closing Comment

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have had my own IT business for a very long time. I started mostly with hardware and after about a year started to notice a common theme. I had shelves with software boxes -- Peachtree, Quicken, Sage, Ouickbooks -- and yet most of my clients were…
When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question