FTP from DOS to Mainframe causes file to be truncated

Experts - I am writing a web-app that will in essence upload a file via FTP to a mainframe running (MVS).  I could not get the FTP part to work so I simplified things.  Now I am just trying to use the DOS ftp command-line utility to upload the file to the mainframe but I am still running into problems.  Details...

The file is an ASCII file, 52 records of data (1 per line), each 263 bytes in length.  The file resides at C:\  I try to upload the file via FTP in ascii mode.  It sends the 1st record just fine but that is all.  The other 51 records are not received on the other end.  The file is truncated in other words.

My FTP commands:

open          (changed the IP address for security reasons)
<input user id and password>
cd ..
quote site lrecl=263 blocksize=0 recfm=fb cylinders primary=5 secondary=5          (this command was given to me by the client)
put C:\DNDCU.CRT35R.TS.CRTBUC.CABDAD 'DNDCU.CRT35R.TS.CRTBUC.CABDAD.DAT'          (changed the file information for security reasons)

The output I receive:
(after the login)

ftp> quote site lrecl=263 blocksize=0 recfm=fb cylinders primary=5 secondary=5
200 SITE command was accepted
200 Port request OK.
125 Storing data set DNDCU.CRT35R.TS.CRTBUC.CABDAD.DAT
250 Transfer completed (data was truncated)
ftp: 25292 bytes sent in 0.00Seconds 25292000.00Kbytes/sec.

So it looks like it succeeds but there is only 1 record in the file on the other end.  Note the "data was truncated" message.   We have also tried switching to binary mode.  When we do this the entire file transfers fine BUT it is all in EBCDIC so it looks like garbage on the other end.  We prefer to use ASCII Mode if possible, since we are not sure how to get around the EBCDIC problem either.

Can anyone offer any advice for either ASCII or binary mode?

Thanks in advance!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

When you say the lines are  263 characters long does this include the carriage return and line feed? If not then you'll want to make the file length 265. This could account for the data truncation message.

Good Luck,
mbeedeAuthor Commented:
That's a very good question.  Currently we do not have a carriage return line feed at the end of each line.  We tried "\r\n" and increased to 265 characters but that made no difference.  How would you suggest putting a carriage return / line feed in?  More details please...
The \r\n should equate to the 0xd and 0xa. It sounds like the mainframe is looking for something to denote the end of the record. If there is nothing it might be reading the 264th byte and saying data truncated. How about formatting a character to denote the end of a line (record)? I'm not sure what that character would be I'd suggest the following:

0x0 NUL
0x3 ETX

You might try just formating a carriage return:


Another thing to try is to leave out the blocksize.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Or using a line feed only:

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.