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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm


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