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: 8118
Location: East Dubuque, Illinois, USA

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: 6968
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: 1249
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
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 DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm


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