****************ARITHMATICS**************************
IDENTIFICATION DIVISION. 00010000
PROGRAM-ID. ARITHMET. 00050003
AUTHOR. SRIBLOG. 00051000
DATE-WRITTEN. NOV 23, 2013. 00052000
DATE-COMPILED. NOV 23, 2013. 00053000
* 00054000
*-----------------------------------------------------------------00055000
*** BRIEF PROGRAM DESCRIPTION ***00056000
*-----------------------------------------------------------------00057000
* 00058000
* AUTHOR : SRIBLOG. 00059000
* DATE-WRITTEN : 18-MAY-2012. 00059100
* PROGRAM OBJECTIVE: THIS PROGRAM SHOWS HOW TO USE ARITHMETIC 00059200
* VERBS LIKE ADD,SUBTRACT,MULTIPLY,DIVIDE 00059300
* COMPUTE MOVE AND DISPLAY VERBS 00059500
* INPUT : NUMERIC VALUES 00059800
* OUTPUT : ARITHEMTIC OPERATION RESULTS 00059900
000600* REMARKS : NONE 00060000
000602*TABLES INSERTED : NONE 00060200
000603*TABLES UPDATED : NONE 00060300
000604*INPUT FILES : NONE 00060400
000605*OUTPUT FILES : NONE 00060500
000606******************************************************************00060600
000607* MAINTENANCE LOG 00060700
000608******************************************************************00060800
000609* REVISION NO.| DATE MODIFIED | AUTHOR | COMMENTS 00060900
000610******************************************************************00061000
000611* V1.0 | 18-MAY-2012 | SRIBLOG | INITIAL VERSION 00061100
000612*--------------|---------------|----------|-----------------------00061200
000613******************************************************************00061300
000620 DATA DIVISION. 00062000
000I50 WORKING-STORAGE SECTION. 00070000
01 WS01-INT-GROUP . 00080004
02 WS02-NUM1 PIC 9(3) VALUE 10 . 00090004
02 WS02-NUM2 PIC 9(3) VALUE 20 . 00100004
02 WS02-NUM3 PIC 9(3) VALUE 30 . 00110004
02 WS02-NUM4 PIC 9(3) VALUE 40 . 00120004
01 WS01-RES . 00130004
02 WS02-ADD-RES PIC 9(3) . 00140004
02 WS02-SUB-RES PIC 9(3) . 00150004
02 WS02-MUL-RES PIC 9(4) . 00160004
02 WS02-DIV-RES1 PIC 9(3) . 00170004
02 WS02-DIV-RES2 PIC 9(3) . 00170104
00170204
000701* 00170300
000702******************************************************************00170400
000703*VARIABLES TO HOLD THE TEMPORARY VARIABLES. 00170500
000704******************************************************************00170600
000705* 00170700
002000 PROCEDURE DIVISION. 00200000
002100* 00210000
002110******************************************************************00211000
002120 0000-MAIN-PARA. 00212000
002130******************************************************************00213000
002140* 00214000
002150 PERFORM 1000-INITIALIZATION-PARA 00215000
002160 THRU 1000-INITIALIZATION-PARA-EXIT 00216000
002170 00217000
002180 PERFORM 2000-PROCESS-PARA 00218000
002190 THRU 2000-PROCESS-PARA-EXIT 00219000
002191 00219100
002192 PERFORM 9000-TERMINATION-PARA 00219200
002193 THRU 9000-TERMINATION-PARA-EXIT 00219300
002194 . 00219400
002195* 00219500
002196 0000-MAIN-PARA-EXIT. 00219600
002197 EXIT 00219700
002198 . 00219800
002199* 00219900
002200******************************************************************00220000
002201 1000-INITIALIZATION-PARA. 00220100
002202*THIS PARA INITIALIZES THE ELEMENTS INSIDE THE ARRAY. 00220200
002203******************************************************************00220300
002204 MOVE ZEROS TO WS02-ADD-RES 00220401
002205 MOVE ZEROS TO WS02-SUB-RES 00220501
MOVE ZEROS TO WS02-MUL-RES 00220601
MOVE ZEROS TO WS02-DIV-RES1 00220701
MOVE ZEROS TO WS02-DIV-RES2 00220801
0I214 . 00221405
002215* 00221500
002216 1000-INITIALIZATION-PARA-EXIT. 00221600
002217 EXIT 00221700
002218 . 00221800
002219* 00221900
002220******************************************************************00222000
002221 2000-PROCESS-PARA. 00222100
002222******************************************************************00222200
002223* 00222300
002224 ADD WS02-NUM1 TO WS02-NUM2 GIVING WS02-ADD-RES 00222402
SUBTRACT WS02-NUM1 FROM WS02-NUM2 GIVING WS02-SUB-RES 00222501
MULTIPLY WS02-NUM1 BY WS02-NUM2 GIVING WS02-MUL-RES 00222602
DISPLAY "SUM=" WS02-ADD-RES 00222701
DISPLAY "DIFF=" WS02-SUB-RES 00222801
DISPLAY "MUL=" WS02-MUL-RES 00222901
002236 . 00223600
002237* 00223700
002238 2000-PROCESS-PARA-EXIT. 00223800
002239 EXIT 00223900
002240 . 00224000
002241* 00224100
003287******************************************************************00328700
003290 9000-TERMINATION-PARA. 00329000
003300*THIS PARA HALTS THE EXECUTION OF OBJECT PROGRAM. 00330000
003400******************************************************************00340000
003500* 00350000
003900 STOP RUN 00390000
004000 . 00400000
004100* 00410000
004200 9000-TERMINATION-PARA-EXIT. 00420000
004300 EXIT 00430000
004400 . 00440000
IDENTIFICATION DIVISION. 00010000
PROGRAM-ID. ARITHMET. 00050003
AUTHOR. SRIBLOG. 00051000
DATE-WRITTEN. NOV 23, 2013. 00052000
DATE-COMPILED. NOV 23, 2013. 00053000
* 00054000
*-----------------------------------------------------------------00055000
*** BRIEF PROGRAM DESCRIPTION ***00056000
*-----------------------------------------------------------------00057000
* 00058000
* AUTHOR : SRIBLOG. 00059000
* DATE-WRITTEN : 18-MAY-2012. 00059100
* PROGRAM OBJECTIVE: THIS PROGRAM SHOWS HOW TO USE ARITHMETIC 00059200
* VERBS LIKE ADD,SUBTRACT,MULTIPLY,DIVIDE 00059300
* COMPUTE MOVE AND DISPLAY VERBS 00059500
* INPUT : NUMERIC VALUES 00059800
* OUTPUT : ARITHEMTIC OPERATION RESULTS 00059900
000600* REMARKS : NONE 00060000
000602*TABLES INSERTED : NONE 00060200
000603*TABLES UPDATED : NONE 00060300
000604*INPUT FILES : NONE 00060400
000605*OUTPUT FILES : NONE 00060500
000606******************************************************************00060600
000607* MAINTENANCE LOG 00060700
000608******************************************************************00060800
000609* REVISION NO.| DATE MODIFIED | AUTHOR | COMMENTS 00060900
000610******************************************************************00061000
000611* V1.0 | 18-MAY-2012 | SRIBLOG | INITIAL VERSION 00061100
000612*--------------|---------------|----------|-----------------------00061200
000613******************************************************************00061300
000620 DATA DIVISION. 00062000
000I50 WORKING-STORAGE SECTION. 00070000
01 WS01-INT-GROUP . 00080004
02 WS02-NUM1 PIC 9(3) VALUE 10 . 00090004
02 WS02-NUM2 PIC 9(3) VALUE 20 . 00100004
02 WS02-NUM3 PIC 9(3) VALUE 30 . 00110004
02 WS02-NUM4 PIC 9(3) VALUE 40 . 00120004
01 WS01-RES . 00130004
02 WS02-ADD-RES PIC 9(3) . 00140004
02 WS02-SUB-RES PIC 9(3) . 00150004
02 WS02-MUL-RES PIC 9(4) . 00160004
02 WS02-DIV-RES1 PIC 9(3) . 00170004
02 WS02-DIV-RES2 PIC 9(3) . 00170104
00170204
000701* 00170300
000702******************************************************************00170400
000703*VARIABLES TO HOLD THE TEMPORARY VARIABLES. 00170500
000704******************************************************************00170600
000705* 00170700
002000 PROCEDURE DIVISION. 00200000
002100* 00210000
002110******************************************************************00211000
002120 0000-MAIN-PARA. 00212000
002130******************************************************************00213000
002140* 00214000
002150 PERFORM 1000-INITIALIZATION-PARA 00215000
002160 THRU 1000-INITIALIZATION-PARA-EXIT 00216000
002170 00217000
002180 PERFORM 2000-PROCESS-PARA 00218000
002190 THRU 2000-PROCESS-PARA-EXIT 00219000
002191 00219100
002192 PERFORM 9000-TERMINATION-PARA 00219200
002193 THRU 9000-TERMINATION-PARA-EXIT 00219300
002194 . 00219400
002195* 00219500
002196 0000-MAIN-PARA-EXIT. 00219600
002197 EXIT 00219700
002198 . 00219800
002199* 00219900
002200******************************************************************00220000
002201 1000-INITIALIZATION-PARA. 00220100
002202*THIS PARA INITIALIZES THE ELEMENTS INSIDE THE ARRAY. 00220200
002203******************************************************************00220300
002204 MOVE ZEROS TO WS02-ADD-RES 00220401
002205 MOVE ZEROS TO WS02-SUB-RES 00220501
MOVE ZEROS TO WS02-MUL-RES 00220601
MOVE ZEROS TO WS02-DIV-RES1 00220701
MOVE ZEROS TO WS02-DIV-RES2 00220801
0I214 . 00221405
002215* 00221500
002216 1000-INITIALIZATION-PARA-EXIT. 00221600
002217 EXIT 00221700
002218 . 00221800
002219* 00221900
002220******************************************************************00222000
002221 2000-PROCESS-PARA. 00222100
002222******************************************************************00222200
002223* 00222300
002224 ADD WS02-NUM1 TO WS02-NUM2 GIVING WS02-ADD-RES 00222402
SUBTRACT WS02-NUM1 FROM WS02-NUM2 GIVING WS02-SUB-RES 00222501
MULTIPLY WS02-NUM1 BY WS02-NUM2 GIVING WS02-MUL-RES 00222602
DISPLAY "SUM=" WS02-ADD-RES 00222701
DISPLAY "DIFF=" WS02-SUB-RES 00222801
DISPLAY "MUL=" WS02-MUL-RES 00222901
002236 . 00223600
002237* 00223700
002238 2000-PROCESS-PARA-EXIT. 00223800
002239 EXIT 00223900
002240 . 00224000
002241* 00224100
003287******************************************************************00328700
003290 9000-TERMINATION-PARA. 00329000
003300*THIS PARA HALTS THE EXECUTION OF OBJECT PROGRAM. 00330000
003400******************************************************************00340000
003500* 00350000
003900 STOP RUN 00390000
004000 . 00400000
004100* 00410000
004200 9000-TERMINATION-PARA-EXIT. 00420000
004300 EXIT 00430000
004400 . 00440000