I personally am moving away from using indicator variables at all. I turn off the error message instead If I really need to know if a variable is null, I test it. Testing the indicator variable is an unnecessary step. I would dearly like to know when this could trip me up. I haven't tested an indicator variable in all my 25+ years with RBASE
Dennis McGrath Software Developer QMI Security Solutions 1661 Glenlake Ave Itasca IL 60143 630-980-8461 [email protected] ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Wednesday, June 08, 2011 1:01 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: INDICATOR var with aggregate functions 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.

