Consider the following: DATA DIVISION . WORKING - STORAGE SECTION . 01 WS - NUM1 PIC 9 ( 4 ) VALUE 10 . 01 WS - NUM2 PIC 9 ( 4 ) VALUE 10. 01 WS - NUM3 PIC 9 ( 4 ) VALUE 100. 01 WS - NUM4 PIC 9 ( 4 )...

1 answer below »

Consider the following:



DATA DIVISION
.




WORKING

-
STORAGE SECTION
.




01
WS
-
NUM1 PIC
9
(
4
)
VALUE
10
.




01
WS
-
NUM2 PIC
9
(
4
)
VALUE
10.




01
WS
-
NUM3 PIC
9
(
4
)
VALUE
100.




01
WS
-
NUM4 PIC
9
(
4
)
VALUE
100.




01
WS
-
NUMA PIC
9
(
4
)
VALUE
10.




01
WS
-
NUMB PIC
9
(
4
)
VALUE
10.




01
WS
-
NUMC PIC
9
(
4
)
VALUE
10.




01
WS
-
NUMD PIC
9
(
4
)
VALUE
100.




01
WS
-
NUME PIC
9
(
4
)
VALUE
10.


Using the data item list above, answer the following questions. Consider the initialized values as stated above for each question. (ie disregard the changes to data items from previous questions).




SUBTRACT

WS-NUM1 WS-NUM2

FROM


WS-NUM3
WS-NUM4.



  1. What are the following values after this statement?



WS
-
NUM1:



WS
-
NUM2:



WS
-
NUM3:



WS
-
NUM4:






ADD

WS-NUM1 WS-NUM2

TO

WS-NUM3

GIVING

WS-NUM4.



  1. What are the following values after this statement?



WS
-
NUM1:



WS
-
NUM2:



WS
-
NUM3:



WS
-
NUM4:




SUBTRACT

WS-NUMA WS-NUMB
WS-NUMC


FROM

WS-NUMD

GIVING


WS-NUME
.



  1. What are the following values after this statement?



WS
-
NUMA:



WS
-
NUMB:



WS
-
NUMC:



WS
-
NUMD:



WS
-
NUME:






MULTIPLY

WS-NUMA

BY

WS-NUMB WS-NUMC.



  1. What are the following values after this statement?



WS
-
NUMA:



WS
-
NUMB:



WS
-
NUMC:



WS
-
NUMD:



WS
-
NUME:





MULTIPLY

WS-NUMA

BY

WS-NUMB

GIVING

WS-NUMC.



  1. What are the following values after this statement?



WS
-
NUMA:



WS
-
NUMB:



WS
-
NUMC:



WS
-
NUMD:



WS
-
NUME:





DIVIDE

WS-NUMD

BY

7

GIVING

WS-NUMA

REMAINDER


WS-NUMB
.



  1. What are the following values after this statement?



WS
-
NUMA:



WS
-
NUMB:



WS
-
NUMC:



WS
-
NUMD:



WS
-
NUME:




COMPUTE


WS-NUMC
= (WS-NUM1 * WS-NUM2) - (WS-NUMA / WS-NUMB) +
WS-NUM3
.



  1. What are the following values after this statement?



WS
-
NUMC:


Exercise #2 (String Handling)


Consider the following:



DATA DIVISION
.




WORKING

-
STORAGE SECTION
.




01
FIELD-1 PIC
X
(
10
)
VALUE
"AAABBXBBAA".




01
FIELD-2 PIC
X
(
10
)
VALUE
"LastName".




  • FIELD-3 PIC
    X
    (
    10
    )
    VALUE
    "FirstName".




  • FIELD-4 PIC
    X
    (
    20
    )
    VALUE
    " ".


Using the data item list above, answer the following questions. Consider the initialized values as stated above for each question. (ie disregard the changes to data items from previous questions).




INSPECT

FIELD-1

REPLACING



FIRST


"B"


BY


"Z"
.



  1. What are the following values after this statement?



FIELD-1:





INSPECT

FIELD-1

REPLACING



ALL


"B"


BY


"C"
.



  1. What are the following values after this statement?



FIELD-1:






STRING


FIELD-2


DELIMITED



BY



SIZE




FIELD-3


DELIMITED



BY



SPACE





INTO

FIELD-4





ON



OVERFLOW



DISPLAY


"OVERFLOW!"




END-STRING



  1. What are the following values after this statement?



FIELD-2:



FIELD-3:



FIELD-4:







Answered Same DayAug 17, 2022

Answer To: Consider the following: DATA DIVISION . WORKING - STORAGE SECTION . 01 WS - NUM1 PIC 9 ( 4 ) VALUE...

Aditi answered on Aug 17 2022
67 Votes
SOLUTION
Task 1
1. WS-NUM1: 0010
WS-NUM2: 0010
WS-NUM3: 0080
WS-NUM4: 0080

2. WS-NUM1: 0010

WS-NUM2: 0010
WS-NUM3: 0100
WS-NUM4: 0120

3. WS-NUMA: 0010
WS-NUMB: 0010
WS-NUMC: 0010
WS-NUMD: 0100
WS-NUME: 0070
4. WS-NUMA: 0010
WS-NUMB: 0100
WS-NUMC: 0100
WS-NUMD: 0100
WS-NUME:...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here