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
 

 

How to move alphanumeric to numeric

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

New User


Joined: 12 Aug 2008
Posts: 11
Location: chennai

PostPosted: Fri May 29, 2009 3:57 pm    Post subject: How to move alphanumeric to numeric
Reply with quote

Hi ,

i have an requirement . I need to move alphanumreic to numeric
05 A PIC X(7)
05 B PIC 9(7).
.
.

MOVE A to B



The value of A is 1234567.The same value has to be displayed in b.
Also

IF the value of A is 12345

Then VALUE of B should be 0012345

Pls suggest.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Fri May 29, 2009 4:48 pm    Post subject:
Reply with quote

FUNCTION NUMVAL as long as you're running on a recent COBOL.
Back to top
View user's profile Send private message
aimprabhu

New User


Joined: 12 Aug 2008
Posts: 11
Location: chennai

PostPosted: Fri May 29, 2009 5:41 pm    Post subject: Reply to: How to move alphanumeric to numeric
Reply with quote

Hi ,

Thanks for the reply.We solved it by using SET function
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri May 29, 2009 5:47 pm    Post subject: Re: Reply to: How to move alphanumeric to numeric
Reply with quote

aimprabhu wrote:
Hi ,

Thanks for the reply.We solved it by using SET function


Please explain!
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri May 29, 2009 6:11 pm    Post subject: Reply to: How to move alphanumeric to numeric
Reply with quote

Yes, enquiring minds want to know? icon_confused.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 29, 2009 6:35 pm    Post subject:
Reply with quote

yes, you can start by explaining why you think SET is a function.

after that, show us the code that you used, please.

your solution is a breakthrough!
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat May 30, 2009 1:05 am    Post subject:
Reply with quote

I am really interested in the SET function and how you used it to solve this!
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1239
Location: Richfield, MN, USA

PostPosted: Sat May 30, 2009 9:12 am    Post subject:
Reply with quote

Code:
SET B TO CORRECT VALUE

No problem. icon_smile.gif
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
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
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


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