i have the following varibles in the working storage
05 ws-A PIC X(30)
VALUE 'ABCDEFGHIJKLMNOPQRESTUVWXYZ '
05 WS-B REDEFINES WS-A
10 WS-B1 PIC X(10).
10 WS-B2 PIC 9(10).
10 WS-B3 PIC X(10).
If I Display B1, B2 and B3 respectively, what is the value
displayed in B2
Answers were Sorted based on User's Feedback
Answer / sandy
It will not show variable mismatch error.
It will display KLMNOPQRES.
| Is This Answer Correct ? | 16 Yes | 2 No |
Answer / jibin jacob
there is no error.....
it will display 'klmnopqrst'
***********code************
identification division.
program-id. fst.
environment division.
data division.
working-storage section.
01 qs pic x(30) value
'abcdefghijklmnopqrstuvwxyzabcd'.
01 qs-r redefines qs.
02 qs-r1 pic x(10).
02 qs-r2 pic 9(10).
02 qs-r3 pic x(10).
01 aa pic 9.
procedure division.
p1.
accept aa.
display "r1=" qs-r1.
display "r2=" qs-r2.
display "r3=" qs-r3.
stop run.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / mr.perfect
i have compiled and run it , it is workign fine.
the output format is
B1:ABCDEFGHIJ
B2:KLMNOPQRES
B3:TUVWXYZ
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / anand
isn't this a compilation error? A value clause cannot be
associated with a variable that is redefined.
| Is This Answer Correct ? | 1 Yes | 6 No |
what is the minimum number of lines a Cobol program should have to successfully compile and run
what is the use of keep and pass in disp
How will 128 be saved in s9 (3) comp-3 How will 12 be saved in s9 (2) comp
I hav vari declaration like..... 77 a pic s9(9).99. 77 b pic s9(9).99 comp. 77 c pic s9(9).99 comp-3. if i use MOVE 123456789.99 to a,b,c what happen every one working fine ?
How is sign stored in a COMP field ?
how we rectify soc7 and soc4 errors in project?
Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?
what is meant by binary search?
what is lrec=f,what is difference between f,fb,v,vb?what is default value?how do we came to know that records are in f,fb,v,vb?
What are differences between Static Call and Dynamic Call?
10 Answers IBM, KBC, Keane India Ltd, Verizon,
Which of the following files can be OPENed in all the 4 modes? The four modes are INPUT, I-O, OUTPUT and EXTEND. (a) INDEXED (b) RELATIVE (c) SEQUENTIAL (d) All of the above
In a COBOL program, 2 tables TABLE1 and TABLE2 are defined that are indexed by INDEX1 and INDEX2 respectively. Can we use INDEX1 with TABLE2 and INDEX2 with TABLE1?