Numeric built-ins and modifiers handle magnitude, bounds, sign, and decimal control on quantitative fields—types N and P with optional implied decimals. ABS supports variance and tolerance checks. MIN and MAX cap or floor values in one expression. Assignment modifiers INTEGER, ROUNDED, and TRUNCATED govern how fractional digits store on assign—not separate function calls but essential numeric toolkit alongside ABS. Payroll and finance jobs depend on correct P scale through expressions; audit finds penny drift when ROUNDED is omitted on tax chains. This index lists numeric capabilities, contrasts function calls with assignment modifiers, explains sign and compare patterns, and separates numeric from math category for roots and logarithms. Verify function names on your Application Reference— Report Generator sites may use operators and modifiers alone without MIN MAX builtins.
DEFINE and FILE describe length, type N packed P or binary B, and decimal count. P 5 2 holds values up to five digits with two after implied decimal—999.99 range pattern. Assignment and functions preserve scale unless INTEGER truncates fractional portion. Mixing P 2 and N 5 in expression promotes per compiler—test boundary amounts .005 for rounding behavior.
| Operation | Mechanism | Example pattern |
|---|---|---|
| Absolute value | ABS(expr) | WS = ABS(BUDGET - ACTUAL) |
| Minimum | MIN(a, b) | APPR = MIN(REQ, LIMIT) |
| Maximum | MAX(a, b) | FLOOR = MAX(CALC, 0) |
| Round on assign | ROUNDED keyword | TAX = GROSS * RATE ROUNDED |
| Truncate on assign | TRUNCATED keyword | UNITS = QTY TRUNCATED |
| Integer portion | INTEGER keyword | WHOLE = AMT INTEGER |
| Sign test | IF LT 0 / IF GT 0 | IF BALANCE LT 0 overdraft |
| Accumulate | SUM or = TOTAL + AMT | Running totals in JOB |
Variance reporting: DELTA = ACTUAL - BUDGET then IF ABS(DELTA) GT LIMIT flags material difference regardless of direction. Tolerance bands on measurement error use ABS on instrument reading minus standard. Nested ABS is redundant except obfuscation—ABS(ABS(x)) equals ABS(x). Result field should match source scale for currency.
12345DELTA = ACTUAL - BUDGET IF ABS(DELTA) GT Tolerance PRINT VARIANCE-EXCEPTION END-IF
MIN caps request at policy limit: APPROVED = MIN(REQUEST-AMT, POLICY-LIMIT). MAX floors calculated discount at zero: DISCOUNT = MAX(RAW-DISC, 0) preventing negative discount storage. Multi-argument MIN if documented—else nest MIN(MIN(A,B),C). When builtins unavailable, IF REQUEST GT LIMIT assign LIMIT else REQUEST duplicates logic—prefer MIN when readable on your release.
Broadcom assignment documentation: INTEGER transfers numerics left of decimal point, ignoring fractional portion per rules. Combined with ROUNDED, rounding occurs before integer extraction. Combined with TRUNCATED default, truncation applies. Valid only on numeric fields—compile error on alphabetic target. Use for whole-unit reporting from fractional calculations.
ROUNDED applies standard rounding to assignment result before store into receive field width. TRUNCATED drops low-order digits that do not fit—default truncation behavior when neither keyword specified varies—document shop standard. Tax and interest chains must use consistent modifier across programs reconciling to general ledger. Penny difference at .005 boundary is classic test case.
1234GROSS = HOURS * RATE ROUNDED TAX = GROSS * TAX-RATE ROUNDED NET = GROSS - TAX WHOLE-QT = QTY INTEGER
IF AMOUNT LT 0 detects negative only. IF AMOUNT GT 0 positive only. IF AMOUNT NE 0 non-zero. Two-branch IF replaces ABS compare when direction matters—overpayment versus underpayment different exception codes. ABS simplifies symmetric tolerance.
Relational operators on numeric fields use magnitude with implied decimal. EQ THRU defines inclusive band—IF SCORE EQ 60 THRU 79. Combine with ABS for distance from target: ABS(SCORE - TARGET) LE 5 for near-miss band. Numeric category functions do not replace relational operators—they complement expression computation before compare.
Sum exceeding receive field length truncates or abends per options—size W totals wider than detail amounts. MIN MAX results fit narrower field if operands fit—verify compile warnings. Increase W define length for accumulators in high-volume money jobs.
Numeric covers everyday business—ABS MIN MAX rounding. Math covers roots, powers beyond simple **, logarithms—statistical jobs. Payroll rarely needs SQRT; variance uses ABS in numeric category. Route advanced transcendental needs to math index.
Numeric tools measure money and counts. ABS asks how far from zero without caring if below or above. MIN picks the smaller allowance so you never approve too much. ROUNDED is rounding pennies fairly when splitting a bill. TRUNCATED is cutting extra decimal crumbs off without rounding up. These tools keep number boxes the right size and fairness for money math.
1. ABS(VARIANCE) returns:
2. INTEGER on assignment:
3. ROUNDED versus TRUNCATED on currency assignment:
4. IF ABS(DELTA) GT TOLERANCE detects:
5. MIN(REQUEST, LIMIT) selects: