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 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 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
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 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


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