gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [open-cobol-list] redefines problem


From: David Korn
Subject: Re: Re: [open-cobol-list] redefines problem
Date: Mon Mar 1 12:47:01 2004

> To my opinion the error is correct.
> You might find out what is happening, by moving
> the field WS-FUPPENVI-PRO to another field.
> Does the compiler move 80 bytes, or 70 bytes, which is the correct 
> length.
> ex:
> move all quote to WS-FUPPENVI-ENV in WS-FUPPENVI-ENV.
> move WS-FUPPENVI-PRO to a field of length 80.
> 
> Also, but I'm not sure, is it legal to redefine a group-item that 
> contains a redefines too?
> 
> Cheers,
> wim niemans
> 
> > With the following program I get
> > prog20.cob:14: size of `WS-FUPPENVI-DEV' larger than size of 
> > `WS-FUPPENVI-PRO'
> > even though the size of WS-FUPPENVI-DEV is not larger than WS-FUPPENVI-ENV.
> > The MVS compiler does not generate this error.
> > ===================cut here==========================
> >        IDENTIFICATION DIVISION.
> >        PROGRAM-ID.     PROG20.
> >        DATA DIVISION.
> >        WORKING-STORAGE SECTION.
> >        01  WS-FUPPENVI-REC.
> >            05 WS-FUPPENVI-ENV.
> >               10 WS-FUPPENVI-ENV           PIC X(80) VALUE SPACES.
> >            05 WS-FUPPENVI-PRO
> >               REDEFINES WS-FUPPENVI-ENV.
> >               10 WS-FUPPENVI-PRO-DSNPREFX.
> >                  15 WS-FUPPENVI-PRO-HLQ      PIC X(04).
> >                  15 WS-FUPPENVI-PRO-LVL      PIC X(01).
> >               10 WS-FUPPENVI-PRO-FILL01      PIC X(65).
> >            05 WS-FUPPENVI-DEV
> >               REDEFINES WS-FUPPENVI-PRO.
> >               10 WS-FUPPENVI-DEV-DSNPREFX   PIC X(25).
> >               10 WS-FUPPENVI-FILL01         PIC X(55).
> > ===================cut here==========================


On MVS it does work and the length of WS-FUPPENVI-PRO is 70 and
the length of WS-FUPPENVI-DEV is 80.

It appears that the size of each redefine can be as large
as the first definition.

David Korn
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]