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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Coverting PD to FS and also left just... Atul Banke DFSORT/ICETOOL 6 Wed Aug 24, 2016 4:31 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm


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