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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm


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