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 want Display WS-VARX and WS-VARN?

Answers were Sorted based on User's Feedback



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

Answer / reena

The Redefined clause cannot contain a Value Clause.
i.e. it should only be WS-VARN REDEFINES WS-VARX PIC 9(5).

Is This Answer Correct ?    12 Yes 1 No

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

Answer / jitinder

The Syntax of Redefine Clause is

Label number data-name-1 REDFINES data-name-2

Here data-name-1 should not contain VALUE clause, but data-
name-2 can contain VALUE clause.

Plz correct me if i m wrong.

Is This Answer Correct ?    1 Yes 3 No

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

Answer / saveen

ws-varx will have 12345fghij
ws-varn will have 12345.

pls kindly post ur views. am a beginner.

Is This Answer Correct ?    4 Yes 11 No

Post New Answer

More COBOL Interview Questions

What is an in-line perform ?

4 Answers   Accenture,


How can we find out wether to declare the data items like Integer, Char,Comp? If comp types how can we decide wether it is Comp and Comp3.How it is? Please Explain... Cheers.

1 Answers   Syntel,


What is binary search?

3 Answers  


How do you compile cobol program..?

1 Answers  


what is the use of filler in cobol programing?

4 Answers   MAT,






how do u list the abended jobs?

1 Answers   IBM,


What are the different forms of EVALUATE statement?

2 Answers   IBM, Micro Labs,


what is amode(24), amode(31), rmode(24) and rmode(any)?

0 Answers  


)what is retrieve?

1 Answers   IBM,


What is difference between com and com3? Eg. s9(4) so what is the memory it will occupy com and com3.

2 Answers  


How many sections are there in data division?.

10 Answers   Amdocs, TCS,


Name the sections present in data division.

0 Answers  


Categories