80 likes | 235 Views
UNPK. UNPK. Instruction type: SS2 Explicit Coding: D1(L1,B1),D2(L2,B2) Example UNPK 3(4,5),8(9,7) Example UNPK X(3),Y(4) Use: Converts packed fields to zoned decimal. What does it do?. UNPK X,Y. 00 12 3C. Y. X. F0 F0 F1 F2 C3. What does it do?. UNPK X,Y.
E N D
UNPK • Instruction type: SS2 • Explicit Coding: D1(L1,B1),D2(L2,B2) • Example UNPK 3(4,5),8(9,7) • Example UNPK X(3),Y(4) • Use: Converts packed fields to zoned decimal
What does it do? UNPK X,Y 00 12 3C Y X F0 F0 F1 F2 C3
What does it do? UNPK X,Y 00 00 12 34 45 6C Y F5 C6 X
UNPK • Example use: Assume: X DC PL3’-123.45’ Y DS ZL7 You execute: UNPK Y,X X Before: 12345D Y After: F0F0F1F2F3F4D5
UNPK • Example use: Assume: X DC PL3’-123.45’ Y DS ZL3 (Too short) You execute: UNPK Y,X X Before: 12345D Y After: F3F4D5
Programming Tips • Make sure the receiving field will hold the result • UNPK works no matter the state of the data. In other words, if you UNPK garbage, you get more garbage • UNPK doesn’t generate a data exception (SOC7) • ED or EDMK will also convert from packed decimal, but leaves the data in a printable format
Try it in VisibleZ • Try the following programs: • unpk.obj • unpk1.obj • unpk2.obj