View previous topic :: View next topic |
Author |
Message |
hogandeveloper Beginner
Joined: 05 Aug 2008 Posts: 11 Topics: 10
|
Posted: Fri Nov 21, 2008 9:07 am Post subject: pls help me of how to add a field in this layout |
|
|
Hi All,
there is a copy book of the below layout
Code: |
01 MENU-API.
03 ACTION PIC XX.
03 RESULT PIC XX.
03 ACCOUNT-AREA.
05 SELECTION PIC X.
05 COID.
07 COID-N PIC S9(4) COMP.
05 PRODUCT-CODE PIC X(3).
05 SUB-PRODUCT PIC X(2).
05 ACCOUNT-NUMBER PIC X(23).
03 RELATIONSHIPS-AREA REDEFINES ACCOUNT-AREA.
05 REL-ACTION PIC X(04).
05 REL-NAME PIC X(40).
05 REL-ID-NO PIC X(13).
05 FILLER PIC X(100).
|
Here i need to add a new field in account area but since it is redefined below i'm unable to add the same. please suggest me of what to do.
thanks,
HD |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Nov 21, 2008 11:19 am Post subject: |
|
|
hogandeveloper,
Does that code even compile? Account-area is only 31 bytes(1+2+3+2+23) whereas RELATTIONS-area is is 157 bytes(4+40+13+100). I am not sure but if I remember correctly you canNOT redefine a smaller field as a typical redefine shares the same storage
kolusu |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Nov 21, 2008 12:35 pm Post subject: |
|
|
kolusu,
not only does this crap compile with enterprise cobol, there is no warning issued either - well, no warning necessary - compiler knew the layout sucked and made provisions. I chopped this out of the compiler listing.
Code: |
01 MENU-API. 0CL161
03 ACTION PIC XX. 0000000 2C
03 RESULT PIC XX. 0000002 2C
03 ACCOUNT-AREA. 0000004 0CL31
05 SELECTION PIC X. 0000004 1C
05 COID. 0000005 0CL2
07 COID-N PIC S9(4) COMP. 0000005 2C
05 PRODUCT-CODE PIC X(3). 0000007 3C
05 SUB-PRODUCT PIC X(2). 000000A 2C
05 ACCOUNT-NUMBER PIC X(23). 000000C 23C
03 RELATIONSHIPS-AREA REDEFINES ACCOUNT-AREA. 0000004 0CL157
05 REL-ACTION PIC X(04). 0000004 4C
05 REL-NAME PIC X(40). 0000008 40C
05 REL-ID-NO PIC X(13). 0000030 13C
05 FILLER PIC X(100). 000003D 100C
|
probably enough customers had so many programmers that could not bother to put RELATIONSHIPS-AREA first and then redefine it with ACCOUNT-AREA, IBM decided to make the compiler change the code. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Sun Nov 23, 2008 12:09 pm Post subject: |
|
|
It appears that RELATIONSHIPS-AREA and ACCOUNT-AREA have different information, so I don't think adding a new field to ACCOUNT-AREA would be any issue. |
|
Back to top |
|
 |
|
|