Mike:  I'm with Albert.  I never use indicator variables in aggregate math 
calcs because it will always return something, at least a 0.  It will never 
be null unless you did something like "SELECT MAX(textcolumn)" and the 
entire column was null.

Karen


In a message dated 6/8/2011 11:17:16 AM Central Daylight Time, 
[email protected] writes: 
> Do I understand correctly that it is not necessary/advisable to use an 
> INDICATOR variable with aggregate functions such as SUM, COUNT, etc.? 
> 
> The reason I'm asking is that in testing v9.1 - 64 some of my programs 
> that use this scenario stops R:BASE in its tracks. 
> 
> Here's an example where R:BASE gets to this command and then just drops 
> back to the R>. 
> 
> SELECT COUNT(*) INTO VCNT INDICATOR VIND FROM REJ_VIEW +
> WHERE DISPDATE = .VPREVIOUS AND IQL_SMRY = .VM AND IQL_FLAG = .VQ +
> AND SEQNUM NOT IN (SELECT RJCT_SEQNUM FROM REWIND_EXCL) +
> AND REJ_AREA = .VINT AND HOLDSTAT = .VI
> 
> Taking the INDICATOR out makes R:BASE happy again. 

Reply via email to