COMMA, DOT, DOLLAR, and PCT Formats
The numeric formats listed below read and write data with embedded punctuation characters and symbols, such as commas, dots, and dollar and percent signs. The input data may or may not contain such characters. The data values read in are stored as numbers but displayed using the appropriate formats.
- DOLLAR. Numeric values with a leading dollar sign, a comma used as the grouping separator, and a period used as the decimal indicator. For example, $1,234.56.
- COMMA. Numeric values with a comma used as the grouping separator and a period used as decimal indicator. For example, 1,234.56.
- DOT. Numeric values with a period used as the grouping separator and a comma used as the decimal indicator. For example, 1.234,56.
- PCT. Numeric values with a trailing percent sign. For example, 123.45%.
The input data values may or may not contain the punctuation characters allowed by the specified format, but the data values may not contain characters not allowed by the format. For example, with a DOLLAR input format, input values of 1234.56, 1,234.56, and $1,234.56 are all valid and stored internally as the same value--but with a COMMA input format, the input value with a leading dollar sign would be assigned the system-missing value.
DATA LIST LIST (" ") /dollarVar (DOLLAR9.2) commaVar (COMMA9.2) dotVar (DOT9.2) pctVar (PCT9.2). BEGIN DATA 1234 1234 1234 1234 $1,234.00 1,234.00 1.234,00 1234.00% END DATA. LIST.
Other formats that use punctuation characters and symbols are date and time formats and custom currency formats. For more information on date and time formats, see Date and Time Formats . Custom currency formats are output formats only, and are defined with the SET command.