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

Is it possible to Redefines x(1) to x(2)


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

New User


Joined: 29 Jun 2005
Posts: 7

PostPosted: Wed Jun 29, 2005 4:19 am
Reply with quote

hello,

Can i redefine x(1) to x(2).is it possible?
01 a pic x.
01 b redefines a pic x(2). is it correct?
i read in some FAQS x(100) to x(200) is possible? please give any body correct anawer.

Regards
urnarendra
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Thu Jun 30, 2005 12:13 am
Reply with quote

Yes, It's possible according to ANSI - 85 standards only if both the variables declared in 01 Level.
Back to top
View user's profile Send private message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Sat Jul 02, 2005 6:30 pm
Reply with quote

Hi Narendra,

Redefines is mainly for utilizing memory space.

A PIC X
B REDIFINES A PIC XX.

MOVE 1 TO A.
DISPLAY B.

Now B will contain 1b. ( b for space).

Any corrections welcome.

Regards,
Sudhaaa.
Back to top
View user's profile Send private message
sats456

New User


Joined: 29 May 2005
Posts: 12

PostPosted: Sun Jul 03, 2005 4:59 pm
Reply with quote

I wud say best wud be to try writing a small prograam to test it out if your compiler supports it ...
Back to top
View user's profile Send private message
urnarendra

New User


Joined: 29 Jun 2005
Posts: 7

PostPosted: Wed Jul 06, 2005 4:01 am
Reply with quote

hello priya,

in ANSI 74 we can redefine one variable into any other variable with same length(we can not increase or decrease the size).but in ANSI 85 standard we can decrease the size but we can not increase(you can read boo).i am working in Z/OS .in that i am trying to increase the size its working perfectely.but in OS/390 (in real time) it can not work.in faq's they told increase is possible.but is not possible.i attend one interview in that interview i face this question but i told it possible that time the interviewer told me it is not possible.
corrections are welcome.............
thanks®ards,
k.narendra.
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 Cobol redefines for Signed pictured c... COBOL Programming 4
No new posts Another redefines in COBOL COBOL Programming 1
No new posts Redefines clause in symbolic map MPC ... CICS 1
No new posts Redefines usage COBOL Programming 15
No new posts Rename & Redefines COBOL Programming 5
Search our Forums:

Back to Top