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 are the different rules to perform a Search?

0 Answers  


How do define Dymanic array in cobol how do u define single demensional arry and multidymensional arry in ur cobol.

4 Answers   Cap Gemini,


What is Static,Dynamic linking ?

2 Answers  


Which division and paragraphs are mandatory for a COBOL program?

0 Answers  


if we have a 10 steps how to override the 4th step in jcl?

2 Answers   Hewitt,






What is the maximum size of a 01 level item in COBOL I? in COBOL II?

2 Answers   IBM, RBS,


Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefines a. 03 c occus 6 times pic 9. 02 d occurs 6 times pic 9. 03 e pic x(5) 03 f pic 999.

12 Answers  


have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records...

2 Answers   ITC Indian Tobacco Company, PNP, TCS,


maximum of how many screens we can open in emulator

2 Answers  


We know that size of redefine and redefining need not to be same..Then does the below case true 01 ws-date pic 9(6). 01 ws-redf-date REDEFINES ws-date 05 ws-year pic 9(4) 05 ws-mon pic 9(2) 05 ws-day pic 9(2)

1 Answers   Cap Gemini,


what is the use of filler in cobol programing?

4 Answers   MAT,


can any one give good example for cond 88 level number and for renames pls urgent dudes ?

3 Answers   DELL,


Categories