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

Redefines in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mr.Niceguy

New User


Joined: 16 Jun 2005
Posts: 63

PostPosted: Mon Mar 27, 2006 1:29 pm
Reply with quote

Hi all,

Can anybody plz explain how the system storing the values of redefines variable?

Thanking You,
Back to top
View user's profile Send private message
shivani_tech
Warnings : 2

New User


Joined: 08 Jan 2006
Posts: 22
Location: UNITED KINGDOM

PostPosted: Mon Mar 27, 2006 7:13 pm
Reply with quote

actually redefine itself means that same storage allocation as that of the predefined variable.so in the system there is no certain systematic system to storing the values of redefines variable
i hope i made u clear.any more query is welcome..
Back to top
View user's profile Send private message
Vinodc

New User


Joined: 01 Dec 2005
Posts: 33
Location: Prague

PostPosted: Mon Mar 27, 2006 8:48 pm
Reply with quote

Hi,

Redefines means giving another name to same storage location. Conceptually similar to system where I am called Mr. Chawda in office and Vinoo by friends.

Cheers!!
Back to top
View user's profile Send private message
Mr.Niceguy

New User


Joined: 16 Jun 2005
Posts: 63

PostPosted: Tue Mar 28, 2006 11:25 am
Reply with quote

Hi,

Well, I'm clear about that!! But Will it overwrite on the same storage area inorder to store the space or Will it use seperate storage area to keep the variable value? I'm bit confused about how it keeps the data in system.

Thanks in advance.
Back to top
View user's profile Send private message
vikasc4

New User


Joined: 11 Dec 2005
Posts: 32

PostPosted: Tue Mar 28, 2006 12:44 pm
Reply with quote

Hi Niceguy,

There is no overwrite as such, both the field will contain the same thing in them at a time. For example if A and B are two variable and if B REDEFINE A is given . And if there is a statement in program like.....

MOVE 'VIKAS' TO A.
then both A and B will contain VIKAS only.

Thus now moving Something else in any of A and B will change the contain of that memory Area from VIKAS to some new thing, depending on what is Moved in these fields.


regards
Vikas
Back to top
View user's profile Send private message
Mr.Niceguy

New User


Joined: 16 Jun 2005
Posts: 63

PostPosted: Tue Mar 28, 2006 3:44 pm
Reply with quote

Hi,

Thanks for ur reply. icon_rolleyes.gif .

Thank u
Back to top
View user's profile Send private message
Mr.Niceguy

New User


Joined: 16 Jun 2005
Posts: 63

PostPosted: Tue Mar 28, 2006 3:46 pm
Reply with quote

Hi,

Thanks for ur reply. icon_rolleyes.gif .

Thank u
Back to top
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 97
Location: India

PostPosted: Fri Mar 31, 2006 2:30 am
Reply with quote

Hi Vikas
I have a doubt about your example...
If B is defined as some other data type (eg numeric type),
Now you are moving "vikas" to A then wat the value can B be stored ? icon_question.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Apr 02, 2006 12:08 am
Reply with quote

Hi Rajesh,

A and B will still contain "VIKAS", but you now have a program abend (actually an 0C7 pgm interrupt) waiting to happen when an arith op is attempted using B.
Back to top
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 97
Location: India

PostPosted: Sun Apr 09, 2006 2:23 pm
Reply with quote

Hi MMwife

Thanks for your reply. icon_smile.gif
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top