Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Question about redefines.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Question about redefines.
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    Post subject:
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: 785
Location: Chennai, India

PostPosted: Tue Apr 01, 2008 2:13 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Apr 01, 2008 7:54 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts SQL Order By related question Joseph K Thomas DB2 8 Fri Mar 18, 2016 12:53 pm
No new posts DFSort Question krrp DFSORT/ICETOOL 9 Mon Mar 07, 2016 7:11 pm
No new posts Question: REORG on LOB tablespaces rakesh1155 DB2 1 Fri Aug 14, 2015 2:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us