Purpose
Returns the absolute value of a numeric value.
Syntax
►►─┬─ ABSOLUTE-VALUE ─┬─ ( value ) ───────────────────────────────────────────►◄ └─ ABS-val ────────┘
Parameters
Specifies the numeric value whose absolute value is calculated.
Value can be:
Example
In the following example, the absolute value function is used to specify the absolute value of a calculated length in a substring function:
Initial values:
EMP-NAME: 'JOE SMITH'
WK-LENGTH: -3
Statement:
MOVE SUB(EMP-NAME,1,ABS(WK-LENGTH)) TO WK-FNAME.
Returned value from ABS function: 3
Returned string from SUB function: 'JOE'
|
Copyright © 2014 CA.
All rights reserved.
|
|