Page 1 of 1

How will C look in this program

PostPosted: Tue Oct 30, 2007 7:24 pm
by abkumarch
01 A pic X(02)
01 B pic X(03)
01 C pic X(04) VALUE 'c'.

01 C REDEFINES A

DISPLAY C ? how will C look like ? I dont want yr 'guess' ?

Plz ans those who have "tried & tested" . OK

Re: How will C look in this program

PostPosted: Wed Oct 31, 2007 2:13 am
by dick scherrer
Hello,

I dont want yr 'guess' ?

Plz ans those who have "tried & tested" . OK


Your "question" should not be answered by anyone here. C won't look like anything - your definitions contain multiple errors.

Re: How will C look in this program

PostPosted: Wed Oct 31, 2007 8:48 pm
by abkumarch
mr dick , will u plz elaborate the error, look i m a beginner& i wanted to kno the errors and ans

Re: How will C look in this program

PostPosted: Wed Oct 31, 2007 9:02 pm
by CICS Guy
abkumarch wrote:
01    A     pic  X(02)
01    B     pic  X(03)
01    C     pic  X(04) VALUE 'c'.
     
01    C     REDEFINES  A

DISPLAY C ? how will C look like ?
It's hard to say exactally, I would have to guess......
I dont want yr 'guess' ?
Plz ans those who have "tried & tested" . OK
That's the problem, as it is, it can not be "tried & tested" since it won't compile....
C does not follow A immediately....
If C does actually redefine A, then C can not have a value.....
The second definition of C is an unqualifiable duplicate....
The second definition of C does not have a pic or subordinate entries....
Try setting up the storage correctly and we can figure it out without guessing.....

Re: How will C look in this program

PostPosted: Wed Jan 02, 2008 3:29 pm
by sureshbabu
C redefines A

when you display value of C, it will display the value of A when A has some value in the procedure division else
it will so error as A is not initIalozed in working-storage-section