Presentation is loading. Please wait.

Presentation is loading. Please wait.

ED. Instruction type: SS1 Explicit Coding: D1(L1,B1),D2(B2) – Example ED 3(4,5),8(7) – Example ED X(8),Y Use: Converts packed fields to an edited character.

Similar presentations


Presentation on theme: "ED. Instruction type: SS1 Explicit Coding: D1(L1,B1),D2(B2) – Example ED 3(4,5),8(7) – Example ED X(8),Y Use: Converts packed fields to an edited character."— Presentation transcript:

1 ED

2 Instruction type: SS1 Explicit Coding: D1(L1,B1),D2(B2) – Example ED 3(4,5),8(7) – Example ED X(8),Y Use: Converts packed fields to an edited character format (printable)

3 Target Field The target field must contain edit characters that describe how the packed field will be edited X’40’ Blank X’20’ Digit Selector X’21’ Digit Selector and Significance Starter X’4B’ Decimal Point X’6B’ Comma X’60’ Negative Sign

4 Edit Process 1) Build an edit word 2)Move the edit word to the output area 3)Ed-it the packed field into the output area Example: EDWD DC X’40202020212060’ AMTPK DC PL3’-12345’ AMTOUT DS CL7 … MVC AMTOUT,EDWD ED AMOUNT,AMTPK

5 What happens? 12 34 5D 40 20 20 20 21 20 60 ED X,Y Y X 40 F1 F2 F3 F4 F5 60X Before After

6 What happens? 12 34 5C 40 20 20 20 21 20 60 ED X,Y Y X 40 F1 F2 F3 F4 F5 40X Before After

7 What happens? 00 04 5D 40 20 21 20 20 20 60 ED X,Y Y X 40 40 40 F0 F4 F5 60X Before After

8 Making it work Start the edit word with a fill character Count the number of digits in the packed field. Example XPK DS PL4 No of digits = (2 x 4) – 1 = 7 digits The number of 20’s and 21’s in the edit word must match this number It can also contain other edit symbols The output field size must match the edit word field size

9 Building the Edit Word XPK DS PL4 EDWD DC ???

10 Building the Edit Word Start with the fill character XPK DS PL4 EDWD DC X’40’

11 Building the Edit Word Count the digits XPK DS PL4 (4 x 2) – 1 = 7 EDWD DC X’40’

12 Building the Edit Word Add correct number of 20’s and a 21 XPK DS PL4 (4 x 2) – 1 = 7 EDWD DC X’4020202020202120’

13 Building the Edit Word Add other edit characters as needed XPK DS PL4 (4 x 2) – 1 = 7 EDWD DC X’40204B2020204B20212060’

14 Building the Edit Word Count characters in the edit word XPK DS PL4 (4 x 2) – 1 = 7 EDWD DC X’40204B2020204B20212060’ | 11 |

15 Building the Edit Word Output field must match edit word XPK DS PL4 (4 x 2) – 1 = 7 EDWD DC X’40204B2020204B20212060’ | 11 | XOUT DS XL11

16 Finishing the job Move the edit word to the output area MVC XOUT,EDWD Edit the packed field into the output area ED XOUT,XPK

17 Common Errors The packed field doesn’t match the edit word field (the number of 20s and 21s must match the number of digits in the packed field) The edit word size must match the output field size

18 Try it in VisibleZ Try the following programs: – ed.obj – ed1.obj – ed2.obj – ed3.obj – ed4.obj


Download ppt "ED. Instruction type: SS1 Explicit Coding: D1(L1,B1),D2(B2) – Example ED 3(4,5),8(7) – Example ED X(8),Y Use: Converts packed fields to an edited character."

Similar presentations


Ads by Google