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

Doubt in Redefines


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Doubt about pl/1 (job offer) General Talk & Fun Stuff 5
No new posts Cobol redefines for Signed pictured c... COBOL Programming 4
No new posts doubt when executing a file when logg... TSO/ISPF 2
No new posts Doubt in MFS IMS DB/DC 2
No new posts Doubt on GETMAIN, FREEMAIN behaviour CICS 3
Search our Forums:

Back to Top