# B.3 Radix-50 Constants and Character Set (VAX only)

Radix-50 is a special character data representation in which up to 3 characters can be encoded and packed into 16 bits. The Radix-50 character set is a subset of the ASCII character set and is provided for compatibility with PDP-11 Fortran.

Table B-1 shows the Radix-50 character set and their corresponding ASCII values.

### Table B-1 Radix-50 Character Set with Comparative Values (VAX only)

Character | ASCII Octal Equivalent | Radix-50 Octal Value
--- | --- | ---
Space | 408 | 08
A - Z | 1018 - 1328 | 18 - 328
$ | 448 | 338
. | 568 | 348
(Unassigned) |  | 358
0 - 9 | 608 - 718 | 368 - 478

Radix-50 values are stored, up to three characters per 16-bit word, by packing them into single numeric values according to the following formula:
((i * 508 + j) * 508 + k)

The values i, j, and k represent the code values of the three Radix-50 characters, so the maximum Radix-50 value is as follows:
478 * 508 * 508 + 478 * 508 + 478 = 1747778

A Radix-50 constant takes the following form:

    nRc1c2 . . . cn

n
  Is an unsigned, nonzero integer constant that states the number of characters to follow.
cn
  Is a character from the Radix-50 character set.

The maximum number of characters is 12. The character count must include any spaces that appear in the character string (the space character is a valid Radix-50 character). You can use Radix-50 constants only in DATA statements.

When a Radix-50 constant is assigned to a numeric variable or array element, the number of bytes that can be assigned depends on the data type of the component (see Table 2-1). If the Radix-50 constant contains fewer bytes than the length of the component, ASCII null characters (zero bytes) are appended on the right. If the constant contains more bytes than the length of the component, the rightmost characters are not used.

Examples

The following examples illustrate valid and invalid Radix-50 constants and explain why the invalid ones are not valid:

Valid |
--- | ---
`4RABCD` |
`6RΔTOΔΔΔ` |
Invalid | Explanation
`4RDK0:` | The colon is not a Radix-50 character
`5RKLMΔTO` | Incorrect number of characters

Previous Page Next Page Table of Contents