Substitution Conversion (S;value1;value2)
The S (substitution) conversion code allows an application to handle zero or null data items as a special case.
The full format of this conversion code is
The S code returns a value determined by value1 if the source data is not zero or null, or the value determined by value2 if the source data is zero or null.
The value1 and value2 items may be:
A number specifying the field from @RECORD (the current record being processed in a query) to be returned. A value of zero returns the content of @ID.
A literal string enclosed in single quotes, double quotes or backslashes.
An asterisk indicating that the original data is to be returned.
If either value is omitted, it defaults to a null string.
A file has a date field that contains zero when it is not significant. Using a date conversion would return this as 31 Dec 1967. The S conversion code could be used to replace the zero by a null string before applying the date conversion. The dictionary conversion code field could be
The following table shows a variety of conversions for a data record of "F1FMF2" and a record id of "ID".