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

Redefines from AlphaNumeric to Numeric


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 12:59 pm
Reply with quote

see the following code

01 WS-VAR1 PIC X(10).
01 WS-VAR2 PIC 9(20) REDEFINES WS-VAR1.
.
.
MOVE 'BREDDY' TO WS-VAR1.
DISPLAY WS-VAR1.
DISPLAY WS-VAR2.
.
.
What would be the results in the above case?
Is it possible to redefine variables with different pic clauses as above (does it give error)?


01
77
49
66
of the above items for which redefines cannot be used?
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:43 pm
Reply with quote

Hi BrahmanandaReddy,

Hope you asked this question already.Please take care not to post same queries more than once.
Back to top
View user's profile Send private message
muthukumarapandian

New User


Joined: 08 Oct 2004
Posts: 42
Location: chennai, india

PostPosted: Tue Mar 01, 2005 9:28 am
Reply with quote

hI REDDY,

no it wont throw any error.
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:55 pm
Reply with quote

Hi,
The result would be:

For WS-VAR1 : BREDDY$$$$ where $ means spaces.
For WS-VAR2 : 00000000000000BREDDY.

Only for level 66 redefines can`t be used.

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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Handling the numeric data in unstring... COBOL Programming 18
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top