What will happen if a variable is declared as below..
Explain with an example? Working storage section:-

01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'.
01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'.

What will happen I am going to Display the WS-VARX and WS-
VARN?

Answer Posted / mallikarjun

WE CANNOT GIVE VALUE CLAUSE IN THE SECOND STATEMENT I.E.
WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345' . IF YOU
SPECIFY VALUE CLAUSE SYSTEM WILL SHOW AN ERROR, IF YOU
SPECIFY WITH OUT VALUE CLAUSE I.E.
WS-VARN REDEFINES WS-VARX PIC 9(5).
THEN IF YOU GIVE DISPLAY STATEMENT THEN ABCDEFGHIJ AND
ABCDE WILL BE DISPLAYED

Is This Answer Correct ?    26 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which division and paragraphs are mandatory for a COBOL program?

715


What is Pic 9v99 Indicates in COBOL?

735


What is the utilization of copybook in cobol?

666


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

1319


Write a program to enter and display the names of students in a class using the occurs clause.

659






What is static and dynamic call in cobol?

601


Write a cobol program making use of the redefine clause.

743


Which mode is used to operate the sequential file?

681


how do you define single dimensional array and multidimensional array in your cobol?

689


What is the difference between binary search and sequential search?

648


What is rmode(24)

686


What is the compute verb? How is it used?

673


What are literals?

636


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3728


I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue

1935