Strovent SystemsSign in
Reference

EZA2537E and 451: z/OS FTP records longer than the LRECL

z/OS FTP fails with EZA2537E or 451 when a line is longer than the new data set's LRECL. Set a larger LRECL with QUOTE SITE first, or allow wrap or truncation.

The z/OS FTP client prints:

EZA2537E File transfer failed. File contains records that are longer than the LRECL of the new file.

Another FTP client shows the server's reply instead:

451-File transfer failed. File contains records that are longer than the LRECL of the new file.

What it means

In ASCII mode the z/OS FTP server stores each line of your file as one record of an MVS data set. A new data set gets its logical record length (LRECL) from your SITE settings or the server's defaults. A line longer than that cannot fit.

What happens next depends on two server settings, TRUNCATE and WRAPRECORD. With truncation not allowed, the transfer fails with the message above, so you are not told "success" when data is missing. IBM's sample FTP.DATA files set it that way. A server left at the built-in default allows truncation instead: the long lines are cut at the LRECL with no error, so check the result.

Fix: give the new data set a longer record

Before the put, send the record format and length with SITE. Most clients other than z/OS need QUOTE (or a "raw command" option) to send it:

quote site lrecl=255 recfm=vb
put notes.txt 'USER1.NOTES.TEXT'
  • recfm=vb stores variable-length records, so short lines do not waste space. fb pads every record with blanks to the LRECL.
  • LRECL, RECFM, BLKSIZE and the space values (PRIMARY, SECONDARY with TRACKS or CYLINDERS) apply only to a data set FTP creates. If the data set already exists, its own LRECL is used. Delete it first, or put to a new name.
  • A name in single quotes is a full data set name. Without quotes, the name is added to your current working directory on the server (pwd shows it).
  • SITE values stay set until you change them or end the session.

Or let the server wrap or cut the long lines

  • quote site wrap continues a long line in the next record. No data is lost, but one line becomes two records.
  • quote site truncate cuts the line at the LRECL and lets the transfer finish. quote site notruncate turns that off again.

Text or binary

The mode decides whether the server converts anything:

  • ASCII (ascii, FTP type A). For text. The server converts between ASCII and EBCDIC and turns line ends into records. Use it for source code, JCL and reports.
  • Binary (binary, FTP type I, "image"). For zip files, images and anything that must arrive byte for byte. Nothing is converted.

A text file sent in binary mode arrives on z/OS still in ASCII and looks like garbage in ISPF. A zip file sent in ASCII mode is damaged.

If brackets or accented letters are wrong after an ASCII transfer, the server used a different code page pair than you expected. You can name the pair for the session, for example quote site sbdataconn=(IBM-1047,ISO8859-1). See 3270 code pages for how 037, 1047 and 1140 differ.

Downloads lose trailing blanks

If the blanks at the end of each record are missing after you get a fixed-length (FB) data set, the server is not set to keep them. quote site trailingblanks keeps them for the session.

Sources

Spotted a mistake? Email [email protected].