consider the following piece of code
01 GROUP-ITEM
05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50
05 AMOUNT-2 PIC 9(4)V99 USAGE COMP
MOVE ZERO TO GROUP-ITEM
ADD 50 TO AMOUNT-1
what will be the content of AMOUNT-1?
a.50
b.100
c.0
d.unpredictable
Answer Posted / priyanka
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 GROUP-ITEM.
05 AMOUNT-1 PIC 99V9 COMP USAGE COMP VALUE 50.
05 AMOUNT-2 PIC 9(4)V99 USAGE COMP.
PROCEDURE DIVISION.
A000-FIRST-PARA.
INITIALIZE GROUP-ITEM.
MOVE 0 TO GROUP-ITEM.
ADD 50 TO AMOUNT-1.
DISPLAY AMOUNT-1
.
STOP RUN.
If we don't use " MOVE 0 TO GROUP-ITEM." condition then the answer is 50 else if we are using it then the answer is 32.0. so I think the right answer is unpredictable.
Please correct in email if I am wrong.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are declaratives and what are their uses in cobol?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
How do get the result of your program directly on your pc?
What is the difference between binary search and sequential search?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
What is a SSRANGE and NOSSRANGE?
What are the various section in data division and briefly explain them.
How to use the same COBOL program in Batch and CICS on lines? explain with an example
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
I have a File that has duplicate records. I need only those records that occur more than thrice.?
What is a scope terminator give example?
I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.
Have you used comp and comp-3 in your project? And how?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com