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

Numeric test for a Comp Variable


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

PostPosted: Mon Jul 13, 2009 12:57 pm
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

Superior Member


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

PostPosted: Mon Jul 13, 2009 3:28 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top