Presentation is loading. Please wait.

Presentation is loading. Please wait.

PACK. Instruction type: SS2 Explicit Coding: D1(L1,B1),D2(L2,B2) – Example PACK 3(4,5),8(9,7) – Example PACK X(3),Y(4) Use: Converts zoned decimal fields.

Similar presentations


Presentation on theme: "PACK. Instruction type: SS2 Explicit Coding: D1(L1,B1),D2(L2,B2) – Example PACK 3(4,5),8(9,7) – Example PACK X(3),Y(4) Use: Converts zoned decimal fields."— Presentation transcript:

1 PACK

2 Instruction type: SS2 Explicit Coding: D1(L1,B1),D2(L2,B2) – Example PACK 3(4,5),8(9,7) – Example PACK X(3),Y(4) Use: Converts zoned decimal fields to packed, (also works on character fields that only contain digits)

3 What does it do? F1 F2 F3 F4 F5 C6 00 00 01 23 45 6C PACK X,Y Y X

4 What does it do? F1 F2 F3 F4 F5 C6 45 6C PACK X,Y Y X

5 PACK Example use: Assume: X DS PL5 Y DC Z’-234.57’ You execute: PACK X,Y Y Before: F2F3F4F5D7 X After: 000023457D

6 PACK Example use: Assume: X DS PL2 (TOO SHORT) Y DC Z’-234.57’ You execute: PACK X,Y Y Before: F2F3F4F5D7 X After: 457D DIGITS TRUNCATED

7 Programming Tips Make sure the receiving field will hold the result Pack works no matter the state of the data. In other words, if you pack garbage, you get more garbage Pack doesn’t generate a data exception (SOC7) You won’t discover the data is bad until you do arithmetic – AP, SP, MP, …

8 Try it in VisibleZ Try the following programs: – pack.obj – pack1.obj – pack2.obj – pack3.obj – pack4.obj


Download ppt "PACK. Instruction type: SS2 Explicit Coding: D1(L1,B1),D2(L2,B2) – Example PACK 3(4,5),8(9,7) – Example PACK X(3),Y(4) Use: Converts zoned decimal fields."

Similar presentations


Ads by Google