Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us