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

i want a program using by if, evaluate , string, unstring, perform, occurs?

4046


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1798


What is redefines clause in COBOL?

844


IF I mention stop run in CICS what happens?

1891


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1520






What is the local-storage section?

681


What is a report item?

737


) How do u handle errors in BMS macro?

1427


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

892


What do you understand by psb and acb?

661


Difference between array and sub-script ?

1159


What are the different rules to perform a Search?

613


How do you define a variable of comp-1 and comp-2?

701


What is the use of intialize verb?

742


how do you reference the ksds vsam file formats from cobol programs

660