1 / 17

Mainframe Training In Hyderabad

Get IBM Mainframe Training in Hyderabad, Ameerpet from Sannihitha Technologies and enhance IT career growth. Enroll Now With us @ 8099754435

srivasavi
Download Presentation

Mainframe Training In Hyderabad

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. IBM Mainframe IBM Mainframe COBOL Arithmetic Statements -Srinivas K Video Based Training To Simplify Mainframe Programming Course Duration: 2 Months Contact Us: 8099754435(Srinivas k)

  2. COBOL Arithmetic Statements ADD SUBTRACT MULTIPLY DIVIDE COMPUTE

  3. ADD Statement Syntax-1 ADD { identifier-1, literal-1 } [ , identifier-2, literal-2 ] . . . TO identifier-3 [ , identifier-4 ] . . . Syntax-2 ADD { identifier-1, literal-1 } { identifier-2, literal-2 } [ identifier-3, literal-3 ] GIVING identifier-4 . . .

  4. ADD Statement Examples (A) ADD A TO B. (B) ADD A, B TO C. (C) ADD 12, A, B TO C, D (D) ADD A, B GIVING C. (E) ADD 12, A GIVING B,C.

  5. SUBTRACT Statement Syntax SUBTRACT { identifier-1, literal-1 } [ identifier-2, literal-2 ] . . . FROM identifier-3 [ , identifier-4 ] [ , GIVING identifier-5 [ , identifier-6 ] . . . ]

  6. SUBTRACT Statement Examples (1) SUBTRACT A FROM B. (2) SUBTRACT A, B FROM C. (3) SUBTRACT 5, A FROM B, C. (4) SUBTRACT 12 FROM A GIVING B. (5) SUBTRACT A FROM B GIVING C.

  7. MULTIPLY Statement Syntax MULTIPLY { identifier-1, literal-1 } BY identifier-2 [ identifier-3 ] . . . [ , GIVING identifier-4 [ , identifier-5 ] . . . ]

  8. MULTIPLY Statement Examples (1) MULTIPLY A BY B (2) MULTIPLY A BY B GIVING C3. (3) MULTIPLY 5 BY A GIVING B. (4) MULTIPLY A BY B GIVING C, D.

  9. DIVIDE Statement Syntax-1 DIVIDE { identifier-1, literal-1 } INTO identifier-2 [ , identifier-2 ] . . . [ GIVING identifier-4 [ , identifier-5 ] . . . ] .. Syntax-2 DIVIDE { identifier-1, literal-1 } BY { identifier-2, literal-2 } GIVING identifier-3 [ , identifier-4 ].

  10. DIVIDE Statement Syntax-3 DIVIDE { identifier-1, literal-1 } { INTO , BY } { identifier-2, literal-2 } GIVING identifier-3 REMAINDER identifier-4 .

  11. DIVIDE Statement Examples (1) DIVIDE 5 INTO A. (2) DIVIDE 6 INTO A GIVING B, C. (3) DIVIDE A BY 3 GIVING B, C. (4) DIVIDE A BY B GIVING C. (5) DIVIDE A BY B GIVING C REMAINDER D.

  12. ROUNDED Option Syntax Arithmetic statement [ ROUNDED ]. Examples (1) ADD NUM-1, NUM-2, NUM-3 GIVING NUM-4 ROUNDED. (2) DIVIDE NUM-1 BY NUM-2 GIVING NUM-3 ROUNDED.

  13. The ROUNDED option Receiving Field Actual Result Truncated Result Rounded Result 123.2 123.3 PIC 9(3)V9. 567.23 PIC 9(3). 567 123 123  The ROUNDED option takes effect when, after decimal point alignment, the result calculated must be truncated on the right hand side.  The option adds 1 to the receiving item when the leftmost truncated digit has an absolute value of 5 or greater.

  14. ON SIZE ERROR Option Syntax Arithmetic statement [ON SIZE ERROR imperative statement . . .] Examples (1) ADD NUM-1, NUM-2, NUM-3 TO NUM-4 ON SIZE ERROR PERFORM 900-EXIT-PARA. (2). DIVIDE NUM-1 BY NUM-2 ON SIZE ERROR PERFORM 800-ERROR-PARA.

  15. COMPUTE Verb Syntax COMPUTE identifier-1 . . . [ ROUNDED ] = algebraic expression [ ON SIZE ERROR ] imperative statement. Example COMPUTE VOLUME = ( 4 / 3) * ( 22 / 7 ) * R ** 3. Note: If the ROUNDED and ON SIZE ERROR both appear, then the ROUNDED option should precede the ON SIZE ERROR.

  16. The COMPUTE          COMPUTE Identifier [ ROUNDED ] ... = ArithmeticExpression                  ON SIZE ERROR NOT ON SIZE ERROR StatementBlock END-COMPUTE Precedence Rules. 1. 2. ** * / + - = = = = = POWER MULTIPLY DIVIDE ADD SUBTRACT NN x ÷ + - 3. Compute IrishPrice = SterlingPrice / Rate * 100. 1000.50 156.25 87 179.59 156.25 87 Before After

  17. Thanks For Watching Our Video Grab The Latest IT Courses Information By To Our Channel Address: Flat# 407, Adhitya Enclave, Annapurna Block, Ameerpet, Hyderabad-16. Ph: 8099754435

More Related