Start of change

Using the _TEXT_CONV environment variable

Use the _TEXT_CONV environment variable if you know that all input text files for a given set of commands require the same text conversion. It applies to commands that support the filecodeset and pgmcodeset option (-W option) and the -B option (disable automatic conversion of tagged files).

Environment variable Description Valid values
_TEXT_CONV Contains text conversion information for commands that support a text conversion specification. Multiple value keywords are separated by a comma. Additional information for value keywords that require it are placed within parentheses immediately after the value. For example: FILECODESET(ISO8859-1)

FILECODESET
PGMCODESET
DISABLE

Use the _TEXT_CONV environment variable if it is not possible to use the filecodeset and pgmcodeset option (-W option) and the -B option (disable automatic conversion of tagged files). If any of those options are specified on a command, the specified command option is used to determine the text conversion. If none of those options are specified on the command, the _TEXT_CONV environment variable is used to determine the text conversion. If none of those options are specified and the environment variable is not set, then automatic code set conversion occurs, if enabled.

The valid value keywords for the _TEXT_CONV environment variable correspond to the filecodeset and pgmcodeset option (-W option) and the -B option (disable automatic conversion of tagged files). When a value keyword is included in the _TEXT_CONV environment variable, the behavior of the command will be as if the corresponding option was specified on the command. The corresponding value keywords are as follows:
Command option Corresponding _TEXT_CONV value keyword
-W filecodeset FILECODESET
-W pgmcodeset PGMCODESET
-B DISABLE

The FILECODESET and PGMCODESET value keywords require a supported coded character set to be specified within parenthesis. Multiple value keywords are separated with a comma. If the DISABLE value keyword is used along with either the FILECODESET or PGMCODESET value keywords, the DISABLE value keyword is ignored.

If the specified coded character set for the FILECODESET or PGMCODESET value keyword is not valid, an error condition will occur for all commands that support the filecodeset and pgmcodeset option (-W option), as if the invalid code set were specified on the command.

If the _TEXT_CONV environment variable is used by a command and it contains a value keyword other than FILECODESET, PGMCODESET, or DISABLE, an error message will be issued and the command ends. If the _TEXT_CONV environment variable is used by a command and it contains a syntax error, an error message will be issued and the command ends.

Some examples of specifying text conversion using the _TEXT_CONV environment variable:

  1. To indicate text conversion from the ASCII code set ISO8859-1 to the EBCDIC code set IBM-1047 using the _TEXT_CONV environment variable:
    export _TEXT_CONV=”FILECODESET(ISO8859-1),PGMCODESET(IBM-1047)”
  2. To indicate text conversion from the ASCII code set 819, but allow the default value for PGMCODESET using the _TEXT_CONV environment variable:
    export _TEXT_CONV=”FILECODESET(819)”
  3. To use the _TEXT_CONV environment variable to disable automatic conversion:
    export _TEXT_CONV=”DISABLE”
Note: When exporting the _TEXT_CONV environment variable, it is very important to understand that all commands that support the corresponding options performs the requested text conversion, regardless of the input text file that is being used. For example, if automatic conversion is enabled and the input file is a tagged file, the automatic conversion is ignored and the text conversion indicated by the _TEXT_CONV environment variable is used. However, if a command specifies any of the corresponding options, that option will override the _TEXT_CONV environment variable.

The coded character set can be specified by using the code set name or by using the numeric coded character set identifier (CCSID). The command iconv -l lists existing numeric CCSIDs along with their corresponding code set names.

Note: Start of change_BPXK_UNICODE_TECHNIQUE, _BPXK_UNICODE_SUB and _BPXK_UNICODE_MAL specify the Unicode Services actions to take for the translation operation. For more information about those environment variables, see z/OS UNIX System Services Planning.End of change
Restriction: Text conversion can take place between pgmcodeset IBM-1047 and any filecodeset that Unicode Service supports.
Following are commands that are affected by the FILECODESET and PGMCODESET value keywords of the _TEXT_CONV environment variable.
Following are commands that are affected by the DISABLE value keyword of the _TEXT_CONV environment variable.
End of change