BTEQ Script Listing for AllRestarts Macro | SystemFE Macros | Teradata Vantage - 17.00 - 17.05 - AllRestarts - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SystemFE Macros

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
June 2020
Content Type
Administration
Publication ID
B035-1103-170K
Language
English (United States)
REPLACE MACRO SystemFE.AllRestarts
	(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 pagelength 60;';
echo 'set suppress on 3,4;';
echo 'set omit on 1,2;';
echo 'set heading "&DATE||(Crashable Events)||&TIME//Between &1 and      &2";';
Select    :Fromdate      (Format 'YYYY-MM-DD')
        , :Todate        (Format 'YYYY-MM-DD')
        , TheDate        (Title  'Date')
        , TheTime        (Title  'Time')
        , Text
From      DBC.Software_Event_Log
Where     TheDate between :fromdate and :todate
And       (Event_Tag = 0331385500 OR
           Event_Tag = 0331389200 )
Order By  TheDate, TheTime, Line;
 
echo 'set omit off;';
echo 'set heading "Total Restarts";';
Select    Count(*)            (Title 'Restarts')
From      DBC.Software_Event_Log
Where     TheDate between :fromdate and :todate
And       Line = 1
And       (Event_Tag = 0331385500 OR
           Event_Tag = 0331389200);
 
echo 'set defaults;';
);