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
 
Redefines alphanumeric to Numeric displays characters

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
stly
Warnings : 1

New User


Joined: 25 Jul 2005
Posts: 93

PostPosted: Mon Nov 05, 2007 10:18 am    Post subject: Redefines alphanumeric to Numeric displays characters
Reply with quote

Hi,

This may be a simple Doubt,but i am not sure of the internal process thats why raisng in the forum after performing proper search in the forum.

05 WS-A PIC X(05) VALUE 'ABCDE'.
05 WS-C REDEFINES WS-A PIC 9(05).

If i display WS-A and WS-C both are displaying the 'ABCDE'.How its happening.

If WS-C is declared as 9(03) the its displaying 'ABC'.

Can any one throw some lite on this
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Nov 05, 2007 10:53 am    Post subject:
Reply with quote

Stly,

May be this link will helpyou-

http://www.ibmmainframes.com/viewtopic.php?t=24349&highlight=abcde
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Mon Nov 05, 2007 2:23 pm    Post subject: About REDEFINE Clause
Reply with quote

Hi stly,

According into my knowledge, The REDEFINE Cluase is used for to REFER a same memory location in main memory with another DATA ITEM(It can have same data type or diffrent data type)

lets consider example

Code:
01 WS-A                PIC X(10) VALUE "1234567890".
01 WS-B                REDEFINES WS-A.
--- 10 WS-NUM1     PIC X(05).
--- 10 WS-NUM2     PIC 9(05).

In the above example, The variable WS-NUM1 and WS-NUM2 is referring a memory location of WS-A

ie;

Code:
12345  by WS-NUM1
67890  by WS-NUM2


So it simply pick out the contents from WS-A will showed to you but actual DATA TYPE for contents(1234567890) is ALPHANUMURIC.

Regards,
Raghavendra
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 a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm

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