pc.s Processing Code/Restore Processor

pc.s

Command pc.s Processing Code/Restore Processor
Applicable release versions: AP
Category Restore Processor (84)
Description substitutes either a data value from the referenced attribute or literal text when the current data value is null or zero.

The "s" processing code returns the value defined by "attrnum2" if the value for conversion is null or zero. Otherwise, the value of "attrnum1" is returned. "attrnum1" and "attrnum2" may both be an attribute number or text string.

The "*" is used to display the original data value, if it is not null or zero. Otherwise, the second argument is displayed. This feature may be embedded within an "f" processing code in the form: fattrnum(s;*;'text') It also may be embedded within an "a" processing code.
Syntax s;attrnum1;attrnum2
s;'text';'text'
s;*;'text'
Options
Example
Substitution is used in an "a (algebraic)" processing code as an 
alternative to the THEN/ELSE construct.

The following A correlatives produce identical results:

aif n(sales)>="1000000" then "made it" else 
"trouble"

a(n(sales)>="1000000")(s;"made it";"trouble")

The following checks for the existance of a shipping address in attribute 20. 
If not there, show the billing address in attribute 10.

a(20)(S;*;10)
Purpose
Related ue.009e
up.input-conversion.adi
processing.codes
pc.a
pc.substitution
pc