Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

signed counter declaration

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

Active User


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

PostPosted: Wed Oct 27, 2010 6:43 pm    Post subject: signed counter declaration
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    Post subject:
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    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 SIGNED DECIMAL TO COMP-3 using cobol ... ram_vizag COBOL Programming 1 Tue Mar 01, 2016 11:32 pm
No new posts Declaration of varchar in cobol s.saranya srinivasan COBOL Programming 6 Fri Sep 25, 2015 11:43 am
No new posts COBOL File Declaration for RECFM=VBS ... thinkmsk COBOL Programming 4 Fri Apr 03, 2015 3:31 pm
No new posts How to convert unsigned numeric to si... mftechie123 SYNCSORT 7 Thu Jan 29, 2015 4:54 pm
No new posts Issue in Comparing 2 Signed Comp Vari... elango Paulraj COBOL Programming 4 Thu Jan 08, 2015 1:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us