Remove redefines from cobol copybooks



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

Re: Remove redefines from cobol copybooks

Postby BillyBoyo » Thu Feb 28, 2013 5:48 am

If the REDEFINES was originally one of those which is allowing part of a record to be "re-used" for data which is unique to different circumstances of the data, like (AGENT-AGENT-NAME, AGENT-CUSTOMER-NAME REDEFINES AGENT-AGENT-NAME) then only one of your new fields will contain a value on any one record.

Something like this is most likely for your REDEFINES. If you remove the REDEFINES so that there are now two fields, when AGENT-AGENT-NAME is given a value, then AGENT-CUSTOMER-NAME needs an initial value (like SPACE or LOW-VALUES). When AGENT-CUSTOMER-NAME is given a value, AGENT-AGENT-NAME needs an initial value.

If the REDEFINES is to allow a different definition of the field for some purpose, like a packed-decimal with a YYYYMM redefined for acessing the YYYY, the more work needs to be done, as the original intention has been spoiled.

Sometimes, although not usually on records, the REDEFINES is to allow "something to be done" to a field which can't be done with the other definition. Like accessing a one-byte binary value. Again, if this was the original intention, more work is needed, as this will now fail to achieve its object.

There is no "magic resolution" to any of these, you have to identify how the REDEFINES is being used, where the different elements of the REDEFINES are being referenced, and ensure that the correct new procedure code is included to achieve both the original and new purposes.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Remove redefines from cobol copybooks

Postby nikesh_rai » Thu Feb 28, 2013 10:33 pm

Thanks Billy,

I think i can do it. I got the approvals for using a COBOL module to move values to those fields which were redefined previously. The task becomes little bit easier.
I will try to do it with COBOL and will let you know the result.

This requirement is just because of a new remote system is not able handle some values which are being passed from our system through those redefined fields.

Thanks
Nikesh
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Remove redefines from cobol copybooks

Postby Robert Sample » Fri Mar 01, 2013 1:28 am

This requirement is just because of a new remote system is not able handle some values which are being passed from our system through those redefined fields.
The REDEFINES has nothing to do with the data in the field.
The DATA has everything to do with the data in the field -- and changing a REDEFINES will not affect the data.

Is this a case of the remote system not being able to handle binary (COMP or COMP-1 or COMP-2 or COMP-3 or COMP-4 or COMP-5) values? If so, getting rid of REDEFINES does not get rid of the issue -- period.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post