The OpenVMS operating system included string formatting functionality from the outset, actually built into the OS kernel. Called SYS$FAO, it is an integral part of how OpenVMS interfaces with its users. FAO stands for Formatted ASCII Output, which was a reasonable name in the late 1970s when the operating system first became available.
Write your own format effectors to augment the standard set — or replace them.
| Argument list modification | |||
|---|---|---|---|
| Effector Syntax | Effector Name | Description | Default Width |
| !- | Reuse | Back the argument list up so the most recently used argument gets re-used. | Not applicable. |
| !+ | Skip | Skip over the next item in the argument list. | Not applicable. |
| Date/time insertions | |||
| Effector Syntax | Effector Name | Description | Default Width |
| ![w]%T( ... !) | Date/Time | Format a date/time value using strftime(3) rules and insert the result. | Depends on the time formatting string |
| Field-width control | |||
| Effector Syntax | Effector Name | Description | Default Width |
| !#effector | ArgWidth | Specify a field width using an argument rather than a hard-coded value. | Not applicable. |
| !w< ... !> | Fixed Window | Force a right-justified field width on the contents between the effector delimiters. | Not applicable. |
| Miscellaneous | |||
| Effector Syntax | Effector Name | Description | Default Width |
| !n*c | RepeatingChar | Insert n occurrences of a character. | Not applicable. |
| Numeric insertion | |||
| Effector Syntax | Effector Name | Description | Default Width |
| ![w]UB | Byte: unsigned | Insert the decimal representation of an unsigned 8-bit value, left space-filled to the field width. | As many columns as needed to represent the value. |
| ![w]SB | Byte: signed | Insert the decimal representation of a signed 8-bit value, left space-filled to the field width. | As many columns as needed to represent the value. |
| ![w]ZB | Byte: unsigned, zero-filled | Insert the decimal representation of an unsigned 8-bit value, left zero-filled to the field width. | As many columns as needed to represent the value. |
| ![w]OB | Byte: octal | Insert the octal representation of an unsigned 8-bit value, left zero-filled to the field width (default 3). | 3 columns. |
| ![w]XB | Byte: hex | Insert the hexadecimal representation of an unsigned 8-bit value, left zero-filled to the field width (default 2). | 2 columns. |
| ![w]UW | Word: unsigned | Insert the decimal representation of an unsigned 16-bit value, left space-filled to the field width. | As many columns as needed to represent the value. |
| ![w]SW | Word: signed | Insert the decimal representation of a signed 16-bit value, left space-filled to the field width. | As many columns as needed to represent the value. |
| ![w]ZW | Word: unsigned, zero-filled | Insert the decimal representation of an unsigned 16-bit value, left zero-filled to the field width. | As many columns as needed to represent the value. |
| ![w]OW | Word: octal | Insert the octal representation of an unsigned 16-bit value, left zero-filled to the field width (default 6). | 6 columns. |
| ![w]XW | Word: hex | Insert the hexadecimal representation of an unsigned 16-bit value, left zero-filled to the field width (default 4). | 4 columns. |
| ![w]UL | Long: unsigned | Insert the decimal representation of an unsigned 32-bit value, left space-filled to the field width. | As many columns as needed to represent the value. |
| ![w]SL | Long: signed | Insert the decimal representation of a signed 32-bit value, left space-filled to the field width. | As many columns as needed to represent the value. |
| ![w]ZL | Long: unsigned, zero-filled | Insert the decimal representation of an unsigned 32-bit value, left zero-filled to the field width. | As many columns as needed to represent the value. |
| ![w]OL | Long: octal | Insert the octal representation of an unsigned 32-bit value, left zero-filled to the field width (default 11). | 11 columns. |
| ![w]XL | Long: hex | Insert the hexadecimal representation of an unsigned 32-bit value, left zero-filled to the field width (default 8). | 8 columns. |
| ![w]UQ | Quadword: unsigned | Insert the decimal representation of an unsigned 64-bit value, left space-filled to the field width. | As many columns as needed to represent the value. |
| ![w]SQ | Quadword: signed | Insert the decimal representation of a signed 64-bit value, left space-filled to the field width. | As many columns as needed to represent the value. |
| ![w]ZQ | Quadword: unsigned, zero-filled | Insert the decimal representation of an unsigned 64-bit value, left zero-filled to the field width. | As many columns as needed to represent the value. |
| ![w]OQ | Quadword: octal | Insert the octal representation of an unsigned 64-bit value, left zero-filled to the field width (default 22). | 22 columns. |
| ![w]XQ | Quadword: hex | Insert the hexadecimal representation of an unsigned 64-bit value, left zero-filled to the field width (default 16). | 16 columns. |
| Pluralisation | |||
| Effector Syntax | Effector Name | Description | Default Width |
| !%S | Pluralise-English | Add an "s" or "es" suffix if the last argument used was not 1. | 1 or 2 columns |
| !%is | is/are-English | Insert "is" or "are" depending on whether the last argument used was 1. | 2 or 3 columns |
| !%IS | IS/ARE-English | Insert "IS" or "ARE" depending on whether the last argument used was 1. | 2 or 3 columns |
| Special-character insertion | |||
| Effector Syntax | Effector Name | Description | Default Width |
| !_ | TAB | Insert a TAB character. | Not applicable. |
| !^ | Formfeed | Insert a form-feed control character. | Not applicable. |
| !! | Bang | Insert an exclamation mark (!) character. | Not applicable. |
| != | CR | Insert a carriage-return character. | Not applicable. |
| !, | LF | Insert a line-feed control character. | Not applicable. |
| !/ | CRLF | Insert a carriage-return and a line-feed. | Not applicable. |
| String insertion | |||
| Effector Syntax | Effector Name | Description | Default Width |
| ![w]AS | String AS | Insert a simple string. | As many columns as needed to represent the value. |
| ![w]AN | String AN | Insert a simple string, replacing non-printing characters with ".". | As specified. |
| ![w]AD | String AD | Insert the first n characters of a string, drawing n from the argument list. | As specified. |
| ![w]AF | String AF | Insert the first n characters of a string, drawing n from the argument list and replacing non-printing characters with ".". | As specified. |