Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Can I redefine a variable with different picture clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Can I redefine a variable with different picture clause
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Hi,
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    Post subject:
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    Post subject: NO IS IT IMPOSSIBLE
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    Post subject:
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    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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Easytrive Redefine vidyaa CA Products 4 Mon Jun 19, 2017 6:01 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us