z/OS FTP and HFS file tagging

Technote (troubleshooting)


Problem(Abstract)

This document describes how FTP uses file tagging with HFS files and how files that are uploaded to z/OS can be tagged. File tagging is the capability of associating a codepage with a specific file stored in the HFS.

Resolving the problem

With file tagging, a CCSID (coded character set identifier) is associated with each file. This CCSID is a 16-bit number that uniquely identifies the coded graphic character representation used.

Depending on whether a file is written or read from the HFS, FTP will take different actions for file tagging.

When a file is written to the HFS, FTP will take the following action for file tagging:

  • File is saved in binary
    1. The file is tagged as binary
    2. Text flag is turned off
  • File is saved in EBCDIC
    1. The file is set to UNTAGGED
    2. Text flag is turned off
  • File is saved in ASCII
    1. If no CCSID is used
      • The file is set to UNTAGGED
      • Text flag is turned off
    2. Otherwise, a CCSID translation was used
      • The file is set to the CCSID that was used - this is set by using the SBDATACONN keyword on the LOCSITE subcommand or SITE command
      • Text flag is turned on

HFS is mounted to support automatic file conversion. That is, AUTOCONV is on and the HFS to which the file is to be stored has been mounted to support a specific CCSID. For example:
/usr/bin/mount -c 819,text -f omvs.test.hfs /mtpoint

Refer to File Tagging APARs below for maintenance requirements.

Perform the following steps for FTP client or server to set the CCSID of a file that is to be written on the mainframe:
  1. Issue an ASCII transfer and use the sbdataconn keyword on the appropriate site or locsite command. For example:
      • When you use the put command from a remote client to the z/OS server issue the following: quote site sbdataconn=(ibm-1047,iso8859-1)
      • When you use a get command from the z/OS FTP client, issue the following: locsite sbdataconn=(ibm-1047,iso8859-1)
  2. After the transfer completes, exit FTP and enter the USS shell, and use the chtag command with the -p option to display the file tags associated with the uploaded files. For example, if one of these actions are taken:
      • An ASCII file was uploaded from a z/OS FTP client using the following:
        locsite sbdataconn=(ibm-1047,iso8859-1)
      • The same file was also stored on the z/OS mainframe from a remote PC client using the following:
        quote site sbdataconn=(ibm-1047,iso8859-1)
    You can verify the file tags with the following USS command:
      chtag -p [filename]
    which displays:
      t IBM-1047 T=on ascii.1047.8859.client
      t IBM-1047 T=on ascii.1047.8859.server
    (Note that wildcards are allowed in the filename)

FTP uses the ICONV macro to perform the data conversion with the code pages specified with the sbdataconn keyword on the SITE or LOCSITE subcommand.

Valid tables that can be specified are documented in the Code Set Conversion Utilities chapter of the z/OS C/C++ Programming Guide .


When a file is read from the HFS, FTP will take the following action for file tagging:

A check is made to verify that the current tagging and CCSID of the file
are valid.
  1. If file is tagged and is not a binary file,
    • FTP verifies that the CCSID is associated with an ASCII or EBCDIC page and that the codeset name is valid. If not, the file will be treated as untagged.
  2. If the file is tagged as a binary file and the data type is not binary, ASCII, or EBCDIC then following error message is displayed and transfer is terminated:
    • EZA2928I File contains binary data - enter binary subcommand before entering transfer subcommand
  3. If the data type is EBCDIC and the file is tagged as ASCII, then the following error message is displayed and transfer is terminated:
    • EZA2929I File contains ASCII data - enter ASCII subcommand before entering transfer subcommand
  4. If the data type is ASCII or EBCDIC and the file is tagged BINARY, then the following warning message is displayed and the data transfer will continue in either ASCII or EBCDIC, as requested:
    • EZA2107I Binary tagged file translated with current data connection translation table Refer to File Tagging APARs below for maintenance requirements.
  5. If the file is tagged and translated, one of the following messages will be displayed to identify the type of translation performed:
    • EZA2938I Tagged %1 file translated with table built using file system cp=%2, network transfer cp=%
    • EZA2939I Tagged %1 file translated with current data connection translation table
    where:
%1 is either ASCII or EBCDIC.
%2 is the codepage of the file.
%3 is the codepage that was specified for the network transfer codepage on LOCSITE SBDATACONN or on the SBDATACONN statement in the FTP.DATA file.

The EZA2939I message indicates that the local file is tagged with a coded character set ID (ccsid) and the data connection translate table is not defined with the SBDATACONN=(file_system_cp,network_transfer_cp) method. Without a network transfer codepage, the client cannot build a translate table using the ccsid of the file. The FTP client uses the translate table defined for the data connection.

If the current data connection translate table is not acceptable, issue a LOCSITE SBDATACONN=(file_system_cp,network_transfer_cp) subcommand to provide a codepage to be used to build a translate table.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

z/OS Communications Server
All

Software version:

1.2, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 2.1

Operating system(s):

z/OS

Software edition:

All Editions

Reference #:

1378852

Modified date:

2013-11-27

Translate my page

Machine Translation

Content navigation