Unsigned packed decimal constant—Data extract expressions


An unsigned packed decimal number is like a packed decimal number except that the right-most, four-bit nibble contains a packed decimal digit rather than a four-bit sign. Unsigned packed numbers are often encountered when handling certain date and time values returned by the system.

Unsigned packed decimal constants are most useful in simple, single term expressions where you have a requirement to output an unsigned packed decimal value. There is no particular advantage to specifying unsigned packed decimal constants in arithmetic or relational expressions since they are always converted to packed decimal in order to complete the operation.

The following rules apply for unsigned packed decimal constants:

  • An unsigned packed decimal constant is coded as U'constantValue', where constantValue is a string of 1 to 15 decimal digits.
  • No sign can be coded.
  • The maximum length of an unsigned packed decimal constant is 15 decimal digits (8 bytes).
Example
U'2468'
U'20040131'
U'123'
U'0'

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*