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

signed counter declaration


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

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Wed Oct 27, 2010 6:43 pm
Reply with quote

Generally , compatible COBOL host variable structure to receive the result of a SELECT COUNT(*) is integer type PIC S9(9) USAGE COMP
and agreed it also varies system to system but with signed declaration.

My question is why do we require sign here if we know that count is not going to be negative. For perform varying by -ve's(-1,-2) counters are declared as signed int. Is there any performance efficient related matters for signed delcarations?

Thanks in advance.
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Tue Nov 09, 2010 1:06 pm
Reply with quote

It is simple fact that DB2 make use of INTEGER data-type for counting rows and that is reason why we have to make use of S9(9) COMP. Had it been the case that DB2 has used unsigned INTEGER for counting then we would have used 9(9) COMP.

Now why DB2 uses INTEGER (signed) datatype for counting rows that I dont know for sure, becuase I am not DB2 system programmer. I think it is more linked to the CPU instruction compatibility!!
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 Two input files & writing counter... DFSORT/ICETOOL 12
No new posts Sort counter to show records combination JCL & VSAM 2
No new posts Numeric check on packed signed and un... COBOL Programming 4
No new posts Add a step counter in a stack ? CLIST & REXX 23
Search our Forums:

Back to Top