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

how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?

4 Answers   TCS,


If i got a job on mainframe technology, will i have a bright future?. Some people are discouraging me. Let me know, is it true? Please bring back me from the confusion.

2 Answers  


can internal sort be applied to sort ksds files?

1 Answers  


in the TIME parameter we r giving hours r minutes

4 Answers   IBM,


Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?

3 Answers   Microsoft,






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

2 Answers  


01 a pic 9(9v99) 01 b pic 9(9.99) wht will be the stored vales in both cases

6 Answers   Patni,


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

0 Answers  


How do pass the values to the parameters in cobol

2 Answers  


Can we move X(9) to 9(9). If yes what are the ways for doing this?

3 Answers  


what is label record is standard or omitted in file description of data division?

3 Answers   IBM, TCS,


Can we change the password using ALTER? anyone tried and changed?

0 Answers   IBM,


Categories