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 |
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.
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:
export _TEXT_CONV=”FILECODESET(ISO8859-1),PGMCODESET(IBM-1047)”
export _TEXT_CONV=”FILECODESET(819)”
export _TEXT_CONV=”DISABLE”
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.
cat | grep |
cmp | head |
comm | more |
cut | paste |
diff | sed |
dircmp | strings |
ed | tail |
egrep | unexpand |
ex | uniq |
expand | vi |
fgrep | wc |
file |
cat | grep |
cmp | head |
comm | more |
cut | pack |
diff | paste |
dircmp | sed |
ed | strings |
egrep | tail |
ex | unexpand |
expand | uniq |
fgrep | vi |
file | wc |