Link to home
Start Free TrialLog in
Avatar of mbeede
mbeede

asked on

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 134.115.25.75          (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
ftp> put C:\DNDCU.CRT35R.TS.CRTBUC.CABDAD 'DNDCU.CRT35R.TS.CRTBUC.CABDAD.DAT'
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.
ftp>

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!
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

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,
Steve
Avatar of mbeede
mbeede

ASKER

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...
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
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
Or using a line feed only:

0xa