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
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Unsigned Packed Fields
Collapse
X
-
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
Comment