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

help on comp-3 variable having non-numeric


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sribks2005

New User


Joined: 04 Apr 2005
Posts: 20
Location: Mysore

PostPosted: Fri Apr 22, 2005 12:37 pm
Reply with quote

hi,

Variable Declaration.
===============
01 ABC pic S9(9) comp-3.

Value
====
This variable is having value 123455633F.

But Comp-3 value can have either "C" or "D" as its last character to consider it has numeric.

Can anybody tell me why Comp-3 value gets 123455633F type of value?? icon_question.gif

This variable is satisfying non-numeric test.

waiting for your replies

Thanks
Back to top
View user's profile Send private message
sribks2005

New User


Joined: 04 Apr 2005
Posts: 20
Location: Mysore

PostPosted: Fri Apr 22, 2005 12:41 pm
Reply with quote

hi all,

Please ignore the value i have given for that variable.

Correct value which it has got is 123455633F.

I was trying to make "F" bold, and it has come like that.

sorry for inconvenience

i want to know why it has got "F" in its last position instead of "C" or "D".

thank you
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Fri Apr 22, 2005 9:22 pm
Reply with quote

Quote:
was trying to make "F" bold, and it has come like that.


That's because, you have disabled BBCODE while posting the query.

Quote:
want to know why it has got "F" in its last position instead of "C" or "D".


This is because your data is UNSIGNED Positive at COMP-3 storage format. So system will insert 1111.
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Fri Apr 22, 2005 9:50 pm
Reply with quote

Hi sribks2005
The possible values for a sign fileds are A,B,C,D,E and F.

B and D - Negative

A,C,E and F - Positive.

hth
-Som
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Sat Apr 23, 2005 8:07 am
Reply with quote

Quote:
The possible values for a sign fileds are A,B,C,D,E and F.

For Packed Decimal (COMP-3) ????
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Sat Apr 23, 2005 9:16 pm
Reply with quote

Yes Mcmillan.
I have mentioned that the possible values for the sign field.
As you know Comp-3 fields are in BCD format. For more information check the Principles of Operation manual here

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DZ9AR007/A.1.2?DT=20010725142528

Regds
-Som
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Apr 24, 2005 3:23 am
Reply with quote

You're right SOM. These sign codes have been around for many a year and are recognized for compatibility reasons. But are not generated by today's compilers/assemblers.
Back to top
View user's profile Send private message
sribks2005

New User


Joined: 04 Apr 2005
Posts: 20
Location: Mysore

PostPosted: Mon Apr 25, 2005 9:53 am
Reply with quote

hi all,

thank you very much for your inputs.

One more question,
why comp-3 value having F as its last char is failing numeric test??


waiting for your replies...
thank you
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Apr 26, 2005 4:56 am
Reply with quote

Show us the field def and the instuction. Also the error msg.

Preferably use cut and paste to be sure the info is accurate and represents what you are seeing.

Thanx
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
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
Search our Forums:

Back to Top