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
 

 

NUMVAL Function: Convert Alphanumeric to COMP-3 value

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

New User


Joined: 23 Apr 2005
Posts: 39
Location: delhi

PostPosted: Thu May 03, 2007 3:08 pm    Post subject: NUMVAL Function: Convert Alphanumeric to COMP-3 value
Reply with quote

Our compiler is not supporting NUMVAL function. Is there any way, to convert Alphanumeric to COMP-3 value?
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu May 03, 2007 6:17 pm    Post subject:
Reply with quote

Do you know what non numeric charactars may be present in the alpha variable?
If only spaces and numbers are there then, using inspect replace spaces by zeros and move that to numeric variable. If it is more complex situation then we need to here more from you. icon_smile.gif
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: Thu May 03, 2007 9:05 pm    Post subject:
Reply with quote

Hello,

Please post the source statement(s) and compiler output that shows the error(s). Also please post the info in the compiled output that shows which compiler you are using.

Then, please post some sample data and what you want done with it. The data needs to show the different "patterns" your input might contain.
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Mon May 07, 2007 10:49 am    Post subject:
Reply with quote

Hello,

Maybe you can try the following:

IF ALPHA-NUMERIC-VAR IS NUMERIC
MOVE ALPHA-NUMERIC-VAR TO COMP3-VAR
END-IF

If this does not work try...

IF ALPHA-NUMERIC-VAR IS NUMERIC
MOVE ALPHA-NUMERIC-VAR TO NUMERIC-VAR
MOVE NUMERIC-VAR TO COMP3-VAR
END-IF
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 May 07, 2007 7:22 pm    Post subject:
Reply with quote

Hello,

As requested last week,
Quote:
Please post the source statement(s) and compiler output that shows the error(s). Also please post the info in the compiled output that shows which compiler you are using.

Then, please post some sample data and what you want done with it. The data needs to show the different "patterns" your input might contain.


Please keep in mind that many of us have written code to check for numeric long before there was a NUMVAL function available.

When you post your specifics, we can offer better suggestions.
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 Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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