# COUNTRY\_TO\_ALPHA3

### Description

`COUNTRY_TO_ALPHA3` converts an ISO 3166-1 alpha-2 country code (2 letters) to the corresponding ISO 3166-1 alpha-3 country code (3 letters).

Returns `unknown` if the input is not a recognised alpha-2 code.

### Syntax

```
COUNTRY_TO_ALPHA3(alpha2)
```

**Returns:** A 3-letter alpha-3 country code string, or `unknown` if the input is unrecognised.

### Example

```
COUNTRY_TO_ALPHA3('CH')
```

This returns `'CHE'`.

```
COUNTRY_TO_ALPHA3('DE')
```

This returns `'DEU'`.

```
COUNTRY_TO_ALPHA3('XX')
```

This returns `unknown` — `'XX'` is not a valid ISO country code.

### Example in context

```
p is Person
COUNTRY_TO_ALPHA3(p.nationality)
```

Converts the 2-letter nationality stored on a person to its 3-letter equivalent, e.g. for use in downstream systems or document generation that requires alpha-3 codes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/special-operators/country_to_alpha3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
