MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pls help me of how to add a field in this layout

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
hogandeveloper
Beginner


Joined: 05 Aug 2008
Posts: 11
Topics: 10

PostPosted: Fri Nov 21, 2008 9:07 am    Post subject: pls help me of how to add a field in this layout Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Nov 21, 2008 11:19 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Nov 21, 2008 12:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Sun Nov 23, 2008 12:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group