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
 

 

How move left justified space filled pic X to numeric

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

New User


Joined: 25 Nov 2010
Posts: 4
Location: Miami, FL

PostPosted: Fri Jan 07, 2011 10:25 pm    Post subject: How move left justified space filled pic X to numeric
Reply with quote

Does anyone have a clever way of taking a left justified, space filled PIC X field that contains a number and moving it to an actual numeric field. I can do it byte by byte (which I have done many times in the past) but is there an easier way? In other languages, such as JAVA, this is easy; but I don't know of an easy way to do this in COBOL.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jan 07, 2011 10:28 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

If you are absolutely positive the value will always be a left-justified numeric value, you might consider using NUMVAL to move the number to a numeric field.

If you are not familiar with NUMVAL, there is a link to "IBM Manuals" at the top of the page. What you are looking for will be in the COBOL Language Reference.
Back to top
View user's profile Send private message
Hank Watson

New User


Joined: 25 Nov 2010
Posts: 4
Location: Miami, FL

PostPosted: Mon Jan 10, 2011 3:06 am    Post subject: Reply to: How move left justified space filled pic X to nume
Reply with quote

This was my first attempt at posting to any of the forums. I must say - VERY IMPRESSED! Perfect anwser forcing me to read the book and learn something new. Not surprisingly, the function works as documented. Many thanks.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jan 10, 2011 3:11 am    Post subject: Reply to: How move left justified space filled pic X to nume
Reply with quote

Good to hear it is working - thanks for letting us know icon_smile.gif

Some of us "old guys" believe the main purpose of the forum is to help with learning . . .

d
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 Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am


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