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
 
Numeric test for a Comp Variable

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

New User


Joined: 05 Nov 2007
Posts: 21
Location: hyd

PostPosted: Mon Jul 13, 2009 12:29 pm    Post subject: Numeric test for a Comp Variable
Reply with quote

Hi,

How can I perform Numeric test for Comp variable?

Problem:

I have a variable declared as Comp. I want to know whether the value in the field is numeric. When I tested it using "IS Numeric", I received the following error message during compilation

IGYPA3256-S "WS-VARIABLE1 (BINARY INTEGER)" did not have a valid type for the specified class condition. The statement was discarded.

Please help me in resolving thie error?
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1258
Location: Israel

PostPosted: Mon Jul 13, 2009 12:57 pm    Post subject:
Reply with quote

You can't.
In a comp field, all values - from low-values to high-values - are numeric.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jul 13, 2009 3:28 pm    Post subject:
Reply with quote

By definition, a computational item is a value used in arithmetic operations. It must be numeric. If a group item is described with a computational usage, the elementary items within the group have that usage -- so you can't escape (as Marso has said, you just can't.). It's programmers' responsibility to "move" correct data to fields with such definitions.

Suggest, you tell us what exactly you want to do. What you have posted may be just a way (you think) to achieve that; if you tell us what your final goal is, I believe, there can be alternate ways ...
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 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
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm

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