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

Can I redefine a variable with different picture clause


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

New User


Joined: 16 Dec 2004
Posts: 44
Location: Hyderabad

PostPosted: Mon Feb 28, 2005 11:25 am
Reply with quote

1. Can I redefine a variable with different picture clause....see below

01 var1 pic x(10).
02 var2 pic 9(20) redefines var1.
move 'breddy' to var1.
display var1.
display var2.

what would be the results in the above code. is this possible?

2. For which item we cannot use redefines?
01
77
66
49
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Mon Feb 28, 2005 3:41 pm
Reply with quote

Hi BrahmanandaReddy,

You can redefine a variable with different picture clause. But we can't redefine with a larger value.

66 level name is used specially for renames clause and 49 level is used for Varchar type DB2 columns. Redefines can be used for 01 and 77 level items.

Hope this helps:-)
Back to top
View user's profile Send private message
brahmanandareddy

New User


Joined: 16 Dec 2004
Posts: 44
Location: Hyderabad

PostPosted: Tue Mar 01, 2005 12:53 pm
Reply with quote

Hi Anuradha,

Thanx for reply....but I think we can redefine a variable holding smaller value with a variable larger than that value

01 VAR1 pic x(10).
01 VAR2 pic 9(20) REDEFINES VAR1.

The above will workout without any problems. I read it in books and this has been asked in Kanbay test.

Thank You
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Mar 01, 2005 2:18 pm
Reply with quote

Hi BrahmanandaReddy,

Can you help me out by saying the book you read. Because redefining an element with a larger values is not allowed in our shop. When we tried doing so it gave me an error. But i heard people saying that it is allowed. Please give me the name of the book/Manual you read
Back to top
View user's profile Send private message
Rajshekhar V Patil

New User


Joined: 23 Feb 2005
Posts: 7
Location: Mumbai

PostPosted: Tue Mar 01, 2005 2:29 pm
Reply with quote

Hi,
Level 66 can not be Redefines.
The level 66 only used for Rename.
The level 49 u can make Redefine.

Rajshekhar V Patil
Back to top
View user's profile Send private message
mainframemouli

New User


Joined: 01 Mar 2005
Posts: 52
Location: Mysore

PostPosted: Tue Mar 01, 2005 5:34 pm
Reply with quote

Hi anuradha,
Its not mentioned in any book or so , but its a FAQ in mainframe interviews.

But that kind of redefinig is possible....
we are using Roscoe 6.0 its allowed in that....
Back to top
View user's profile Send private message
therasith

New User


Joined: 02 Jan 2004
Posts: 52
Location: chennai

PostPosted: Tue Mar 01, 2005 7:07 pm
Reply with quote

IT IS IMPOSSIBLE. IMPROPER DATA TYPE ASSUMED



01 TO 77 LEVEL EXCEPT 66
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Tue Mar 01, 2005 7:41 pm
Reply with quote

Hi,
You can redefine a small item with a larger item only when they are at 01 level.I have tried that many a times and it has worked fine for me.

And u can redefine at all levels except 66 level.
Thanks
sunny
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top