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
 

 

Can we move Alphanumeric data to Numeric Variable

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

New User


Joined: 18 Nov 2006
Posts: 4
Location: hyderabad

PostPosted: Wed Aug 01, 2007 11:43 am    Post subject: Can we move Alphanumeric data to Numeric Variable
Reply with quote

HI FRNDS,
i have 01 A PIC X(2).
01 B PIC 9(2).
MOVE 12 TO A.
MOVE A TO B.
I KNOW THAT I CAN PASS NUMERIC TO NON-NUMERIC BUT IN THIS CASE HOW CAN IT BE PASSED AS NUMERIC OR NON-NUMERIC..... I KNOW ITS BASIC ONE BUT I WANT UR HELP AS I WAS CONFUSED..... icon_rolleyes.gif

Warning: Caps Lock On
Back to top
View user's profile Send private message

murmohk1

Senior Member


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

PostPosted: Wed Aug 01, 2007 12:00 pm    Post subject: Re: CAN WE MOVE ALPHANUMERIC DATA INTO NUMERIC FIELD......
Reply with quote

Anil,

Please post your query in CAPS OFF mode.

Quote:
BUT IN THIS CASE HOW CAN IT BE PASSED AS NUMERIC OR NON-NUMERIC..... I KNOW ITS BASIC ONE BUT I WANT UR HELP AS I WAS CONFUSED.....

I dont know you are confused or not. But your post surely is confusing. Please post your exact requirment.

Quote:
MOVE 12 TO A.

Also let us know, is it atypoerr?
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Wed Aug 01, 2007 12:00 pm    Post subject:
Reply with quote

hi anil ,

Use the below code


Code:
COMPUTE B = FUNCTION NUMVAL(A)



Thanks
Sai
Back to top
View user's profile Send private message
chtrisa

New User


Joined: 19 Dec 2006
Posts: 12
Location: chennai

PostPosted: Wed Aug 01, 2007 5:23 pm    Post subject:
Reply with quote

hi anil,

i think, redefine the B(numeric) field, then u can move non mumeric value to B.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Wed Aug 01, 2007 5:37 pm    Post subject:
Reply with quote

Code:
Move '12' to A

This moves literal '12' to A and your move will move 12 to A. (Check the apostrophes.)
I think you are confused in diffrentiating numeric and alphanumeric literals.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Thu Aug 02, 2007 7:30 pm    Post subject:
Reply with quote

hi anil,

anil wrote:
Quote:

I KNOW THAT I CAN PASS NUMERIC TO NON-NUMERIC BUT IN THIS CASE HOW CAN IT BE PASSED AS NUMERIC OR NON-NUMERIC..... I KNOW ITS BASIC ONE BUT I WANT UR HELP AS I WAS CONFUSED.....


I think that you are talking about the second move whether numeric value will be moved to 'B' or alphanumeric.

you are moving '12 ' to alphanumeric first since it is in codes it will be treated as alphanumeric.

when you move A to B it will be moved fine and you can use B for any arithmetic operations as well.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 12:20 am    Post subject:
Reply with quote

Hello,

You might want to look at these similar topics:
http://ibmmainframes.com/viewtopic.php?t=22367
http://ibmmainframes.com/viewtopic.php?t=21201
http://ibmmainframes.com/viewtopic.php?t=18093

If you "search" using the link near the top of the page, you will find several more topics.

If after reading them you have any questions, please post what you read that is unclear and your question about it and we will provide more answers.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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