1 / 18

Instruction type: SS1 Explicit Coding: D1(L1,B1),D2(B2) Example ED 3(4,5),8(7)

ED. 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 format (printable). Target Field.

dinah
Download Presentation

Instruction type: SS1 Explicit Coding: D1(L1,B1),D2(B2) Example ED 3(4,5),8(7)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ED

  2. 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 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 • Move the edit word to the output area • 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? ED X,Y Y 12 34 5D X 40 20 20 20 21 20 60 Before After X 40 F1 F2 F3 F4 F5 60

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

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

  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

More Related