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

Redefines alphanumeric to Numeric displays characters


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

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

Stly,

May be this link will helpyou-

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
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 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 Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Monitoring production job progress. N... JCL & VSAM 4
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top