Strovent SystemsSign in
App guide

Fix strange characters and line breaks after a 3270 file transfer

Why a file sent or received with IND$FILE shows odd characters, question marks or no line breaks, and how Text and Binary mode, line ends and record length cause it.

Most wrong results come from the wrong mode, from characters the transfer cannot carry, or from the record length of the host data set.

What the app sends

The panel types an IND$FILE command at the host's prompt. The Command line in the panel shows it.

  • Text mode adds the host options ASCII CRLF. The host converts between ASCII and EBCDIC. It removes the CR LF line ends on a send, and adds them on a receive.
  • Binary mode adds neither. The bytes are sent and received unchanged.

IBM describes the same two options in its Host File Transfer documentation for Host On-Demand: ASCII is for text files and converts between ASCII and EBCDIC, and CRLF is removed from the end of each line on a send. It says the mode must be Text for text files, and Binary for files that are not text.

Symptoms and causes

  • A picture, PDF, archive or program is damaged after the transfer: It went through Text mode, which converts bytes. Send and receive it in Binary mode.
  • A text file you received looks like nonsense, with no line breaks: It came in Binary mode, so the EBCDIC bytes were saved untouched. Receive it again in Text mode.
  • A text file sent from your device shows odd characters on the host: It was sent in Binary mode, so the host holds ASCII bytes. Send it again in Text mode.
  • Some characters become ?: In Text mode, the app passes the file through the Latin-1 character set. Letters outside Latin-1 become ? before they are sent. Latin-1 holds the usual Western European letters.
  • Brackets, |, ^ or the pound sign are different on the host: The host does the ASCII to EBCDIC conversion, using its own table. The configuration's Code page does not take part in the transfer. It only changes the screen and the keyboard. See Choose the code page.
  • The transfer fails on long lines: The record length of the host data set is shorter than your longest line. IBM notes that a file sent to the host must not have a record longer than the record length.

The host data set

The panel does not send record format, record length or space options, so the host's defaults decide them when the data set is created. If the file needs a specific record format or length, make the data set first with the right attributes, and then send the file to it. The full list of host options is in IND$FILE options.

Check before you retry

  1. Look at the Command line. Is it the mode you meant?
  2. Is the file really text? Open it on your device first.
  3. Look at the data set's attributes on the host, and check the record length against the longest line.

Spotted a mistake? Email [email protected].