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 difference between a subscript and an index in a table definition?
I have a Main Program which is calling Sub-Program which is a DB2 pgm. What will happen if I am not closing the cursor used in the Sub-program? Please advise..
Can printer files (having 133 characters) be of variable length?
Write the code implementing the perform … varying.
What is the meaning of 'Eject' verb in cobol?
how to create temporary data set in jcl? what is the use?
3 Answers Cap Gemini, Temenos,
What is level 66 used for ?
Minimum how many Number of Paragraphs are there in ID- Divison?
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. 05 MM PIC 99. 05 YY PIC 99. (a) Nothing is wrong. (b) Under W-DATE all level 05 items are having a PIC 99 but level 01 has PIC X(6). (c) PIC can't be specified for a group item. (d) DD, MM, and YY are invalid datanames.
Explain about level numbers?
Can we move X(9) to 9(9). If yes what are the ways for doing this?