UNICODEFILESYSTEMBOM (FTP client and server) statement

Use the UNICODEFILESYSTEMBOM statement to specify whether to add a byte order mark (BOM) to a file stored in the local file system when the file system code page is Unicode. You can also use the SIte and LOCSIte subcommands to set this keyword.

Restriction: UTF-8 and UTF-16 are the only Unicode encodings supported in the file system by z/OS® FTP.

Result: The BOM stored with the file is determined by the encoding used to store the file rather than by the format of the BOM sent with the file.

Server
This setting applies when you are storing Unicode data into the server's file system.
Client
This setting applies when you are storing files as Unicode on the client's file system.

Syntax

Read syntax diagramSkip visual syntax diagram
   .-UNICODEFILESYTEMBOM ASIS--------.   
>>-+---------------------------------+-------------------------><
   '-UNICODEFILESYTEMBOM--+-ASIS---+-'   
                          +-ALWAYS-+     
                          '-NEVER--'     

Parameters

ASIS
If a BOMk is present in a Unicode file that is received from the network, store the file with a BOM. If a BOM is not present, store the file without a BOM. The default is ASIS.
ALWAYS
Always include a BOMwhen storing the file. If the file is received without a BOM, insert a BOM into the file.
NEVER
Never include a BOM when storing a UNICODE file. If the file is received with a BOM, discard it before storing the file.

The UNICODE BOM, U+FEFF, can also be interpreted as zero width nonbreaking space. z/OS FTP considers only the first character of the file as a possible BOM. No other instance of the BOM sequence in the file is affected by this setting.

Results:
  • When appending to a nonexistent regular z/OS UNIX file or MVS™ data set, the FTP server abides by the UNICODEFILESYTEMBOM setting.
  • When appending to an existing regular z/OS UNIX file or MVS data set, the FTP server always strips a leading BOM from the incoming file. This prevents a superfluous BOM from being inserted in the middle of the server file.
  • When storing or appending to a z/OS UNIX named pipe, the FTP server always applies the UNICODEFILESYSTEMBOM setting. Multiple transfers into the same named pipe can result in multiple BOM byte sequences inserted into the named pipe.
Guidelines:
  • The presence or absence of a BOM can affect applications that process UNICODE files. Consult documentation for applications that process your files or data sets.
  • Do not use a BOM when storing UNIX system services configuration files.
  • Multiple transfers into a z/OS UNIX named pipe can result in multiple BOM byte sequences being inserted into the named pipe when the UNICODEFILESYSTEMBOM value is ASIS or ALWAYS. To prevent superfluous BOM byte sequences from being inserted in a named pipe, consider setting the UNICODEFILESYSTEMBOM value to NEVER after the first transfer into the named pipe.

Examples

To transfer a UTF-8 file to the server, save it in the server file system as UTF-8, and to guarantee the destination file contains a Byte Order Mark, code the following statements in the server's FTP.DATA:

ENCODING MBCS
MBDATACONN(UTF-8,UTF-8)
UNICODEFILESYSTEMBOM ALWAYS

Related topics