Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Redefines from AlphaNumeric to Numeric

 
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 12:59 pm    Post subject: Redefines from AlphaNumeric to Numeric
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us