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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am


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