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

About Redefines


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Mon Jun 27, 2005 10:07 am
Reply with quote

Hi Folks,

01 WS-AA PIC X(10).
01 WS-REDEF-AA REDEFINES WS-AA.
05 WS-BB PIC 9(10).

is this possible.if we delare like this what will happend.
Back to top
View user's profile Send private message
harinadh

New User


Joined: 01 Sep 2004
Posts: 18

PostPosted: Mon Jun 27, 2005 10:24 am
Reply with quote

Hi,

You wont get any error. We can declare like that.
Back to top
View user's profile Send private message
Puneet

New User


Joined: 27 Jun 2005
Posts: 9
Location: Chennai

PostPosted: Mon Jun 27, 2005 11:13 am
Reply with quote

HI ,

It won't thow any error if we are moving only numeric fields.
but it can give abnormal termination when Alpha-numeric data is moved :
MOVE 'ABCDE' to WS-AA

As WS-AA and WS-BB are sharing the same memory will it cause abend at this step?

Thanks,
Puneet
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Mon Jun 27, 2005 5:20 pm
Reply with quote

Hi Puneet,

The move statement you mentioned above :

MOVE 'ABCDE' TO WS-AA will never terminate the execution abnormally.
But the arithmetic operations like :

ADD 1 TO WS-AA
will certainly cause an abnormal termination.

regards,
David.
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Mon Jun 27, 2005 5:24 pm
Reply with quote

Hi,

I am sorry for the above post what I wanted to say is

ADD 1 TO WS-BB
will cause an abend.
ADD 1 TO WS-AA will throw a compilation error.

regards,
David.
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 Cobol redefines for Signed pictured c... COBOL Programming 4
No new posts Another redefines in COBOL COBOL Programming 1
No new posts Redefines clause in symbolic map MPC ... CICS 1
No new posts Redefines usage COBOL Programming 15
No new posts Rename & Redefines COBOL Programming 5
Search our Forums:

Back to Top