Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8281
Location: Dubuque, Iowa, 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: 2504
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: 6970
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 Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts RMM Cannot move a volume from SHELF l... tspr52 IBM Tools 0 Thu Mar 01, 2018 3:48 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us