I HAVE FOLLOWING DECLARATION.
02. A PIC X(10) VALUE 'XXXXXXXXXX'.
02. B REDEFINES A.
05. C PIC X(3).
05. D PIC X(3).
05. E PIC 9(3).
IN MY PROG, I HAVE
MOVE 1 TO E.
DISPLAY A.
WHAT WILL BE DISPLAYED AS A RESULT OF THIS?
PLEASE EXPLAIN THE ANSWER. THANKS.
Answers were Sorted based on User's Feedback
Answer / duboisa
for me you have
c = 'XXX'
d = 'XXX'
e = 001
and A = 'XXXXXX001'
Is This Answer Correct ? | 7 Yes | 3 No |
Answer / paray2x
1. you will get data exception as you cannot move 'XXX' to
a 9(3) field.
2. Since you have not initialised C,D it will be '......001'
Is This Answer Correct ? | 7 Yes | 5 No |
Answer / smiley
Can anybody explain...How C and D are having values as "XXX"
in answer ,though not initialized. Purpose of redefines
clause is to use the same storage space for different data.
I think answer posted by PRANAY2X is correct.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / anil
we cannot declare the group item with level no 02 it should
be declared with 01. so the question itself wrong
Is This Answer Correct ? | 1 Yes | 8 No |
What is the difference between Perform para and perform asaection in cobol?
where will u code file status ?
How do you do in-line PERFORM?
How do u initialize an array?
01rec1. 05 a pic 999v99 value 123.12 05 b pic 99v9 value 45.9 02 rec2. 05 x pic 999v99 05 y pic 99v99 05 z pic x(3) value 'abc' if rec1 is moved to rec2 then what is the value of rec2?
where do we use dyanamic call ? and where do we use static call pls give any example pls ?
What is static and dynamic call in cobol?
How do you reference the fixed block file formats from cobol programs
consider the following progrm statements MOVE 0 TO SW.NO.OF.REC PERFORM PRI-OUT UNTIL SW=1 DISPALY NO.OF.REC STOP RUN PRE-OUT READ IN-FILE AT END MOVE 1 TO SW WRITE OUO-REC FROM IN-REC ADD 1 TO NO.OF REC if the IN-FILE contains 1000 records what value will be displayedafter the PERFORM is over?assume that N0.OF.REC has PIC 9(4) a.1000 b.1001 c.1 d.none of the above since there is a syntex error
What is an explicit scope terminator?
Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.
What are decleratives in COBOL ?