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
 

 

Converting alphanumeric data to numeric with right justifica

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

New User


Joined: 19 May 2005
Posts: 12
Location: kolkata

PostPosted: Mon Jun 20, 2005 2:19 pm    Post subject: Converting alphanumeric data to numeric with right justifica
Reply with quote

Hi all,

Say we have a variable A which is X(3) and variable B which is 9(3).

If we have values like "1 " , "10 " etc in A with trailing spaces and we want them as 001 and 010 respectively in B which is right justification of the data with preceeding zeroes.

How can that be accomplished with COBOL? Can anyone give the code snippet for that?

Thanks & regards,
Mouli
Back to top
View user's profile Send private message

somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Mon Jun 20, 2005 10:15 pm    Post subject:
Reply with quote

Hi Mouli

Check the NUMVAL function.
Code:

COMPUTE WS-NUM-DIGITS = FUNCTION NUMVAL(WS-ALPHA)


For more details
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/7.1.32?DT=20020920180651

hth
-Som
Back to top
View user's profile Send private message
mouli

New User


Joined: 19 May 2005
Posts: 12
Location: kolkata

PostPosted: Tue Jun 21, 2005 3:22 pm    Post subject: Re: Converting alphanumeric data to numeric with right justi
Reply with quote

Hi somasundaran_k,

Thank u very much for ur solution. it's working very fine.


thanks & Regards
mouli
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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