1 / 61

Any Questions?

Any Questions?. Agenda. Moving Data Selection Statements System Date Indicators in Display files. Moving Data. Move Statement. MOVE Identifier/Variable or Literal/Constant TO (Indentifier/Variable)s. Numeric Moves. Sending Field Receiving Field Okay? Numeric Numeric Field sizes

judd
Download Presentation

Any Questions?

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. Any Questions?

  2. Agenda • Moving Data • Selection Statements • System Date • Indicators in Display files

  3. Moving Data

  4. Move Statement MOVE Identifier/Variable or Literal/Constant TO (Indentifier/Variable)s

  5. Numeric Moves Sending Field Receiving Field Okay? Numeric Numeric • Field sizes Numeric Alphanumeric • Decimal places • Packed fields Numeric Group Item

  6. Alphanumeric Moves Sending Field Receiving Field Okay? Alphanumeric Numeric • Decimal Places • Packed fields Alphanumeric Alphanumeric • Field sizes Alphanumeric Group Item

  7. Zero Moves Sending Field Receiving Field Okay? Zeros Numeric Zeros Alphanumerics Zeros Group Item

  8. Spaces Moves Sending Field Receiving Field Okay? Spaces Numeric Spaces Alphanumerics Spaces Group Items

  9. MOVE numeric TO numeric. Field A PIC 9(3) Field B PIC 9(3) 100 Field A PIC 9(3) Field B PIC 9(4) 100 Field A PIC 9(3) Field B PIC 9(2) 100

  10. MOVE numeric TO numeric. Field A PIC 9(3)V99 Field B PIC 99V9 100.03 Field A PIC 9(3)V99 Field B PIC 9(4)V999 100.03 Field A PIC 9(3)V99 Field B PIC 9(3) 100.03

  11. MOVE numeric TO alphanumeric. Field A PIC 9(3) Field B PIC X(3) 100 Field A PIC 9(3) Field B PIC X(4) 100 Field A PIC 9(3) Field B PIC X(2) 100

  12. MOVE numeric TO alphanumeric. Field A PIC 9(3)V99 Field B PIC X(3) 100.03

  13. MOVE numeric TO group item Field A PIC 9(3) Field B. Field C PIC 99. Field D PIC 9. Field A Field B Field C Field D 124

  14. MOVE numeric TO group item Field A PIC 9(3) Field B. Field C PIC 99. Field D PIC 99. Field A Field B Field C Field D 124

  15. MOVE numeric TO group item Field A PIC 9(3) Field B. Field C PIC 9. Field D PIC 9. Field A Field B Field C Field D 124

  16. MOVE numeric TO group item Field A PIC 9(3) Field B. Field C PIC XX. Field D PIC X. Field A Field B Field C Field D 124

  17. MOVE numeric TO group item Field A PIC 9(3) Field B. Field C PIC XX. Field D PIC XX. Field A Field B Field C Field D 124

  18. MOVE numeric TO group item Field A PIC 9(3) Field B. Field C PIC X. Field D PIC X. Field A Field B Field C Field D 124

  19. MOVE alphanum TO alphanum. Field A PIC X(3) Field B PIC X(3) CJM Field A PIC X(3) Field B PIC X(4) CJM Field A PIC X(3) Field B PIC X(2) CJM

  20. MOVE alphanum TO group item Field A PIC X(3) Field B. Field C PIC XX. Field D PIC X. Field A Field B Field C Field D CJM

  21. MOVE alphanum TO group item Field A PIC X(3) Field B. Field C PIC XX. Field D PIC XX. Field A Field B Field C Field D CJM

  22. MOVE alphanum TO group item Field A PIC X(3) Field B. Field C PIC X. Field D PIC X. Field A Field B Field C Field D CJM

  23. MOVE alphanum TO numeric. Field A PIC X(3) Field B PIC 9(3) ABC

  24. MOVE zeros TO numeric. Field B PIC 9(3) Field B PIC 9(4)V99

  25. MOVE zeros TO alphanumeric. Field B PIC X(3) Field B PIC X(1)

  26. MOVE zero TO group item Field B. Field C PIC 99. Field D PIC 9. Field B Field C Field D

  27. MOVE zeros TO group item Field B. Field C PIC XX. Field D PIC XX. Field B Field C Field D

  28. MOVE spaces TO numeric. Field B PIC 9(3) Field B PIC 9(4)V99 Note: This is not supposed to work!

  29. MOVE spaces TO alphanumeric. Field B PIC X(3) Field B PIC X(1)

  30. MOVE spaces TO group item Field B. Field C PIC 99. Field D PIC 9. Field B Field C Field D Note: this is not supposed to work!

  31. MOVE spaces TO group item Field B. Field C PIC XX. Field D PIC XX. Field B Field C Field D

  32. On your own, figure out how Group Item to Group Item and Group Item to Alphanumeric work!

  33. Selection Statements

  34. Sorting on the iSeriesEBCDIC Sort 1. Blanks 2. Special Characters 3. Lower Case Letters 4. Upper Case Letters 5. Numbers

  35. Selection Condition? Statement2 Statement1

  36. Selection IF Condition THEN Statement(s) ELSE Statement(s) END-IF

  37. If-Then-Else A = 10 B = 20 If (A > B) THEN MOVE B TO A.

  38. If-Then-Else A = 10 B = 20 If A > B THEN MOVE B TO A ELSE MOVE A TO B.

  39. If-Then-Else A = 10 B = 20 C = 30 D = 40 If A < B THEN IF A > C THEN MOVE A TO C ELSE MOVE C TO A END-IF ELSE MOVE A TO B END-IF.

  40. Sign Test A = 10 B = -10 If A IS NEGATIVE IF A IS POSITIVE MOVE B TO A MOVE B TO A ELSE ELSE MOVE A TO B. MOVE A TO B.

  41. Numeric Test A = 10 B = -10 If A IS NUMERIC ADD A TO B.

  42. Alphabetic Test C = ‘CJ’ D = ‘Christy’ If C is ALPHABETIC THEN MOVE C TO OLDER-SISTER ELSE MOVE D TO OLDER-SISTER END-IF

  43. Alphabetic-Upper Test C = ‘CJ’ D = ‘Christy’ If C is ALPHABETIC-UPPER THEN MOVE C TO OLDER-SISTER ELSE MOVE D TO OLDER-SISTER END-IF

  44. Alphabetic-Lower Test C = ‘CJ’ D = ‘Christy’ If D is ALPHABETIC-LOWER THEN MOVE D TO OLDER-SISTER ELSE MOVE C TO OLDER-SISTER END-IF

  45. AND

  46. OR

  47. AND/OR Order of Operations • Brackets First • ANDs (From Left to Right) • ORs (From Left to Right)

  48. ANDs/ORs A = 10 B = -10 C = 20 If (A<B) OR (B<C) AND (A<C) THEN MOVE A TO C ELSE MOVE A TO B END-IF

  49. ANDs/ORs A = 10 B = -10 C = 20 If ((A<B) OR (B<C)) AND (A<C) THEN MOVE A TO C ELSE MOVE A TO B END-IF

  50. Case Statements

More Related