IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to move alphanumeric to numeric


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 29, 2009 4:48 pm
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
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri May 29, 2009 6:11 pm
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
Search our Forums:

Back to Top