MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reg Sum() Aggregate in CuRsor.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
sendhil
Beginner


Joined: 06 Sep 2006
Posts: 17
Topics: 6

PostPosted: Wed Oct 11, 2006 8:07 am    Post subject: Reg Sum() Aggregate in CuRsor. Reply with quote

Hi,
I am using a Sum() aggregate in a cursor.But i am facing some precompilation errors.
Code:

SELECT COVERAGE_CD,             
       COVERAGE_SEQ_NBR,         
       UNIT_NBR,                 
       COVERAGE_LVL_CD,         
       SUM(PLP_TRS_PRM_AMT)     

While doing a fetch i am getting the sum aggregate in a variable which is
9(07)v9(02).

The PLP_TRS_PRM_AMT is DEC(9,2).
I am getting a precompilation error.
UNDEFINED OR UNUSABLE HOST VARIABLE

I tried changing the picture to 9(13)V9(02).But still got the same error.

I am not sure the Picture declaration for the aggregate.

Can you pls help me out?
Back to top
View user's profile Send private message Send e-mail
dz
Beginner


Joined: 02 Apr 2006
Posts: 26
Topics: 0

PostPosted: Wed Oct 11, 2006 8:16 am    Post subject: Reply with quote

Use a signed field, and either COMP-3 or COMP,
for example: PIC S9(13)V9(2) COMP-3.
Back to top
View user's profile Send private message
sendhil
Beginner


Joined: 06 Sep 2006
Posts: 17
Topics: 6

PostPosted: Wed Oct 11, 2006 8:29 am    Post subject: Reply with quote

THNX
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group