01 level redefined 10 times.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

01 level redefined 10 times.

Postby ranga_subham » Fri Jul 18, 2008 7:55 pm

Hi,

We have a COBOL program wherein, a 01 level item is redefined several times but with different elementary fields. While writing, the programmer used only the original 01 level item to write from. :o

Can't the redefined group item be used to write from? :?

Please explain.

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: 01 level redefined 10 times.

 

Re: 01 level redefined 10 times.

Postby dick scherrer » Fri Jul 18, 2008 8:08 pm

Hello,

While writing, the programmer used only the original 01 level item to write from.
Why does this cause concern?

Can't the redefined group item be used to write from?
It can but why would you want to?

You need to keep in mind that when something is redfined, there is stil only one address where things are moved to/from and or read into/written from. The main thing a redefines provides is the ability to define different "pictures" for the same data.

Unless there is some reason you have not posted, i'd suggest leaving the code as it is.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: 01 level redefined 10 times.

Postby ranga_subham » Fri Jul 18, 2008 8:19 pm

This is the first time I seen such a thing. I don't know if redefined group item also can be used to write from.

Thanks Dick.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: 01 level redefined 10 times.

Postby dick scherrer » Fri Jul 18, 2008 8:22 pm

You're welcome :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post