BTEQ Script Listing for EventCount Macro | SystemFE Macros | Teradata Vantage - 17.10 - EventCount - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SystemFE Macros

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Administration
Publication ID
B035-1103-171K
Language
English (United States)
REPLACE MACRO SystemFE.EventCount
 (Fromdate (date,               FORMAT 'YYYY-MM-DD'),
  Todate   (date, DEFAULT DATE, FORMAT 'YYYY-MM-DD')) AS
(
echo 'set defaults;';
echo 'set format on;';
echo 'set width 80;';
echo 'set NULL as "-";';
echo 'set separator 2;';
echo 'set omit on 1,2;';
echo 'set pagelength 60;';
echo 'set heading "&DATE||Total Of Each Event||&TIME//Between &1 and  &2";
';
Select    :Fromdate      (Format 'YYYY-MM-DD')
        , :Todate        (Format 'YYYY-MM-DD')
        , Event_Tag
        , Count(*)       (Title '   Total   //Occurrences')
From      DBC.Software_Event_Log
Where     TheDate between :fromdate and :todate
And       Line=1
And       ( Severity > 20
 Or  Event_Tag = '033-13855-00'
 Or  Event_Tag = '033-13892-00' )
Group By  Event_Tag
Order By  4 Desc;
echo 'set defaults;';
);