RPG (IBM i / AS/400) · File status code

Status Code 00101

What does Status Code 00101 mean in RPG (IBM i / AS/400)?

The SQRT operation code (or %SQRT built-in) was called with a negative numeric argument, which has no real-number result.

Status Code 00101IBM i / OS/400 · ILE RPG

Condition

The SQRT operation code (or %SQRT built-in) was called with a negative numeric argument, which has no real-number result.

Fix

Check that the argument is zero or positive before calling SQRT, and treat a negative input as an upstream data or business-logic bug rather than something to paper over here.

Related file status code