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
 

 

Doubt in Redefines

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
s.thinakaran

New User


Joined: 14 Dec 2005
Posts: 6

PostPosted: Mon Jan 09, 2006 3:51 pm    Post subject: Doubt in Redefines
Reply with quote

Hi All,

PSB for a part of an Online program code, here TIF906-ARG3R REDEFINES TIF906-ARG3 and again TIF906-ARG3R is coded in 01 level inside a copy book and code is working fine , i have a doubt here how a same data name is declared for 2 times in 01 level .

01 TIF906-ARG3.
05 FILLER PIC X(2100).
01 TIF906-ARG3R REDEFINES TIF906-ARG3
01 TIF906-ARG3R .
02 FILLER PIC X.
02 IXIN11MR PIC X.
02 IXIN11MC COMP PIC S9(4).
02 SHITEIL COMP PIC S9(4).
02 SHITEII PIC X(1).

Rgs,
Siva
Back to top
View user's profile Send private message

umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Mon Jan 09, 2006 4:27 pm    Post subject:
Reply with quote

You must be getting error in compilation with RC=8.

In such cases if you are not referring the group element TIF906-ARG3R you will not get any error as compiler is able to resolve the memory that you are trying to access. In your case the first occurrence of TIF906-ARG3R doesn?t has any sub-elements and only the second occurrence of TIF906-ARG3R has sub-elements. This makes life of compiler easier. Let say you have used IXIN11MR, than compiler can decide that you are referring to the second occurrence of TIF906-ARG3R.

Compiler gives error only when it is not able to resolve the variable you are referring.

Correction welcome.
Back to top
View user's profile Send private message
shivakr

New User


Joined: 09 Jan 2006
Posts: 8

PostPosted: Mon Jan 09, 2006 4:53 pm    Post subject: Doubt in Redefines
Reply with quote

Hi Umesh,

But when refer 01 TIF906-ARG3 will it have values declred under second occurance of TIF906-ARG3R.

Siva
Back to top
View user's profile Send private message
umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Mon Jan 09, 2006 5:05 pm    Post subject:
Reply with quote

See as their are no values 9elements) under the first occurence of TIF906-ARG3, compiler can resolve variable.
Even if values are defined under first occurence of TIF906-ARG3 and with different name (not same as second occurence) compiler will not give any error.

Basic point is compiler must be able to resolve the variable referred.
Back to top
View user's profile Send private message
shivakr

New User


Joined: 09 Jan 2006
Posts: 8

PostPosted: Mon Jan 09, 2006 5:47 pm    Post subject:
Reply with quote

Hi Umesh,

Thanx for the answers.

Siva
Back to top
View user's profile Send private message
malla

New User


Joined: 16 Nov 2005
Posts: 15

PostPosted: Thu Jan 12, 2006 9:41 am    Post subject: Re: Doubt in Redefines
Reply with quote

What r the major differences between REDEFINES AND RENAMES ?
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 Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts Doubt on GETMAIN, FREEMAIN behaviour Arunkumar Chandrasekaran CICS 3 Sun Aug 30, 2015 9:22 pm
No new posts Another redefines in COBOL RahulG31 COBOL Programming 1 Fri Mar 20, 2015 4:09 am
No new posts Doubt in using command code O Appu IMS DB/DC 4 Tue Jan 13, 2015 3:14 pm
No new posts Doubt in using command code D and N t... Appu IMS DB/DC 7 Mon Dec 29, 2014 5:52 pm


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