IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

NUMVAL Function: Convert Alphanumeric to COMP-3 value


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 691
Location: Earth

PostPosted: Thu May 03, 2007 6:17 pm
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

Moderator Emeritus


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

PostPosted: Thu May 03, 2007 9:05 pm
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
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

Moderator Emeritus


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

PostPosted: Mon May 07, 2007 7:22 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
Search our Forums:

Back to Top