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.
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:
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:
A Radix-50 constant takes the following form:
nRc1c2 . . . cn
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.
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 |