ILERPG.com β€” IBM i Β· ILE RPG Β· AS400 Mastery

This lesson is locked

A short preview is available. Purchase once for lifetime access.

Beginner Β· 10:00

Built-In Functions Part 2: Numeric and Date/Time

Numeric values rarely arrive at the precision arithmetic needs, and legacy dates rarely arrive as genuine DATE values at all. This lesson covers the conversion functions %DEC, %DECH, %INT, %UNS, and %CHAR; the constructors %DATE, %TIME, and %TIMESTAMP; the interval function %DIFF; and the…

What you'll be able to do

  1. 1Use %DEC to convert a character or numeric value into packed decimal with explicit precision, and distinguish its truncating behavior from the half-adjusting behavior of %DECH.
  2. 2Use %INT and %UNS to convert a value into a signed or unsigned whole number, and identify the runtime risk of applying %UNS to a value that may be negative.
  3. 3Use %CHAR to convert a numeric, date, time, or timestamp value into character form, including the optional format parameter.
  4. 4Construct genuine DATE, TIME, and TIMESTAMP values from character or numeric input using %DATE, %TIME, and %TIMESTAMP.
  5. 5Use %DIFF to compute the interval between two date, time, or timestamp values, and apply %DAYS, %MONTHS, and %YEARS to add or subtract a span of time.

Create your account

Takes a few seconds β€” you'll be right back here after.

Sign in

Welcome back β€” you'll be right back here after.

Forgot your password?