Convert Numeric to Character (CVTNC)

Instruction Syntax

Op Code (Hex) Operand 1 Operand 2 Operand 3
10A3 Receiver Source Attributes
Operand 1: Character variable scalar or data-pointer-defined character scalar.

Operand 2: Numeric scalar or data-pointer-defined numeric scalar.

Operand 3: Character(7) scalar or data-pointer-defined character(7) scalar.

Description:

The source numeric value (operand 2) is converted and copied to the receiver character string (operand 1). The receiver operand is treated as though it had the attributes supplied by operand 3. Operand 1, when viewed in this manner, receives the numeric value of operand 2 following the rules of the Copy Numeric Value (CPYNV) instruction.

The format of operand 3 is as follows:

Offset  
Dec Hex Field Name Data Type and Length
0 0 Scalar attributes Char(7)

0

0

  • Scalar type

    Hex 00 =
    Signed binary
    Hex 01 =
    Floating-point
    Hex 02 =
    Zoned decimal
    Hex 03 =
    Packed decimal
    Hex 0A =
    Unsigned binary

  • Char(1)

1 1
  • Scalar length
  • Bin(2)
   
    • If binary:

 

1

1

    • Length (L) (where L = 2 or 4)

      If floating-point:

    • Bits 0-15

1

1

    • Length (where L = 4 or 8)

      If zoned decimal or packed decimal:

    • Bits 0-15

1 1
    • Fractional digits (F)
    • Bits 0-7

1

1

    • Total digits (T)
      (where 1 <= T <= 63 and 0 <= F <= T)

    • Bits 8-15

3

3

  • Reserved (binary 0)

  • Bin(4)

7

7

--- End ---

 

The byte length of operand 1 must be large enough to contain the numeric value described by operand 3. If it is not large enough, a scalar value invalid (hex 3203) exception is signaled. If it is larger than needed, the numeric value is placed in the leftmost bytes and the unneeded rightmost bytes are unchanged by the instruction.

If a decimal to binary conversion causes a size (hex 0C0A) exception to be signaled, the binary value contains the correct truncated result only if the decimal value contains 15 or fewer significant nonfractional digits.

Authorization Required

  • None

Lock Enforcement

  • None

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
    • 0604 External Data Object Not Found
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 0C Computation
    • 0C02 Decimal Data
    • 0C06 Floating-Point Overflow
    • 0C07 Floating-Point Underflow
    • 0C09 Floating-Point Invalid Operand
    • 0C0A Size
    • 0C0C Invalid Floating-Point Conversion
    • 0C0D Floating-Point Inexact Result
  • 10 Damage Encountered
    • 1004 System Object Damage State
    • 1044 Partial System Object Damage
  • 1C Machine-Dependent
    • 1C03 Machine Storage Limit Exceeded
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2201 Object Not Found
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 2208 Object Compressed
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2E Resource Control Limit
    • 2E01 User Profile Storage Limit Exceeded
  • 32 Scalar Specification
    • 3201 Scalar Type Invalid
    • 3202 Scalar Attributes Invalid
    • 3203 Scalar Value Invalid
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation
    • 4402 Literal Values Cannot Be Changed