For BTEQ don't use the column alias but the original name, i told you i didn't use it for years :-)
WITH sum ( INC_AMT ) , count (*)
And for GROUPING SETS you get rid of the NULLs using GROUPING and CASE (but then you can't use the ordinal position within GROUP BY, must use the column name instead) like
case when grouping(LOB) = 1 then 'TOTALS' else LOB end
For BTEQ don't use the column alias but the original name, i told you i didn't use it for years :-)
WITH sum ( INC_AMT ) , count (*)
And for GROUPING SETS you get rid of the NULLs using GROUPING and CASE (but then you can't use the ordinal position within GROUP BY, must use the column name instead) like
case when grouping(LOB) = 1 then 'TOTALS' else LOB end
Dieter