Treatment of EOF character (x'1A') during file download in Text mode

During a file download, when the Transfer Mode is Text, three options control how Z and I Emulator for Web treats the ASCII EOF character (x'1A'):

  • APPEND in the Receive Text Options
  • The RemoveEOFChar HTML option
  • The PreserveAppendEOFChar HTML option

The EOF character (x'1A') can occur as the last character of two files:

  • As the last character of the file being downloaded.
  • As the last character of the existing file to which the downloaded file is being appended, if APPEND is specified in the Receive Text Options.

The following list describes the effect of each option briefly. However, you should consult the two tables further below to determine the exact outcome of specifying each option.

  • APPEND in the Receive Text Options. (3270 Display session, 5250 Display session.) If you specify APPEND in the Receive Text options, and the last character of the existing file being appended to is x'1A', then Z and I Emulator for Web:
    • Removes the x'1A' from the end of the existing file before appending the downloaded data:
    • Does not add the removed x'1A' back to the end of the file after appending the downloaded data.
  • PreserveAppendEOFChar HTML parameter. (3270 Display session, 5250 Display session.) This HTML parameter modifies the effect of the APPEND option in the Receive Text Options. If you specify APPEND in the Receive Text Options, and the last character of the existing file being appended to is x'1A', and you also specify PreserveAppendEOFChar with a value of yes, then Z and I Emulator for Web:
    • Removes the x'1A' from the end of the existing file before appending the downloaded data.
    • Also adds the removed x'1A' back to the end of the file after appending the downloaded data.
  • RemoveEOFChar HTML parameter. (3270 Display session only.) This HTML parameter affects how Z and I Emulator for Web handles an x'1A' when it occurs as the final character of the file being downloaded.
    • If the session is a 3270 Display session, and the last character of the file being downloaded is x'1A', and APPEND is not specified in the Receive Text Options, and you specify RemoveEOFChar with a value of yes, then Z and I Emulator for Web:
      • Removes the x'1A' from the end of the file being downloaded.
    • If the session is a 3270 Display session, and the last character of the file being downloaded is x'1A', and APPEND is specified in the Receive Text Options, and the last character of the existing file being appended to is x'1A', and you specify RemoveEOFChar with a value yes, then Z and I Emulator for Web:
      • Removes the x'1A' from the end of the file being downloaded.
      • Also removes the x'1A' from the end of the existing file.
      RemoveEOFChar specified with a value of yes overrides PreserveAppendEOFChar specified with a value of yes.

The following two tables describe how these options operate for each combination of settings. In the tables:

  • ffff signifies the existing file being appended to.
  • dddd signifies the file being downloaded.
  • +    signifies an append.
  • ==>  signifies "results in".

The first table describes situations in which APPEND is not specified:

Remove- EOFChar Preserve- Append- EOFChar Action Taken:
no (Not applicable here because APPEND is not specified.) Applies to: 3270 Display session, 5250 Display session. Here RemoveEOFChar is not specified (or is set to no). This is the default situation. If the last character of the file being downloaded is x'1A', then Z and I Emulator for Web does not remove it. dddd  ==> dddd dddd@ ==> dddd@
yes (Not applicable here because APPEND is not specified.) Applies to: 3270 Display session only. Here RemoveEOFChar is specified and set to yes. x'1A' at the end of the downloaded file is deleted. dddd  ==> dddd    (3270 Display session only) dddd@ ==> dddd    (3270 Display session only)

The second table describes situations in which APPEND is specified:

Remove- EOFChar Preserve- Append- EOFChar Action Taken:
no no Applies to: 3270 Display session, 5250 Display session. Both parameters are not specified (or are set to no). This is the default situation. -- x'1A' at the end of the downloaded file is not deleted. -- x'1A' at the end of the appended to file is deleted but not added back after appended data. ffff  + dddd  ==> ffffdddd ffff  + dddd@ ==> ffffdddd@ ffff@ + dddd  ==> ffffdddd ffff@ + dddd@ ==> ffffdddd@
no yes Applies to: 3270 Display session, 5250 Display session. Here RemoveEOFChar is not specified (or is set to no) and PreserveAppendEOFChar is specified and set to yes. -- x'1A' at the end of the downloaded file is not deleted. -- x'1A' at the end of the appended to file is deleted and then added back after the appended data. -- A maximum of one @ is retained at the end. ffff  + dddd  ==> ffffdddd ffff  + dddd@ ==> ffffdddd@ ffff@ + dddd  ==> ffffdddd@ ffff@ + dddd@ ==> ffffdddd@
yes yes or no Applies to: 3270 Display session and 5250 Display session. Here RemoveEOFChar is specified and set to yes, while PreserveAppendEOFChar can be either specified and set to yes or not specified at all (or set to no). 5250 Display session: No effect. That is, for a 5250 Display session, the effect is the same as if RemoveEOFChar were not specified (or were set to no). See the other two rows of this table for the results. 3270 Display session: Z and I Emulator for Web disregards the value of PreserveAppendEOFChar and takes the following actions: -- x'1A' at the end of the downloaded file is deleted. -- x'1A' at the end of the appended to file is deleted. ffff  + dddd  ==> ffffdddd   (3270 Display only) ffff  + dddd@ ==> ffffdddd   (3270 Display only) ffff@ + dddd  ==> ffffdddd   (3270 Display only) ffff@ + dddd@ ==> ffffdddd   (3270 Display only)

Related topics