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
 

 

Redefines in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Redefines in COBOL
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    Post subject:
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    Post subject: Vinoo Redefines VinodC
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    Post subject: Re: Redefines in COBOL
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    Post subject:
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    Post subject: Thank You
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    Post subject: Thank You
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: 95
Location: India

PostPosted: Fri Mar 31, 2006 2:30 am    Post subject: Redefines in COBOL
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    Post subject:
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: 95
Location: India

PostPosted: Sun Apr 09, 2006 2:23 pm    Post subject: Re: Redefines in COBOL
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    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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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