#### FROM

#### Synopsis

    HELP:   Conversion from this CCSID
    TYPE:   STRING
    SYNTAX: FROM='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL

#### Description

The FROM code defines the encoding string or CCSID (Coded Character Set Identifier) for the input text stream. If no CCSID is provided, the records are handle binary. In other words, the FROM code activate text record handling.

The character conversion module will be setup with EBCDIC new line to line feed handling and the combined character support is deactivated. If you need more functionality (user specific conversion, subset support, special casing, normalization, ...) please use another command.

When reading and the DEFAULT key word is assigned, the input data's charset is auto-detected. The charsets below can currently be detected:

- ASCII (the finally used code page depends on the language code)
- EBCDIC (the finally used code page depends on the language code)
- UTF-8 == US-ASCII
- UTF-16LE == UCS-2LE (little-endian)
- UTF-16BE == UCS-2BE (big-endian)
- UTF-32LE == UCS-4LE (little-endian)
- UTF-32BE == UCS-4BE (big-endian)

If the data is encoded in ASCII or EBCDIC, the corresponding CCSID will be derived from the appropriate environment variable LANG. On non-ASCII systems, the ASCII-CCSID is derived from the language identifier (e.g. en, de, ...). The same holds true for non-EBCDIC systems if EBCDIC is detected. When ASCII is detected on an ASCII system, the CCSID from the LANG environment variable is used (e.g. de_DE.UTF-8 => UTF-8), if present. If the LANG variable contains no CCSID, then the language identifier is used (e.g. de_DE => ISO-8859-1). The same holds true for EBCDIC systems if EBCDIC is detected.

On modern platforms, the CCSID for a resource may be saved in the file system and can also be given by the FIO module. In general, however, it is recommended to set this parameter to its correct value. For default handling, the keywords DEFAULT, ASCII and EBCDIC as well as (for multibyte characters) the BOM keywords stated below can be used to help finding the correct CCSID on read operations. The SYSTEM keyword selects the system specific CCSID (on EBCDIC systems the default EBCDIC and on ASCII the default ASCII CCSID). The keyword LOCAL works like DEFAULT but it prefers the real local character set if the same kind of character set (ASCII or EBCDIC) is detected.

Character conversions at decompression operation are also possible, but in this case, the BOM keywords are not supported. When writing, the FROM CCSID is usually known and does not need to be specified.

In order to use the BOM keywords, a BOM sign must be part of the input data. All unique BOM characters are supported in principle, but for UTF-16/USC-2 and UTF-32/UCS-4 the same BOM sign is used. You can define by yourself which family is used.

To get a list of supported encoding strings, please use the command below:

       flam4 INFO GET.ENCODINGS

Depending on the platform, this function lists all known encoding strings. Some encodings may not be supported. To determine the supported CCSIDs and corresponding encoding strings and charsets please use:

       flam4 INFO GET.CCSIDS

To define the CCSID, you can use one of the encoding strings or the decimal number for a CCSID displayed by the command above. Example:

       CCSID='37'    will be equal to CCSID='IBM037'
       CCSID='1208'  will be equal to CCSID='UTF-8'

A numeric CCSID must start with a decimal digit.

#### Selections

- `DEFAULT - Use default CCSID (auto-detect)`
- `ASCII - Use default ASCII CCSID (environment)`
- `EBCDIC - Use default EBCDIC CCSID (environment)`
- `BOMUTF - Determine the correct UTF CCSID from byte order mark (BOM) only when reading`
- `BOMUCS - Determine the correct UCS CCSID from byte order mark (BOM)only when reading`
- `SYSTEM - Use system character set (environment/logical)`
- `LOCAL - Use local character set (auto-detect + system/physical)`