Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Unsigned Packed Fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unsigned Packed Fields

    spcarter99 wrote: > > I have a tape from a mainframe that contains unsigned packed fields. How can I convert this into a data type that can be read by a program? Within the program, you could do this to get at the packed value: Define a packed variable. Define a character overlay for the packed variable, one byte shorter, so it leaves the last byte alone. Set the packed variable to zero. Now move your unsigned packed data right-adjusted to the character overlay. Divide the packed field by 10 and you have your value. In RPG IV: D DS D packed 30P 0 D charOver 15A overlay(packed) c eval packed = 0 c evalr charOver = theUnsignedPackedData c eval packed = packed / 10

  • #2
    Unsigned Packed Fields

    Could you give and example of such; seems like an oxymoron to me! bobh

    Comment


    • #3
      Unsigned Packed Fields

      "Unsigned signed" would be an oxymoron. "Unsigned packed" just means there's 2 digits in every byte, even the last one. x'123456' vs x'0123456F'.

      Comment


      • #4
        Unsigned Packed Fields

        I have a tape from a mainframe that contains unsigned packed fields. How can I convert this into a data type that can be read by a program?

        Comment


        • #5
          Unsigned Packed Fields

          It's from a mainframe; what machine instruction would produce such? Generation of a sign nibble is under control of bit 12 of the PSW and I don't know how this could be turned off. Pack will move the high order nibble of the low order byte to the low order nibble of the low order byte of the packed field. Or so I thought. bobh

          Comment

          Working...
          X