IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Question about redefines.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Tue Apr 01, 2008 1:47 pm
Reply with quote

COPYBOOK

05 NEW-POL-NBR PIC X(20).
05 NEW-IN-PIM-NBR-GP REDEFINES
NEW-POL-NBR.
10 NEW-BRANCH-NBR PIC XXX.
10 NEW-DATE-NBR PIC S9(9) COMP-3.
10 FILLER PIC X(12).
-----------------------------------------------------------------------

I am facing a strange problem.


IF CONDITION
MOVE NEW-POL-NBR TO REWRITE-POL-NBR
END-IF


Sometimes whts happening is when the above move statement is executed ,Low values is getting moved to REWRITE-POL-NBR.The reason might be the fact that the NEW-POL-NBR is redefined.i am not understanding on what scnerios its moving the data present in NEW-IN-PIM-NBR-GP to REWRITE-POL-NBR.I cannot even remove NEW-IN-PIM-NBR-GP from there as its a global copybook and its used in a lot of other programs as well.

Is there any way to eliminate this problem?


Thanks for ur help in advance
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Apr 01, 2008 2:12 pm
Reply with quote

Quote:

Sometimes whts happening is when the above move statement is executed ,Low values is getting moved to REWRITE-POL-NBR.The reason might be the fact that the NEW-POL-NBR is redefined.i am not understanding on what scnerios its moving the data present in NEW-IN-PIM-NBR-GP to REWRITE-POL-NBR.


low-values are being moved because that is the data contained in NEW-POL-NBR / NEW-IN-PIM-NBR-GP.

NEW-IN-PIM-NBR-GP and NEW-POL-NBR define the same area in memory.

your problem with the move has nothing to do with the redefine.

you are simply not populating the source (new-pol-nbr)
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Tue Apr 01, 2008 2:13 pm
Reply with quote

Quote:
i am not understanding on what scnerios its moving the data present in NEW-IN-PIM-NBR-GP to REWRITE-POL-NBR.

It's your logic and you have look into it.
Please see these NEW-POL-NBR, NEW-IN-PIM-NBR-GP , where they are initialized and got values.
Quote:
IF CONDITION

What does this condition say?
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Tue Apr 01, 2008 2:53 pm
Reply with quote

Just check whether the REWRITE-POL-NBR is getting populated with values or not. I think that the condition that you are checking against the IF is not satisfying and hence the data is not moved to the desired field.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 01, 2008 7:54 pm
Reply with quote

Hello,

What should be in REWRITE-POL-NBR when the condition is not true?

If you do not specifically put some value in REWRITE-POL-NBR, the content is unpredictable.
Back to top
View user's profile Send private message
SHAILESH OZA

New User


Joined: 10 Jun 2005
Posts: 21
Location: Mumbai

PostPosted: Sat Apr 05, 2008 3:54 pm
Reply with quote

Hi ,

Check whether any of the group is intialized i.e NEW-POL-NBR/NEW-IN-PIM-NBR-GP are intialized before the execution of the your if Condition.


Since in redifne clause both the groups are using the same memory location, if any of group item is intialized then as per intialize rules, numberic data is replaced by zeros and alphanumric by spaces.
Back to top
View user's profile Send private message
gvsus

New User


Joined: 27 Mar 2008
Posts: 4
Location: USA

PostPosted: Sat Apr 05, 2008 6:08 pm
Reply with quote

SHAILESH OZA wrote:
Hi ,

Check whether any of the group is intialized i.e NEW-POL-NBR/NEW-IN-PIM-NBR-GP are intialized before the execution of the your if Condition.


Since in redifne clause both the groups are using the same memory location, if any of group item is intialized then as per intialize rules, numberic data is replaced by zeros and alphanumric by spaces.


Why would you initialize your source data field? Then there is no purpose moving it to the target field.

Now to the actual problem ...

1) As some one said above, it might be happening when there the IF condition is not met. you might want to move spaces to REWRITE-POL-NBR in the ELSE part of the IF.
2) The Source itself NEW-POL-NBR has low-values in it. Note: NEW-POL-NBR and NEW-IN-PIM-NBR-GP will always have the same value, they are pointing to the same storage in memory.

Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts panel creation question TSO/ISPF 12
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
Search our Forums:

Back to Top