spots 10.0 report processing language

56
E200301-01-314-V10.0I-01 SIEMENS S.A. SPOTS V10 Drop 4 Report Processing Language April/2003

Upload: urshadow

Post on 17-Jun-2015

97 views

Category:

Education


2 download

DESCRIPTION

Spots 10.0 Report Processing Language

TRANSCRIPT

Page 1: Spots 10.0 Report Processing Language

E200301-01-314-V10.0I-01

SIEMENS S.A.

SPOTS V10 Drop 4

Report Processing Language

April/2003

Page 2: Spots 10.0 Report Processing Language

SIEMENS S.A.OG IC, R&D WON NM CP2

R. Irmãos Siemens, nº 12720-093 AmadoraPortugal

All rights reserved. No part of this document may be reproduced or transmittedin any form or by any means, electronic or mechanical, including photocopyingand recording, for any purpose other than the purchaser’s personal use withoutthe written permission of Siemens S.A.This document consists of a total of 56 pages.The information contained in this document is subject to change.

Page 3: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

i E200301-01-314-V10.0I-01

Table of Contents

1 Preface........................................................................................................................................ 32 Getting Started............................................................................................................................ 4

2.1 What is the SPOTS Reporting Language?........................................................................................42.2 Why Using SRL? ...............................................................................................................................4

3 Learning the Basics .................................................................................................................... 53.1 SRL Concepts ...................................................................................................................................53.2 SRL Structure ....................................................................................................................................8

3.2.1 Input Variables..........................................................................................................................93.2.2 Request Section........................................................................................................................9

3.2.2.1 Objects ...........................................................................................................................103.2.2.2 Counters.........................................................................................................................113.2.2.3 Time ...............................................................................................................................113.2.2.4 Granularity......................................................................................................................123.2.2.5 Data Type.......................................................................................................................12

3.2.3 Result Section.........................................................................................................................123.2.4 Processing Section (Method & Report Sections)....................................................................13

3.2.4.1 Types..............................................................................................................................133.2.4.2 Variables’ Definition .......................................................................................................153.2.4.3 Parameters and Arguments ...........................................................................................153.2.4.4 Sentences ......................................................................................................................163.2.4.5 Scopes ...........................................................................................................................16

3.3 Pre-defined Methods .......................................................................................................................173.3.1 Associated with Rows .............................................................................................................173.3.2 Associated with Columns ........................................................................................................183.3.3 Associated with Sheets...........................................................................................................193.3.4 Associated with Cubes............................................................................................................203.3.5 Associated with Result Cubes ................................................................................................213.3.6 Associated with Result Columns.............................................................................................213.3.7 Library traffic_lib......................................................................................................................223.3.8 Library math_lib ......................................................................................................................223.3.9 Library misc_lib .......................................................................................................................233.3.10 Library time_lib......................................................................................................................233.3.11 Library string_lib....................................................................................................................24

3.4 Developing Reports with SRL..........................................................................................................263.4.1 Report Sample ........................................................................................................................26

3.4.1.1 Request Section.............................................................................................................273.4.1.2 Result Section ................................................................................................................273.4.1.3 Method Section ..............................................................................................................273.4.1.4 Report Section ...............................................................................................................28

3.5 Creating a Report ............................................................................................................................294 Language Reference ................................................................................................................ 31

4.1 SRL Syntax......................................................................................................................................314.1.1 Lexical Specification ...............................................................................................................31

4.2 Reserved Words..............................................................................................................................335 Annexes .................................................................................................................................... 34

5.1 Grammar .........................................................................................................................................345.2 Report Samples...............................................................................................................................41

5.2.1 Time Evolution Report ............................................................................................................415.2.2 Daily Totals Report .................................................................................................................435.2.3 SPBH Daily Peak Report ........................................................................................................445.2.4 SPBH Max Peak Report..........................................................................................................465.2.5 Top n Report ...........................................................................................................................485.2.6 Day Periods Time Evolution Report ........................................................................................51

6 References................................................................................................................................ 537 Glossary & Abbreviations.......................................................................................................... 54

Page 4: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

ii E200301-01-314-V10.0I-01

List of Figures

Figure 1 – Data Cube (counters, objects and time) ....................................................................... 5Figure 2 – Different data element Relationship. ............................................................................ 6Figure 3 – Requests to database and processing results.............................................................. 6Figure 4 – Graphical representation of a request. ....................................................................... 10Figure 5 – Process of creation of a new report............................................................................ 29

List of Tables

Table 1 – SRL supported types ................................................................................................... 13Table 2 – Operations between SRL supported types .................................................................. 15Table 3 – SRL Reserved words ................................................................................................... 33

Page 5: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

3 E200301-01-314-V10.0I-01

1 Preface

The manual is subdivided in three parts:

Getting Started provides a brief introduction to SPOTS Reporting Language (SRL).

Learning the Basics explains the concepts behind SRL and provides an overview of thestructure of an SRL program.

Language Reference presents the syntax, a detailed specification of lexical informationand the SRL predefined libraries.

In addition to the parts above, annexes are included, providing the SRL Grammar and examplesof reports.

Page 6: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

4 E200301-01-314-V10.0I-01

2 Getting Started

2.1 What is the SPOTS Reporting Language?

Any programming language serves two related proposes: it provides a vehicle for the progra-mmer to specify actions to be executed, and it provides a set of concepts for the programmer touse when thinking about what can be done.

The SRL is used within the SPOTS product to produce performance and traffic statistics. Itallows defining the input raw data, already stored on the SPOTS database, and the processingalgorithms necessary to produce the required statistical indicators.

Currently SRL is only concerned with algorithms and statistical data values and not on how thisdata is to be presented to the user.

2.2 Why Using SRL?

The SRL provides great flexibility to adapt existing reports and create new ones, tailored to yourspecific needs.

Page 7: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

5 E200301-01-314-V10.0I-01

3 Learning the Basics

3.1 SRL Concepts

The raw data obtained from the database is represented as a data Cube, like a group of spread-sheets:

Figure 1 – Data Cube (counters, objects and time)

The dimensions of this raw data Cube are always the same:• Measurement counters (as X axis), ordered as specified by the user.• Time (as Y axis), where the begin of the time period are the values closer to upper side

of the Cube.• Objects (as Z axis), ordered as specified by the user.

This raw data Cube contains the following elements:• Cell: the basic element of the Cube, with an associated value: a time stamp, a counter

and an object.• Sheet: set of data Cells related to some counters of a particular object in a time period.• Row: each row of the object Sheet means a time sample of one or more counters.• Column: each column of the object Sheet means a counter in a time period.

time samples row

counter columns

objects’ sheets

data cell

Page 8: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

6 E200301-01-314-V10.0I-01

The next figure describes the relationship between the different data elements.

Figure 2 – Different data element Relationship.

Each subset of data “inherits” information about objects, counters and time of the superset, i.e. aSheet can be created from a Cube, but a Column can be either created from a Cube or a Sheet.However, the Cube can be only created by a database request.

Each request to the database creates a different Cube. The data is processed and generates anoutput with information about the associated object/counter/time, grouped in other Cubes,Sheets or Columns. The next figure illustrates the main idea:

Figure 3 – Requests to database and processing results

An incoming data Cube is made of raw data retrieved from the database, and it is read-only (thedata cannot be modified). It is a group of Sheets (objects) with the same size (counters x time).Each Cube is always associated with only one Object Class. The raw data Cube is completelyfilled with values; if there are no values, it is filled with NO_DATA values.

Cube Sheet

Row Sample

Column

Cell

REPORTPROCESSING

Request 1

Request n

(…)

ResultSheet

ResultCube

ResultColumn

Page 9: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

7 E200301-01-314-V10.0I-01

Result data can either be a Result Cube, a Result Sheet or a Result Column, and is based onprocessed or raw data. It can be seen also as a book of Sheets, but these Sheets can havedifferent dimensions:

• Single value, with one data stamp.• Many values, many counters in a period of time.

Anyway the concept of time, counters and objects is maintained.

This language is oriented to manage these Cube elements: the Cube itself, Sheets, Columns,Rows or Cells) and to process them to obtain new elements. That is the processing kernel,where we can use the language to create new algorithms of processing over these data Cubes.

Page 10: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

8 E200301-01-314-V10.0I-01

3.2 SRL Structure

The programs defined by the language can be divided in four different sections, which must bealways in this order:

1. Input Variables, passed as part of the input parameters of a report call.2. Request Section, specifies the query to the DB in order to create the data Cube.3. Result Section, specifies the results.4. Method Section, specifies the methods used by the report.5. Report Section, specifies the “main” method of the report, the method to be executed

when the report is invoked.

With the exception of Method Section, all the others are mandatory.

This is a basic example of report program that makes a request of a Trunk Group’s incomingand outgoing calls and returns, as output, the addition of both variables (Calls Carried):

request tgrp_request{

classname = “TGRPOC”;objects = $OBJECTS;counters = “TGRP:CC_IC;TGRP:CC_OO”;periodbegin = $PERIOD_BEGIN;periodend = $PERIOD_END;granularity = HOUR_QUARTERLY;datatype = DETAILED;

}

//Result expectedresult tgrp_result{}

method CallsCarried (column cc_ic, column cc_oo) return column{

return cc_ic + cc_oo;}

report r1(){

int i;column c_aux;

for ( i = 0; i < tgrp_request.getNumberOfObjects(); i=i+1 ){

c_aux=CallsCarried (tgrp_request.getColumn(“TGRP:CC_IC”,i),tgrp_request.getColumn(“TGRP:CC_OO”,i));

tgrp_result.addColumn(“CallsCarr”,tgrp_request.getObjectReference(i),“Nr”, c_aux.getResultColumn());

}}

Page 11: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

9 E200301-01-314-V10.0I-01

3.2.1 Input Variables

Report input variables can be defined as $VARIABLES, which are defined at run-time.

They represent the variables of the report that will be substituted in execution time (objects,counters, time or other parameters). They always begin with a dollar symbol (“$”) and can befollowed by any alphanumeric characters, underscores or dollar symbols. For example,

$PARAMETER_1

Note:For the usage of the SRL reserved $VARIABLES, refer to Section 3.5.

3.2.2 Request Section

The user must specify the parameters of the query to the DB to create a data Cube. This meansthree fixed axes of the Cube: Counters (X axis), Time (Y axis) and Objects (Z axis).

The request is defined according to the following syntax:request IDENTIFIER{...classname = STRING; //or $VARIABLE

objects = STRING; //or $VARIABLEcounters = STRING; //or $VARIABLE

...periodbegin = CONST_TIME; //STRING or $VARIABLE

...periodend = CONST_TIME; //STRING or $VARIABLE

...granularity = CONST_GRANULARITY;

...datatype = CONST_DATATYPE;}

Example of a request specification:request IDENTIFIER{...// Z axis...classname = “TGRPOC”;...objects = “/South/Lisbon@NEO18:BF5021;/South/Lisbon@NEO18:BF5022”;

...// X axis

...counters = “TGRP:CC_IC;TGRP:CC_OO”;

...// Y axis

...periodbegin = 19801012000001;

...periodend = 1980101400000;

...granularity = HOUR_QUARTERLY;

...// type of data

datatype = DETAILED;}

A graphical representation of this example could be:

Page 12: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

10 E200301-01-314-V10.0I-01

TGRPOC:/@NEO18:BF5021TGRP:CC_IC TGRP:CC_OO

19801012001500 2500.0 1992.019801012003000 2400.0 1003.019801012004500 300.0 251.019801012010000 2499.0 2452.0(…) (…) (…)19801013010000 2221.0 2003.0(…) (…) (…)19801014000000 2231.0 2211.0

TGRPOC:/@NEO18:BF5022TGRP:CC_IC TGRP:CC_OO

19801012001500 500.0 499.019801012003000 1112.0 1020.019801012004500 2300.0 2202.019801012010000 1220.0 1203.0(…) (…) (…)19801013010000 2231.0 2222.0(…) (…) (…)19801014000000 2122.0 2121.0

Sheet 0 Sheet 1

Column 0 Column 1 Column 0 Column 1

Figure 4 – Graphical representation of a request.

The user can define as many requests as he needs, referencing them in the code by the identi-fier after the reserved word request.The request can be also defined dynamically, i.e. the user can use input variables that will besubstituted in execution time. In the following example, the object(s), the counter(s) and the timeperiod will be specified when the report is invoked:

request IDENTIFIER{...objects = $OBJECTS;...counters = $COUNTERS_LIST;...periodbegin = $PERIOD_BEGIN;...periodend = $PERIOD_END;...granularity = HOUR_QUARTERLY;

datatype = DETAILED;}

3.2.2.1 ObjectsThe STRING assigned to the request’s objects keyword contains the Object Instance Identifier.Each Object Instance belongs to one certain Object Class in the SPOTS Object Model. EachObject Class has a set of attributes that characterise that class.

Inside SRL, the Identifier of each individual Object Instance is a string concatenation of theobject’s attribute values separated by “:” (colon).

For example, the Trunk Group object class “TGRPOC” has 3 key attributes:<Domain ID>@<Network Node name>:<Trunk Group name>

One example of the Identifier STRING of one object instance of this class would be:“/South/Lisbon@NEO18:BF5021”

In the same STRING assigned to the request’s objects keyword, it can defined as many ObjectInstances as wanted, separating them by “;” (semicolon). For example:

“/South/Lisbon@NEO18:BF5021;/South/Lisbon@NEO18:BF5022”

Page 13: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

11 E200301-01-314-V10.0I-01

The SRL grammar allows the user to specify wildcards: “*” and “?”.“*” represents all combinations of alphanumeric characters, while “?” represents any alphanu-meric character (but only one).Example of a STRING assigned to the request’s objects keyword using wildcards:

“/South/Lisbon@NEO18:*” (all TGRP objects that are related with the node “NEO18”)

If the user needs to aggregate the results of a request with wildcards, the symbol “+” can beused. For example,

“/South/Lisbon@+NEO18:*”would match the same objects as the previous example but, instead of showing the data for allobjects, it will show the same data aggregated (for the virtual object associated with all TGRPsof the node “NEO18”).

In addition, Sets of Objects (SOO) can be used. SOOs are created within the SCL environment,under the PM Entities task group — for more information about this subject, refer to Section4.3.3 – Sets of Objects in [01]. SOOs can be referred using the keyword SOA, to aggregate thedata, or SOD, to get a result per each SOO component. Examples:

objects = “SOD!MySetOfObjects”

objects = “SOA!MySetOfObjects”

Note:For the usage of the SRL reserved variable $OBJECTS, refer to Section 3.5.

3.2.2.2 CountersThe STRING assigned to the request’s counters keyword must have the following structure:

“<Measurement name>:<Counter name>”

In the same STRING, it can be defined as many Counters as wanted, separating them by “;”(semicolon). For example:

“TGRP:CC_IC;TGRP:CC_OO”

Sets of Counters (SOC) can also be used. As SOOs, SOCs are created within the SCL environ-ment, under the PM Entities task group — for more information about this subject, refer toSection 4.3.2 – Sets of Counters in [01]. Set of Counters are referred using the keyword SOC,as described in the following example:

counters = “SOC!MySetOfCounters”

Additionally, Virtual Counters (VC) can be assigned to the request’s counters keyword. VCs arecreated within the SCL environment, under the PM Entities task group — for more informationabout this subject pls. refer to Section 4.3.1– Virtual Counters in [01]. Virtual Counters arereferred using the keyword VC. Example:

counters = “VC!VirtualCounter”

3.2.2.3 TimeThe time period is defined by its begin/end values (STRING), following the format specified inSection 4.1.1.

Note:For the usage of the SRL reserved variables $PERIOD_BEGIN and $PERIOD_END, refer toSection 3.5.

Page 14: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

12 E200301-01-314-V10.0I-01

3.2.2.4 GranularityCounters’ values can be presented according to one of the following granularities (ReservedWords):

DAILYFIVE_MINUTESHOURLYHOUR_QUARTERLYMONTHLYONE_MINUTEWEEKLY

Note:For detailed data (see Section 3.2.2.5), any of these values can be requested, independentlyof how data is stored in the SPOTS database.Therefore, aggregation or sub-division of the stored PM data values will be performed, if thespecified report granularity is different from the “original” value (in the SPOTS database).

3.2.2.5 Data TypeSPOTS reporting is applied to detailed and historical data — for the description of these data ty-pes, refer to [01], Section 1.6 – Internal data organisation. In the report’s Request Section,the following values (Reserved Words) can be used:

DETAILEDHISTORICAL_SPBHHISTORICAL_TOTALS

Note:For historical data, report results are presented with the following granularities, independentlyof the specified value (see Section 3.2.2.4):

HOURLY granularity for HISTORICAL_SPBH;DAILY granularity for HISTORICAL_TOTALS

3.2.3 Result Section

This section is intended to provide a way for controlling the results to be presented, (post)processing the data produced by the report/methods of the Processing Section. For example,sorting the data or restricting the results via filtering criteria (sub-set of objects, sub-periods ofthe time interval…).

However, for the current SRL version, this functionality isn't yet available, i.e. this section inclu-des only the result name, to be invoked in the Processing Section to receive the computedresults.

Therefore, the syntax for the definition of the result is restricted to:result IDENTIFIER {}

Example of a result specification:result my_result{}

Page 15: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

13 E200301-01-314-V10.0I-01

3.2.4 Processing Section (Method & Report Sections)

The user must define the methods first and then the reports that will use these methods:Method Definition:

method IDENTIFIER ( Parameters ) return Type MethodBody

Report Definition:report IDENTIFIER ( Parameters ) ReportBody

MethodBody or a ReportBody are composed by the sentences that define the processingcode of the programs. Both bodies create a new scope between the open and close brackets,where the local variables are defined before the rest of the sentences. They have the samesyntax (similar to the “C language” syntax). The only difference is that a method can return avalue and allows the return sentence in its code.

3.2.4.1 TypesThe types supported by the language and the allowed operations between types are describedin the next table:

Type Description

bool Boolean type (true or false).int 32 bits value with sign.double 64 bits value with sign.string String type (a constant string is delimited by quotation marks).cell It is the minimum reference to a Sheet structure. It can be associated to a

concrete object, time instant and counter. For the current SRL version,cell’s type is restricted to double.

row It is a set of Cells in the same instant of time and refer to the same objectand to all the counters defined to that object.

column It is a set of Cells referred to the same counter of the same object and in atime period.

sheet It is a set of Cells referred to the same object, in a time period and referredto a set of counters.

cube It is not implemented as a variable definable type, but it is used implicitlywhen accessing the raw data Cube.

result_column It is a set of Cells of the same counter and object. A time stamp isassociated with each Cell (this is the difference to a Column).

result_cube It is not implemented as a variable definable type, but it is used implicitlywhen accessing a result.

time Type to support time related variables.

Table 1 – SRL supported types

The operations can be grouped in three different types: arithmetical, conditional and logical.

Page 16: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

14 E200301-01-314-V10.0I-01

Arithmetical OperationsThe arithmetical operators are:

+ (plus)- (minus) — it can be used as unary or binary operator.* (multiply)/ (divide)

If the arithmetical operation is between different types, the result type is the most global type.For example: int + double = double or double + column = column.

If the arithmetical operation is between an integer or a double and a Cube Element (cell, row,column, sheet or result_column) it takes effect to all the data that is grouped by that Cube ele-ment.For example, 1.0 + var_column, adds 1.0 to every position/value of the var_column.

If the arithmetical operation is between two Cube Elements, these elements must have the sa-me dimension and takes effect between the values in the same position.For example: var_row1 + var_row2 is only valid if both Rows belong to the same object classand have the same counter associated to them.Another example: var_column1 * var_column2 is only valid if both Rows belong to the sameobject class and have the same time period associated to them. The result could be representedgraphically in this way:

1.0 5.4 6.43.2 + 6.2 = 9.43.1 0.3 3.4

Note:A Cube element (cell, column, row or sheet) must be always initialised, before beging used.This means that every element must be assigned to another element of the same type or anelement read from the Cube, with the pre-defined methods.

Conditional OperationsThe conditional operators are:

== (equal)!= (not equal)> (greater)< (less)>= (greater or equal)<= (less or equal)

The result of a conditional operation is a boolean value (true or false).

Logical OperationsFinally, the logical operators are:

! (not) — it is a unary operator.&& (and)|| (or)

The operands and the result are boolean values (true or false).

Page 17: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

15 E200301-01-314-V10.0I-01

The allowed operations between types are described in the next table:

bool int double cell row column sheetresult_column

bool Logical

int Arithm. (all)Condit. (all)

Arithm. (all)Condit. (all)

Arithm. (all)Condit. (all) Arithm. (all) Arithm. (all) Arithm. (all) Arithm. (all)

double Arithm. (all)Condit. (all)

Arithm. (all)Condit. (all)

Arithm. (all)Condit. (all) Arithm. (all) Arithm. (all) Arithm. (all) Arithm. (all)

cell Arithm. (all)Condit. (all)

Arithm. (all)Condit. (all)

Arithm. (all)Condit. (all)

row Arithm. (all) Arithm. (all) Arithm. (all)==,!=

column Arithm. (all) Arithm. (all) Arithm. (all)==,!=

sheet Arithm. (all) Arithm. (all)Arithm. (all)==,!=

result_column Arithm. (all) Arithm. (all) Arithm. (all)

==,!=

Table 2 – Operations between SRL supported types

3.2.4.2 Variables’ DefinitionAs stated before, each time a method or a report is declared, a new scope is open where wecan define new local variables (this definition must be done before any other sentences).

The syntax to define variables isType ListOfIdentifiers;

where ListOfIdentifiers is one identifier or more, separated by commas. For example:int j, var_1;column column_var1, column_var2;

3.2.4.3 Parameters and ArgumentsThe method definition gives the possibility to specify parameters as input. These parameters arepassed by value but not by reference, so this means that the method can only return a valueor operate directly over external structures that are defined in a global scope (refer to Section3.2.4.5).

If the list of parameters is not empty, it is defined according to the following syntax:Type IDENTIFIER [, Type DENTIFIER]

These are some examples:method m1(int a, int b) {} // two parameters, type intmethod m2(int a) {} // one parameter, type intmethod m3() return int { return 1; } // no parameter

When the method is invoked, the parameters’ type is checked. For example:report r1(){

int a;m1(1, a); // okm2(“Test”); // errora = m3(); // ok

}

Page 18: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

16 E200301-01-314-V10.0I-01

3.2.4.4 SentencesThe language allows the following types of sentences:

• Empty Sentence: it is a semicolon (“;”) and it is used as a separator between sentences.

• Body Sentence: used to group a set of sentences (for example, when we are defining aloop covering more than one sentence). It has the following syntax:

{ Sentences }

• Assign Sentence: the language allows the assignment of values that are the result of anyexpression. It has the following syntax:

Variable = Expression ;

• Method Call Sentence: this is the way to invoke methods. User-defined methods areinvoked according to the following syntax:

METHOD_NAME ( Argument List );METHOD_NAME ( );

The syntax for invoking pre-defined methods is described in Section 3.3.

• Conditional Sentence: it has the following syntax:if ( Conditional Expression ) then Sentence

orif ( Conditional Expression ) then Sentence else Sentence

whereConditional Expression controls the sentence to be applied:

− if true, the Sentence after then;− if false, the Sentence after else.

• Repetitive Sentences: there are two ways to define a loop: using a for sentence or awhile sentence. The following syntax is applied:

for ( For_initialitations; Conditional Expression; For_increment ) Sentence

andwhile ( Conditional Expression ) Sentence

where:For_initialitations is the initial value of the “iteration control”.Conditional Expression is the “boolean control”: the Sentence is executed

only if the expression is true.For_increment is the increment of the “iteration control”, perfor-

med after each iteration (loop).

• Return Sentence: it is used only in the methods’ scope and identifies the return to thecaller (method or report) and, eventually, the value to deliver. It has the following syntax:

return Expresion ;

orreturn ;

3.2.4.5 ScopesThe language defines two different scopes:

• Global Scope: it takes effect in the whole program. Request, method, result and reportnames are included in this scope. They can be referred anywhere.

• Local Scope: it takes effect in the report’s or method’s body. All processing variables andmethod parameters are included. They are not visible out of this scope — therefore, localvariables of different scopes may have the same name.

Page 19: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

17 E200301-01-314-V10.0I-01

3.3 Pre-defined Methods

There are two kinds of pre-defined methods:

• Associated with a basic type. The following Types are applied: row, columns, sheets,cube, result_column and result_cube — the operatations that are allowed between theexisting types are described in Table 2.

• Library methods. The following libraries are available:traffic_lib (Traffic methods).math_lib (Mathematical methods).time_lib (Date and time methods).string_lib (String methods).misc_lib (Miscellaneous methods).

Methods are invoked according to the following syntax:VariableName.MethodName (ArgumentList); // Type associated methods

orLibraryName.MethodName (ArgumentList); // Library methods

Examples:Invoke the “row associated” method clear to initialize the values of the row “Last_Counters”with “0”:

Last_Counters = Last_Counters.clear;

Invoke the library method abs to compute the absolute value of the variable “Difference” andkeep it in the variable”Unsigned_Difference”:

Unsigned_Difference = math_lib.abs (Difference);

The list of methods (grouped, in alphabetic order, by associated type or library) are describedbelow.

Note:The Cell’s value (shortly referred in the methods’ description as “value”) is the value of thecorresponding counter. The value’s type is double (refer to Section 3.2.4.1).

3.3.1 Associated with Rows

clear ()

Clears (sets to “0”) the values of the Row.

row clone ()

Returns a copy of the Row.

double maximum ()

Returns the maximum of the values of the Row.

int nelem ()

Returns the number of elements of the Row.

double sum ()

Returns the sum of the values of the Row.

Page 20: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

18 E200301-01-314-V10.0I-01

3.3.2 Associated with Columns

addValue (double value, int y_coord)

Adds a value in the specified Column’s position (Cell).

column aggregate (long granularity)

Aggregates the Column according to the specified granularity (refer to Section 3.2.2.4).The size of the aggregated Column depends on the applied granularity.For the aggregation concept, refer to [01], Section 1.6 – Internal data organisation.

double avg ()

Returns the average of the values of the Column.

clear ()

Clears (sets to “0”) the values of the Column.

column clone ()

Returns a copy of the Column.

result_column getDailyTotals (string process_type)

Returns the “daily total” value(s) in the referred Column, computed according to the speci-fied process (“sum”, “avg”, “max” or “min”). This process depends on the counter’s unit —for the daily total concept (Historical data), refer to [01], Section 1.6 – Internal data orga-nisation).

string getDate (int y_coord)

Returns the date associated with the specified Column’s position (Cell).The date’s format is described in Section 4.1.1).

int getGranularity ()

Returns the granularity of the Column (refer to Section 3.2.2.4).

result_column getRelatedValues (result_column ref_col)

Based on the time period associated with the specified ref_col, a Result Column isreturned with the values of the referred Column and the corresponding dates of that timeperiod.

result_column getResultColumn ()

Converts the Column in a Result Column (type conversion).

double getValue (int y_coord)

Returns the value associated with the specified Column’s position (Cell).

double getValueByDate (string date)

Returns the (counter’s) value associated with the specified date, in the referred Column.

double max ()

Returns the maximum of the values of the Column.

result_column max_pbh (string process_type

Returns the maximum of the SPBH value(s) and its asociated date (PBH), in the referredColumn — refer to the “pbh” method, described below.

Page 21: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

19 E200301-01-314-V10.0I-01

result_column maxTimeValue ()

Returns the maximum of the values of the Column and its associated date.

int nelem ()

Returns the number of elements of the Column.

result_column pbh (string process_type)

Returns the (daily) PBH and SPBH values in the referred Column (one pair “PBH/SPBH”per each day within the time period associated with the Column), computed according tothe specified process (“sum”, “avg”, “max” or “min”). This process depends on thecounter’s unit — for the PBH concept (Historical data), refer to [01], Section 1.6 – Inter-nal data organisation.

setGranularity (int granularity)

Sets the granularity of the Column (refer to Section 3.2.2.4).

double sum ()

Returns the sum of the values of the Column.

result_column tcbh (string process_type)

Returns the TCBH values (PBH and SPBH of the “average day”) in the referred Column,computed according to the specified process (“sum”, “avg”, “max” or “min”). This processdepends on the counter’s unit — for the PBH concept (Historical data), refer to [01],Section 1.6 – Internal data organisation.

3.3.3 Associated with Sheets

clear ()

Clears (sets to “0”) the values of the Sheet.

sheet clone ()

Returns a copy of the Sheet.

int getGranularity ()

Returns the granularity of the Sheet.

int getNumberOfColumns ()

Returns the number of Columns of the Sheet.

int getNumberOfRows ()

Returns the number of Rows of the Sheet.

int nelem ()

Returns the number of elements of the Sheet.

Page 22: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

20 E200301-01-314-V10.0I-01

3.3.4 Associated with Cubes

bool empty ()

Returns true if the Cube is empty (the Cells have no values).

column getColumn (string counter_name, int z_coord)

Returns, for the object located at z_coord, the Column identified by counter_name.

int getGranularity ()

Returns the granularity of the Cube.

int getNumberOfObjects ()

Returns the number of objects of the Cube.

string getChildrenAggregatedObjects (int z_coord)

Returns the “virtual object” that is composed by the "children" of the object located atz_coord.The Object containment tree (the hierarchical structure of object classes) is described in[01], Section 5.3 – Object classes and identifiers. For the description of the “virtualobject” concept, refer to [01], Section 4.3.3 – Sets of Objects.

string getChildrenObjects (int z_coord)

Returns the "children" of the object located at z_coord.For the description of the Object containment tree (the hierarchical structure of objectclasses), refer to [01], Section 5.3 – Object classes and identifiers.

string getObjectClass ()

Returns the name of the object class associated with the Cube.

string getObjectName (int z_coord)

Returns the name of the Sheet associated with the object located at z_coord.

ObjectReference getObjectReference (int z_coord)

Returns the reference (“pointer”) to the object located at z_coord.

string getParentName (int z_coord)

Returns the name of the "parent" of the object located at z_coord.For the description of the Object containment tree (the hierarchical structure of objectclasses), refer to [01], Section 5.3 – Object classes and identifiers.

row getRow (int y_coord, int z_coord)

Returns a Row of the Cube, i.e. all the counters related with the object located atz_coord and with the time stamp identified by y_coord.

sheet getSheet (int z_coord)

Returns a Sheet of the Cube, i.e. all the Columns that are associated with the object loca-ted at z_coord.

Page 23: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

21 E200301-01-314-V10.0I-01

load ()

Forces the Cube to be loaded.Note that the Cube is (implicitly) loaded whenever any method of this Section (“unload”excluded) is invoked.

unload ()

Frees memory of a (loaded) Cube (the Cube becomes empty).

3.3.5 Associated with Result Cubes

addColumn ( string column_name,ObjectReference object_reference,string unit_name,result_column rc)

Adds the Result Column rc to the Cube. The string column_name is the name of thecolumn as it will be shown in the output.For the possible values of unit_name, refer to [01], Section 5.8 – Counter Units.

setValue (int x_coord, int y_coord, int z_coord, double value)

Sets the input parameter value with the counter’s value that is associated with the Celllocated in the position (x_coord, y_coord, z_coord).

3.3.6 Associated with Result Columns

addDateValue (string date, double value)

Adds a new pair “date / (counter) value” to the Result Column.The date’s format is described in Section 4.1.1.

clear ()

All the Result Column’s components (pairs “date/value”) are removed (the Result Columnbecomes empty).

double getValueByDate (string date)

Returns the (counter) value associated with the specified date.The date’s format is described in Section 4.1.1.

double getValueByPosition (int position)

Returns the value associated with the Result Column’s component, identified by its posi-tion (index) in the Result Column.

result_column max ()

Returns the maximum value and the associated date in the Result Column.

string maxTimeValue ()

Returns the date of the maximum value in the Result Column.

double setValueByPosition (int position, double value)

Sets the value associated with the Result Column’s component, identified by its position(index) in the Result Column.

Page 24: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

22 E200301-01-314-V10.0I-01

3.3.7 Library traffic_lib

double calcTrunks (double TrafOff, double AdmisibleLoss)

Returns the number of resources (e.g. Trunks in a TGRP) that would be required toachieve a blocking probability (loss) lower than the specified AdmisibleLoss (in “%”). Itis computed via the “Erlang B” formula.

string getVersion (objectReference object, string date)

Returns the network node’s SW version associated with the specified object at thereferred date — for details on the network node’s SW version, refer to [01], Section4.1.2 – Configuring Software Versions.

double Loss (double TrafCarr, double Resources)

Returns the blocking probability (loss) to handle the specified traffic (in “erlangs”), usingthe available Resources. It is computed via the “Erlang B” formula.

3.3.8 Library math_lib

double abs (double val)

Returns the absolute value.

double cosine (double val)

Returns the cosine value. The parameter’s value is expressed in radians.

double logarithm (double val)

Returns the “natural” logarithm.

double power (double base, double exponent)

Returns base raised to the power of exponent.

double round (double val)

Returns the rounded value (e.g. 6.3 → 6.0; 6.7 → 7.0).

double sine (double val)

Returns the sine value. The parameter’s value is expressed in radians.

double squareRoot (double val)

Returns the square root value.

Page 25: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

23 E200301-01-314-V10.0I-01

3.3.9 Library misc_lib

defineVariable (string Variable_Name,Type Value, // the type depends on the parameter TypeOfValuestring TypeOfValue)

The $VARIABLE named Variable_Name (defined at run-time) is set with the specifiedValue. One of the following types can be used: bool, int, double, string or time.

error (string err_msg)

The report’s execution is terminated, returning the error message err_msg to the appli-cation under which the report is being executed.

sendAlarm ( string MeasVersion,ObjectReference object,string date,string ErrorSeverity,string TriggeredThreshold,double Value,string AdditionalInfo)

The specified threshold-crossing alarm is sent to the SAS where the report is being exe-cuted.

sendMail ( string ToAddress,string Subject, string Body)

The e-mail (Subject and Body) is sent to the specified addressee(s).

3.3.10 Library time_lib

time aDayBefore (time date_var)

Returns the time for the day before the date date_var.

time aMonthBefore (time date_var)

Returns the time for one month before the date date_var.

time aWeekBefore (time date_var)

Returns the time for one week before the date date_var.

int day (time date_var)

Returns the day (1..31) of the date date_var.

time firstMonthsDay (time date_var)

Returns the time for the first day of the month associated with the date date_var.

time firstWeeksDay (time date_var)

Returns the time for the first day of the week associated with the date date_var.

time firstYearsDay (time date_var)

Returns the time for the first day of the year associated with the date date_var.

int hour (time date_var)

Returns the hour (0..23) of the date date_var.

Page 26: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

24 E200301-01-314-V10.0I-01

time lastMonthsDay (time date_var)

Returns the time for the last day of the month associated with the date date_var.

time lastWeeksDay (time date_var)

Returns the time for the last day of the week associated with the date date_var.

time lastYearsDay (time date_var)

Returns the time for the last day of the year associated with the date date_var.

int minute (time date_var)

Returns the minute (0..59) of the date date_var.

int month (time date_var)

Returns the month (1..12) of the date date_var.

time readTimeFromString (string date_var, string format)

A date is converted from “string” to “time”. The format of the string (second method’sparameter) is composed by six words: “YYYY” (year), “MM” (month) “DD” (day), “HH”(hour), “mm” (minute) and “SS” (second). The sequence and the separator (onecharacter) are not fixed.

time today ()

Returns the current date.

int year (time date_var)

Returns the year of the date date_var.

int weekDay (time date_var)

Returns the weekday of the date date_var, using the following convension: 1 for Mon-day, 2 for Tuesday… and 7 for Sunday.

3.3.11 Library string_lib

string append (string str1, string str2)

Appends two strings.

bool compare (string str1, string str2)

Compares two strings (returns true if they are equal).The second string can use wildcards (“*” and “?”). For example: “anystart” and “*start” areequal; “middle” and “mi??le” are equal.

string find (string str1, string str2)

Returns the sub-string of str1 that starts with str2 characters.

string left (string str1, int n)

Returns the n first characters of str1.

long length (string str1)

Returns the length (number of characters) of a string.

string lowercase (string str1)

Returns str1 in lowercase.

Page 27: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

25 E200301-01-314-V10.0I-01

string replace (string str1, string str2,string str3)

Returns a string where all occurrences of str2 are replaced by str3.

string right (string str1, int n)

Returns the n last characters of str1.

string subString ( string str1,int start_pos, int len)

Returns a sub-string of str1.

string trim (string str1)

Removes spaces from a string.

string uppercase (string str1)

Returns str1 in uppercase.

Page 28: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

26 E200301-01-314-V10.0I-01

3.4 Developing Reports with SRL

In SRL the way to define and use methods is very similar to the “C language”.

A concrete example will be used to “walk-through” the steps for defining a report.

3.4.1 Report Sample

This is an example of how to implement a PBH method, and how to generate a TGRP LOADreport:

// Parameters Specification of the query to// the DB to create a data cube.request request_tgrp // Name of the requestused as{ // reference to access to raw data.classname = "TGRPOC"; // The Classnameobjects = "/@NE018.B0501;/@NE018.B0502"; // Only two objects for root domaincounters = "TGRP:CC_IC;TGRP:CC_OO"; // Two counters.periodbegin = 19981012000001; // Date of beginning andperiodend = 19981013000000; // ending of the period request

// as a standard input from the Spots// browser.

granularity = HOUR_QUARTERLY; // In seconds = 15 minutes.datatype = DETAILED; // Type of raw data.

}

// Result expected, this section defines the output result of the report.result tgrp_result{

}

// Method definition to calculate the Tgrp Load (returned a value).method TGRP_LOAD(column cc_ic, column cc_oo) return column{

return cc_ic + cc_oo;}

// Method definition to calculate the PBH of a day with granularity 15 minutes.method PBH(column c_input) return result_column{

result_column c_output;double pbh_value, aux_value;int i, k, pbh_position;

if( c_input.nelem() == 0) return c_output;

// By now, we allow the 15' granularityif( c_input.getGranularity() != HOUR_QUARTERLY) return c_output;

k=0;pbh_value = 0.0;

for (i=0; i < (c_input.nelem() - 3); i=i+1){

aux_value = 0.0;k=k+1;

// This and the three next positionsaux_value = c_input[i]+ c_input[i+1]+ c_input[i+2]+ c_input[i+3];

if (pbh_value < aux_value){

pbh_value = aux_value;pbh_position = i+3;

}

if ((k+3)==96) // ONE DAY{

c_output.addDateValue(c_input.getDate(pbh_position), pbh_value);pbh_value = 0.0;k=0;i=i+3;

}}

Page 29: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

27 E200301-01-314-V10.0I-01

return c_output;}

// Report definition, where the methods are invoked.report r1(){

int i;column c_load;result_column c_pbh;

// For every object (in this case, only two)for (i=0; i < request_tgrp.getNumberOfObjects(); i=i+1){

// Calculates the load.c_load=TGRP_LOAD(request_tgrp.getColumn("TGRP:CC_IC",i),

request_tgrp.getColumn("TGRP:CC_OO",i));

// Calculates the PBH of the load.c_pbh=PBH(c_load);

// Adds a new column with the tgrp load values.tgrp_result.addColumn("TGRP_LOAD",

request_tgrp.getObjectReference(i), "Nr",c_load.getResultColumn);

// Adds a new column with the pbh load value.tgrp_result.addColumn("PBH_TGRP_LOAD", "Nr",

request_tgrp.getObjectReference(i), c_pbh);}

}

3.4.1.1 Request SectionThis example has only a request (a data Cube) and its name is request_tgrp. This name willbe used as reference when we want to access the raw data.

Only two objects are specified in the request (\@NE018.B0501 and \@NE018.B0502), twoTGRPs; two counters (TGRP:CC_IC and TGRP:CC_OO), the incoming and outgoing traffic; andthe period of time of one day (1998/10/12), with a granularity of a quarter of hour.

3.4.1.2 Result SectionThis example has also only a result and its name is tgrp_result. This name will be used asreference when we want to add values to the output result.

3.4.1.3 Method SectionTwo methods are defined in this example:

• TGRP_LOAD: calculates the load of the trunk group.• PBH: Calculates the Peak Busy Hour of a day with a granularity of a quarter of hour.

The TGRP_LOAD method has two Columns of the data Cube as arguments, that must be thetrunk group’s incoming and outgoing counters, and just add them, returning a Column with theaddition of the values of the input Columns.

The PBH method has a Column as input argument that contains one day (period of time) of datawith a quarter hour of granularity. It will return a Result Column with a value (the addition of thevalues in the PBH) and the time stamp of the last quarter of hour that belongs to the PBH.After the local variable definitions, the code of the PBH method checks if there is data, and then ifthe granularity is correct. The next step is a loop that begins in the first element of the inputColumn and ends three elements before the last element of that Column (one hour before).The code in the loop calculates the total value of the hour for each element of the Column(remember that the Column is a sequence of values with dates associated in order of time). Itcompares if it is greater than the value existing until the moment and, if it is so, stores that valueand that position in the Column. It checks if the element is the last of the day, and, if it is so, itadds that pair date-value in the Result Column.At the end, the method returns the Result Column with the corresponding values.

Page 30: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

28 E200301-01-314-V10.0I-01

3.4.1.4 Report SectionIn this section only one report (r1) is defined, which calculates the TGRP’s load and the pbh ofthis TGRP, using the methods described before.

The report loops into all the objects of the request (only two in this case), processes each one’sdata and stores the result. The result data is stored in tgrp_result using two pre-definedmethods: setColumn, which must refer to an already defined Column of the result, andaddColumn, which allows to create (and add) dynamically a new Result Column.

Page 31: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

29 E200301-01-314-V10.0I-01

3.5 Creating a Report

The reports can be created using the Reports Editor (refer to [01], Section 4.6). The followingsteps should be accomplished successfully to create a report:

1. Creation of the report’s SRL source code;2. Compilation;3. Publish the report (in the SAS that was selected when SCL session was started) and defi-

ne its properties. This comprises the definition of the following:• Location and name in the reports tree presented by the SCL;• Default layout for the report (table or graphic);• Visibility of the report (Public or Private);• Object class to be used;• Run-time variables, specifying its type (int, double, string, bool or time) and the

default value;

Create Source Report and save it with <name>.sc

Compile Source Report

WorkFlow

Verify possible error messages and warnings and continue if

everything is OK. Otherwise repair errors and repeat compilation.

Publish the report in the server

Remarks

Create a report source file named testreport.sc in

the user's local platform.

Compile the report selecting the option Compile in

the Reports menu

Publish the report, selecting the option Add Report

to Server in the Reports menu.

Figure 5 – Process of creation of a new report.

Page 32: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

30 E200301-01-314-V10.0I-01

Remarks about the usage of external run-time variables ($VARIABLES):

1. There are three reserved $VARIABLES:• $OBJECTS: list of objects to be used in the report. When running the report from the

SCL, a list of objects to select will be shown.• $PERIOD_BEGIN: beginning date of the time period. When running the report from the

SCL, a calendar will be shown to enable the selection of this date.• $PERIOD_END: ending date of the time period. When running the report from the SCL, a

calendar will be shown to enable selection of this date.When the SPOTS user selects a report using the SCL GUI, the $OBJECTS variable needsto be specified from the SPOTS browser (refer to [01], Section 4.5.5 – Class Browser). Ifthe objects for the report are hard-coded in the report’s source, i.e. the report does not usethe variable $OBJECTS, the user’s object selection (via the SPOTS browser) will be discar-ded.

2. For non reserved external run-time variables, the SCL GUI will provide a window to inputvalues for each $VARIABLE that is defined in the reports.

Page 33: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

31 E200301-01-314-V10.0I-01

4 Language Reference

4.1 SRL Syntax

SRL syntax is very similar to the “C language”.

4.1.1 Lexical Specification

The language allows the following tokens:

Identifiers

They represent the name of the variables. They must begin by a letter or an underscore (“_”)and could be followed by alphanumeric characters, underscores or dollar symbols (“$”). Themaximum size is 256 characters.Normal and capital letters are distinguished, i.e. the “case sensitive” rule is applied.Example:

var_1

Report Variables (or $VARIABLES)

They represent the variables of the report that will be substituted in execution (objects, countersor time). They always begin with a dollar symbol (“$”) and can be followed by alphanumericcharacters, underscores or dollar symbols.Example:

$TIME_BEGIN

Integer ConstantsExample:

12

Double ConstantsExample:

12.0

Time ConstantsThey are defined as integer constants, according the following format: “YYYYMMDDHHMMSS”.Example for the 20th June 2002 at a quarter past 10 (10:15:00):

20020620101500.

Strings

They are sequences of characters between quotation marks(").Example:

“This is a string”

Arithmetical OperatorsThe arithmetical operators are:

+ (plus)- (minus) — it can be used as unary or binary operator.* (multiply)/ (divide)

If the arithmetical operator is applied between different types (e.g. integer and double) theresult’s type is the most global type (e.g. double).

Page 34: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

32 E200301-01-314-V10.0I-01

Conditional OperatorsThe conditional operators are:

== (equal)!= (not equal)> (greater)< (less)>= (greater or equal)<= (less or equal)

The result of a conditional operation is a boolean value (true or false).

Boolean OperationsThe boolean operators are:

! (not) — it is a unary operator.&& (and)|| (or)

The operands and the result are boolean values.

BracketsThey are used for different purposes:

{ or } (brackets) Used as scope’s delimiter.[ or ] (square brackets) Used for indexing the components (Cells) of Columns and

Result_columns.( or ) (parenthesis) Used in expressions and, in the invocation of methods and

reports, as delimiter of the parameters’ list., (comma) Used as separator (e.g. in the methods’ list of parameters).; (semicolon) Used as separator (e.g. between sentences, in the body of

methods or reports).

CommentsThere are two different ways to comment the SRL code:

• using “/*” as begin of comment text and “*/” as end of that comment text;• using “//” as begin of a line comment, that will affect the text bounded between the two

back slashes and the end of the current line.

Page 35: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

33 E200301-01-314-V10.0I-01

4.2 Reserved Words

bool long (1)

break (1) math_libcase (1) methodcast (1) misc_libcell MONTHLYchar (1) NO_DATA_VALUEclassname new (1)

column null (1)

columns objectsconst (1) ONE_MINUTEcontinue (1) periodbegincounters periodendDAILY reportdefault (1) requestdatatype resultdate (1) result_columndefine (1) returnDETAILED rowdo (1) sheetdouble sheet_nameelse showfalse stringFIVE_MINUTES string_libfor switch (1)

goto (1) this (1)

granularity timeHISTORICAL_SPBH time_libHISTORICAL_TOTALS traffic_libHOURLY trueHOUR_QUARTERLY var (1)

if void (1)

import (1) WEEKLYint while

Table 3 – SRL Reserved words

(1) Internally used, i.e. not accessible to the SRL user.

Page 36: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

34 E200301-01-314-V10.0I-01

5 Annexes

5.1 Grammar

SRL uses a context-free grammar, based on an LR1 parser (one token look-ahead LR parser).The following syntax is applied:

CompilationUnit : Imports Code;

Code : Requests Results Methods Reports| MethodsDefinitions| /* empty => No code */

;

/************** Imports **************/

Imports : import Location ';' Imports| /* empty */

;

/************** Requests **************/

Requests : Request MoreRequests;

MoreRequests : Request MoreRequests| /* empty */

;

Request : request IDENTIFIER '{' RequestBody '}';

RequestBody : ClassRequestObjectRequestCounterRequestPeriodDescriptionDataTypeRequest

;

ClassRequest : classname EQUAL STRING ';'| classname EQUAL VarIdsList ';'

;

ObjectRequest : objects EQUAL STRING ';'| objects EQUAL VarIdsList ';'

;

CounterRequest : counters EQUAL STRING ';'| counters EQUAL VarIdsList ';'

;

VarIdsList : VAR_IDENTIFIER| VarIdsList ',' VAR_IDENTIFIER

;

PeriodDescription : PeriodBegin PeriodEnd Granularity;

Page 37: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

35 E200301-01-314-V10.0I-01

PeriodBegin : periodbegin EQUAL CONST_INT ';'| periodbegin EQUAL TIME '(' STRING ')' ';'| periodbegin EQUAL VAR_IDENTIFIER ';'

;

PeriodEnd : periodend EQUAL CONST_INT ';'| periodend EQUAL time '(' STRING ')' ';'| periodend EQUAL VAR_IDENTIFIER ';'

;

Granularity : granularity EQUAL GranularityType ';';

DataTypeRequest : DATATYPE EQUAL DETAILED ';'| DATATYPE EQUAL HISTORICAL_SPBH ';'| DATATYPE EQUAL HISTORICAL_TOTALS ';'

;

/************** Results **************/

Results : Result MoreResults;

MoreResults : Result MoreResults| /* empty */

;

Result : result IDENTIFIER '{' ResultBody '}';

ResultBody : SheetDescription MoreSheets| RawDataLoad MoreSheets| /* empty */

;

MoreSheets : SheetDescription MoreSheets| RawDataLoad MoreSheets| /* empty */

;

SheetDescription : sheet '{' SheetBody '}';

SheetBody : SheetTitle ObjectClassName columns PeriodDescription;

ResultSheetBody : SheetTitle ObjectClassName PeriodDescription;

SheetTitle : sheet_name EQUAL STRING ';';

ObjectClassName : classname EQUAL STRING ';';

Columns : columns EQUAL STRING ';'| columns EQUAL ListOfNameType ';'

;

ListOfNameType : '[' STRING ',' STRING ']'| ListOfNameType ',' '[' STRING ',' STRING ']'

;

Page 38: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

36 E200301-01-314-V10.0I-01

RawDataLoad : show '{' RequestName BodyLoad '}';

RequestName : request EQUAL IDENTIFIER ';';

BodyLoad : ObjectRequest Counters Period| CounterRequest Period| PeriodDescription| /* empty */

;

Counters : CounterRequest| /* empty */

;

Period : PeriodDescription| /* empty */

;

/************** Methods **************/

MethodsDefinitions : Method Methods;

Methods : Method Methods| /* Empty => no method! */

;

Method : method IDENTIFIER MethodParameters ReturnType MethodBody;

MethodParameters : '(' ParameterList ')'| '(' ')'

;

MethodBody : Body;

ReturnType : return TypeSpecifier| /* empty : no return */

;

/************** Report **************/

Reports : Report MoreReports;

MoreReports : Report MoreReports| /* empty */

;

Report : report IDENTIFIER ReportParameters ReportBody;

ReportParameters : '(' ParameterList ')'| '(' ')'

;

ReportBody : Body;

Page 39: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

37 E200301-01-314-V10.0I-01

/************** ParameterList **************/

ParameterList : Parameter| ParameterList ',' Parameter

;

Parameter : TypeSpecifier IDENTIFIER| TypeSpecifier AND IDENTIFIER

;

/************** TypeSpecifier **************/

TypeSpecifier : PrimitiveType;

PrimitiveType : bool| int| double| sheet| column| row| cell| result_column

;

/************** Body **************/

Body : '{'LocalVariablesStatements'}'

;

/************** Variables **************/

LocalVariables : VariablesStatement LocalVariables| /* empty */

;

VariablesStatement : TypeSpecifier VariableDeclarators ';';

VariableDeclarators : VariableDeclarator| VariableDeclarators ',' VariableDeclarator

;

VariableDeclarator : IDENTIFIER;

Page 40: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

38 E200301-01-314-V10.0I-01

/************** Statements **************/

Statements : Statement Statements| /* empty */

;

Statement : EmptyStatement| AssignExpression EmptyStatement| MethodCall EmptyStatement| IfStatement| WhileStatement| ForStatement| BodyStatement| ReturnStatement

;

EmptyStatement : ';';

BodyStatement : '{' Statements '}';

ReturnStatement : return Expression EmptyStatement| return EmptyStatement

;

/************ Expressions ****************/

Expression : MINUS Expression %prec UNARY_MINUS| UnaryExpression| AssignExpression /* assign */| AritmExpression /* arithmetic operations */| LogicExpression /* Logical operations */| CondExpression /* compares */

;

UnaryExpression : '(' Expression ')'| Literal| Variable| MethodCall

;

AssignExpression : IDENTIFIER EQUAL Expression| IDENTIFIER '[' Expression ']' EQUAL Expression

;

AritmExpression : Expression PLUS Expression| Expression MINUS Expression| Expression MUL Expression| Expression DIV Expression

;

LogicExpression : Expression AND Expression| Expression OR Expression

;

CondExpression : NOT Expression %prec NOT_LOGIC| Expression EQUAL_EQUAL Expression| Expression MORE_THAN Expression| Expression MORE_EQUAL Expression| Expression LESS_THAN Expression| Expression LESS_EQUAL Expression| Expression NOT_EQUAL Expression| Expression AND_AND Expression| Expression OR_OR Expression

;

Page 41: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

39 E200301-01-314-V10.0I-01

MoreExpression : ',' Expression MoreExpression| /* empty */

;

/************ MethodCall ****************/

MethodCall : Variable '(' ArgumentList ')'| Variable '(' ')'

;

/************ ListArguments ****************/

ArgumentList : Expression| ArgumentList ',' Expression

;

/************* IfStatement ******************/

IfStatement : if '(' Expression ')'StatementElseStatement

;

ElseStatement : ELSE Statement| /* empty */

;

/************* WhileStatement ******************/

WhileStatement : while '(' Expression ')' Statement;

/************* ForStatement ******************/

ForStatement : for '(' ForIniExpression';' ForCondExpression';' ForPostExpression ')'Statement

;

ForIniExpression : StatementExpressionList| /* empty */

;

ForPostExpression : StatementExpressionList| /* empty */

;

StatementExpressionList : Expression MoreExpression;

ForCondExpression : Expression| /* empty */

;

Page 42: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

40 E200301-01-314-V10.0I-01

/************* Variable ******************/

Variable : Variable '.' IDENTIFIER| IDENTIFIER| IDENTIFIER '[' Expression ']'

;

/************* Location ******************/

Location : Location '.' IDENTIFIER| IDENTIFIER

;

/************* Literal ******************/

Literal : CONST_INT| CONST_FLOAT| STRING| true| false| GranularityType| NO_DATA_VALUE| VAR_IDENTIFIER

;

GranularityType : DAILY| FIVE_MINUTES| HOURLY| HOUR_QUARTERLY| MONTHLY| ONE_MINUTE| WEEKLY

;

Page 43: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

41 E200301-01-314-V10.0I-01

5.2 Report Samples

5.2.1 Time Evolution Report

This report uses detailed (15 minutes) data and provides its (time) evolution over the specifieddate interval.

//// dest_tevl.sc//// Time Evolution DEST Report - Source File//// Copyright (C) Siemens S.A. 2000// All Rights Reserved//// Redistribution and use in source and binary forms are not permitted// without an express written permission from Siemens S.A..// Advertising materials and other materials related to any// distribution or use of this software must be acknowledge that// the same was developed by Siemens S.A. and the above copyright// must be duplicated in all such forms and any documentation.// The name of Siemens S.A. may not be used to endorse or promote// products derived from this software. This software is provided// without any warranties, including, without limitation, the implied// warranties of merchantibility and fitness for a particular purpose.//

request dest_request{

classname = "DESTOC";objects = $OBJECTS;counters = "DEST:CC;DEST:CS_WA;DEST:TV;DEST:TV_WA;DEST:CC_IP";periodbegin = $PERIOD_BEGIN;periodend = $PERIOD_END;granularity = HOUR_QUARTERLY; // in seconds = 15 minutesdatatype = DETAILED;

}

// Result expectedresult dest_tevl_result{

}

report r1(){

column c_aux, c_CC, c_CCWA;int i;

for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ){

c_CC = dest_request.getColumn("DEST:CC", i )+ dest_request.getColumn("DEST:CC_IP", i );dest_tevl_result.addColumn("CallsCarr", dest_request.getObjectReference(i), "Nr",

c_CC.getResultColumn());

c_CCWA = dest_request.getColumn("DEST:CS_WA", i ) ;dest_tevl_result.addColumn("CallsCWthAns", dest_request.getObjectReference(i),

"Nr", c_CCWA.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV", i ) / HOUR_QUARTERLY ;dest_tevl_result.addColumn("TrafCarr", dest_request.getObjectReference(i), "Erl",

c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV_WA", i ) / HOUR_QUARTERLY ;dest_tevl_result.addColumn("TrafCWthAns", dest_request.getObjectReference(i),

"Erl", c_aux.getResultColumn());

c_aux = (c_CC / c_CCWA)* 100;dest_tevl_result.addColumn("ASR", dest_request.getObjectReference(i), "%",

c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV", i ) / c_CC;dest_tevl_result.addColumn("MHT", dest_request.getObjectReference(i), "sec",

c_aux.getResultColumn());

Page 44: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

42 E200301-01-314-V10.0I-01

c_aux = dest_request.getColumn("DEST:TV_WA", i ) / c_CCWA;dest_tevl_result.addColumn("MHTWthAns", dest_request.getObjectReference(i), "sec",

c_aux.getResultColumn());}

}

Page 45: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

43 E200301-01-314-V10.0I-01

5.2.2 Daily Totals Report

This report uses historical data and provides the daily statistics for the specified date interval.

//// dest_dtot.sc//// Daily Totals DEST Report - Source File//// Copyright (C) Siemens S.A. 2000// All Rights Reserved//// Redistribution and use in source and binary forms are not permitted// without an express written permission from Siemens S.A..// Advertising materials and other materials related to any// distribution or use of this software must be acknowledge that// the same was developed by Siemens S.A. and the above copyright// must be duplicated in all such forms and any documentation.// The name of Siemens S.A. may not be used to endorse or promote// products derived from this software. This software is provided// without any warranties, including, without limitation, the implied// warranties of merchantibility and fitness for a particular purpose.//

request dest_request{

classname = "DESTOC";objects = $OBJECTS;counters = "DEST:CC;DEST:CS_WA;DEST:TV;DEST:TV_WA;DEST:CC_IP";periodbegin = $PERIOD_BEGIN;periodend = $PERIOD_END;granularity = DAILY;datatype = HISTORICAL_TOTALS;

}

// Result expectedresult dest_dtot_result{

}

report r1(){

column c_aux, c_CC, c_CCWA;int i;

for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ){

c_CC = dest_request.getColumn("DEST:CC", i )+ dest_request.getColumn("DEST:CC_IP", i );dest_dtot_result.addColumn("CallsCarr", dest_request.getObjectReference(i), "Nr",

c_CC.getResultColumn());

c_CCWA = dest_request.getColumn("DEST:CS_WA", i ) ;dest_dtot_result.addColumn("CallsCWthAns", dest_request.getObjectReference(i),

"Nr", c_CCWA.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV", i ) / DAILY ;dest_dtot_result.addColumn("TrafCarr", dest_request.getObjectReference(i), "Erl",

c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV_WA", i ) / DAILY;dest_dtot_result.addColumn("TrafCWthAns", dest_request.getObjectReference(i),

"Erl", c_aux.getResultColumn());

c_aux = (c_CC / c_CCWA)* 100;dest_dtot_result.addColumn("ASR", dest_request.getObjectReference(i), "%",

c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV", i ) / c_CC;dest_dtot_result.addColumn("MHT", dest_request.getObjectReference(i), "sec",

c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV_WA", i ) / c_CCWA;dest_dtot_result.addColumn("MHTWthAns", dest_request.getObjectReference(i), "sec",

c_aux.getResultColumn());}

}

Page 46: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

44 E200301-01-314-V10.0I-01

5.2.3 SPBH Daily Peak Report

This report uses historical data and provides the SPBH values. One sample (per day) is presen-ted for each selected object.

//// dest_spbh_daily.sc//// Daily PBH DEST Report - Source File//// Copyright (C) Siemens S.A. 2000// All Rights Reserved//// Redistribution and use in source and binary forms are not permitted// without an express written permission from Siemens S.A..// Advertising materials and other materials related to any// distribution or use of this software must be acknowledge that// the same was developed by Siemens S.A. and the above copyright// must be duplicated in all such forms and any documentation.// The name of Siemens S.A. may not be used to endorse or promote// products derived from this software. This software is provided// without any warranties, including, without limitation, the implied// warranties of merchantibility and fitness for a particular purpose.//

request dest_request{

classname = "DESTOC";objects = $OBJECTS;counters = "DEST:CU_CONG;DEST:CU_NCB;DEST:CU_NTB;DEST:CU_TI;DEST:CC;DEST:CS_WA;

DEST:TV;DEST:TV_WA;DEST:CS_ID;DEST:CS_UA;DEST:CS_SB;DEST:CS_ETI;DEST:CS_ITI;DEST:CC_IP;DEST:CU_IPREJ";

periodbegin = $PERIOD_BEGIN;periodend = $PERIOD_END;granularity = DAILY;datatype = HISTORICAL_SPBH;

}

// Result expectedresult dest_spbh_daily_result{

}

report r1(){

column c_aux;int i;

for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ){

c_aux = dest_request.getColumn("DEST:CC", i ) +dest_request.getColumn("DEST:CC_IP", i );

dest_spbh_daily_result.addColumn("CallsCarr", dest_request.getObjectReference(i),"Nr", c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:CS_WA", i ) ;dest_spbh_daily_result.addColumn("CallsCWthAns",

dest_request.getObjectReference(i), "Nr",c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV", i ) / HOURLY ;dest_spbh_daily_result.addColumn("TrafCarr", dest_request.getObjectReference (i),

"Erl", c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV_WA", i ) / HOURLY ;dest_spbh_daily_result.addColumn("TrafCWthAns", dest_request.getObjectReference (i),

"Erl", c_aux.getResultColumn());

c_aux = ( dest_request.getColumn("DEST:CS_WA", i ) /dest_request.getColumn("DEST:CC", i ) ) * 100;

dest_spbh_daily_result.addColumn("ASR", dest_request.getObjectReference (i), "%",c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:TV", i ) /dest_request.getColumn("DEST:CC", i ) ;

dest_spbh_daily_result.addColumn("MHT", dest_request.getObjectReference (i),"sec", c_aux.getResultColumn());

Page 47: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

45 E200301-01-314-V10.0I-01

c_aux = dest_request.getColumn("DEST:TV_WA", i ) /dest_request.getColumn("DEST:CS_WA", i ) ;

dest_spbh_daily_result.addColumn("MHTWthAns", dest_request.getObjectReference (i),"sec", c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:CS_ID", i );dest_spbh_daily_result.addColumn("CallsWthIncDial",

dest_request.getObjectReference (i), "Nr",c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:CS_UA", i );dest_spbh_daily_result.addColumn("CallsWthNoAns", dest_request.getObjectReference (i),

"Nr", c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:CS_SB", i );dest_spbh_daily_result.addColumn("CallsSubsBusy", dest_request.getObjectReference (i),

"Nr", c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:CS_ETI", i ) +dest_request.getColumn("DEST:CS_ITI", i );

dest_spbh_daily_result.addColumn("CallsTechIrreg", dest_request.getObjectReference (i),"Nr", c_aux.getResultColumn());

c_aux = dest_request.getColumn("DEST:CU_CONG", i ) +dest_request.getColumn("DEST:CU_NCB", i ) +dest_request.getColumn("DEST:CU_NTB", i ) +dest_request.getColumn("DEST:CU_TI", i ) +dest_request.getColumn("DEST:CU_IPREJ", i );

dest_spbh_daily_result.addColumn("RejectedCalls", dest_request.getObjectReference (i),"Nr", c_aux.getResultColumn());

}

}

Page 48: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

46 E200301-01-314-V10.0I-01

5.2.4 SPBH Max Peak Report

This report uses historical data and provides the highest SPBH value (for each selected object)within the specified interval.

//// dest_spbh_max.sc//// MAX PBH DEST Report - Source File//// Copyright (C) Siemens S.A. 2000// All Rights Reserved//// Redistribution and use in source and binary forms are not permitted// without an express written permission from Siemens S.A..// Advertising materials and other materials related to any// distribution or use of this software must be acknowledge that// the same was developed by Siemens S.A. and the above copyright// must be duplicated in all such forms and any documentation.// The name of Siemens S.A. may not be used to endorse or promote// products derived from this software. This software is provided// without any warranties, including, without limitation, the implied// warranties of merchantibility and fitness for a particular purpose.//

request dest_request{

classname = "DESTOC";objects = $OBJECTS;counters = "DEST:CU_CONG;DEST:CU_NCB;DEST:CU_NTB;DEST:CU_TI;DEST:CC;DEST:CS_WA;

DEST:TV;DEST:TV_WA;DEST:CS_ID;DEST:CS_UA;DEST:CS_SB;DEST:CS_ETI;DEST:CS_ITI;DEST:CC_IP;DEST:CU_IPREJ";

periodbegin = $PERIOD_BEGIN;periodend = $PERIOD_END;granularity = DAILY;datatype = HISTORICAL_SPBH;

}

// Result expectedresult dest_spbh_max_result{

}

report r1(){

column c_aux;result_column ref_pbh;int i;

for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ){

c_aux = dest_request.getColumn("DEST:CC", i ) +dest_request.getColumn("DEST:CC_IP", i );

ref_pbh = c_aux.maxTimeValue();dest_spbh_max_result.addColumn("CallsCarr", dest_request.getObjectReference (i),

"Nr", ref_pbh);

c_aux = dest_request.getColumn("DEST:CS_WA", i ) ;dest_spbh_max_result.addColumn("CallsCWthAns", dest_request.getObjectReference (i),

"Nr", c_aux.getRelatedValues( ref_pbh));

c_aux = dest_request.getColumn("DEST:TV", i ) / HOURLY ;dest_spbh_max_result.addColumn("TrafCarr", dest_request.getObjectReference (i),

"Erl", c_aux.getRelatedValues( ref_pbh ));

c_aux = dest_request.getColumn("DEST:TV_WA", i ) / HOURLY ;dest_spbh_max_result.addColumn("TrafCWthAns", "EXCHOC",

dest_request.getObjectReference (i), "Erl", c_aux.getRelatedValues( ref_pbh ));

c_aux = ( dest_request.getColumn("DEST:CS_WA", i ) /dest_request.getColumn("DEST:CC", i ) ) * 100;

dest_spbh_max_result.addColumn("ASR", dest_request.getObjectReference (i), "%",c_aux.getRelatedValues( ref_pbh ));

c_aux = dest_request.getColumn("DEST:TV", i ) /dest_request.getColumn("DEST:CC", i ) ;

dest_spbh_max_result.addColumn("MHT", dest_request.getObjectReference (i), "sec",c_aux.getRelatedValues( ref_pbh ));

Page 49: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

47 E200301-01-314-V10.0I-01

c_aux = dest_request.getColumn("DEST:TV_WA", i ) /dest_request.getColumn("DEST:CS_WA", i ) ;

dest_spbh_max_result.addColumn("MHTWthAns", dest_request.getObjectReference (i),"sec", c_aux.getRelatedValues( ref_pbh ));

c_aux = dest_request.getColumn("DEST:CS_ID", i );dest_spbh_max_result.addColumn("CallsWthIncDial", dest_request.getObjectReference (i),

"Nr", c_aux.getRelatedValues( ref_pbh ));

c_aux = dest_request.getColumn("DEST:CS_UA", i );dest_spbh_max_result.addColumn("CallsWthNoAns", dest_request.getObjectReference (i),

"Nr", c_aux.getRelatedValues( ref_pbh ));

c_aux = dest_request.getColumn("DEST:CS_SB", i );dest_spbh_max_result.addColumn("CallsSubsBusy", dest_request.getObjectReference (i),

"Nr", c_aux.getRelatedValues( ref_pbh ));

c_aux = dest_request.getColumn("DEST:CS_ETI", i ) +dest_request.getColumn("DEST:CS_ITI", i );

dest_spbh_max_result.addColumn("CallsTechIrreg", dest_request.getObjectReference (i),"Nr", c_aux.getRelatedValues( ref_pbh ));

c_aux = dest_request.getColumn("DEST:CU_CONG", i ) +dest_request.getColumn("DEST:CU_NCB", i ) +dest_request.getColumn("DEST:CU_NTB", i ) +dest_request.getColumn("DEST:CU_TI", i ) +dest_request.getColumn("DEST:CU_IPREJ", i );

dest_spbh_max_result.addColumn("RejectedCalls", dest_request.getObjectReference (i),"Nr", c_aux.getRelatedValues( ref_pbh ));

}

}

Page 50: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

48 E200301-01-314-V10.0I-01

5.2.5 Top n Report

This report uses the daily total statistics (historical data) and provides, for the specified dateinterval, the 10 objects with the highest values of the indicator “PVC unavailability ratio”.

//// pvc_avl_top10_dtot.sc//// Top 10 Daily Totals ATM PVC Availability Report - Source File//// Copyright (C) Siemens S.A. 2000// All Rights Reserved//// Redistribution and use in source and binary forms are not permitted// without an express written permission from Siemens S.A..// Advertising materials and other materials related to any// distribution or use of this software must be acknowledge that// the same was developed by Siemens S.A. and the above copyright// must be duplicated in all such forms and any documentation.// The name of Siemens S.A. may not be used to endorse or promote// products derived from this software. This software is provided// without any warranties, including, without limitation, the implied// warranties of merchantibility and fitness for a particular purpose.//

request all_pvc_request{

classname = "ATMPVCOC";objects = $OBJECTS;counters = "ATMPVCAVL:AVL;ATMPVCAVL:UAVL";periodbegin = $PERIOD_BEGIN; // Only one day period - beginingperiodend = $PERIOD_END; // Only one day period - endgranularity = DAILY;datatype = HISTORICAL_TOTALS;

}

request pvc_request{

classname = "ATMPVCOC";objects = $OBJ1_PVC, $OBJ2_PVC, $OBJ3_PVC, $OBJ4_PVC, $OBJ5_PVC, $OBJ6_PVC,

$OBJ7_PVC, $OBJ8_PVC, $OBJ9_PVC, $OBJ10_PVC;counters = "ATMPVCAVL:MNT;ATMPVCAVL:NOUTM;ATMPVCAVL:NOUTF";periodbegin = $PERIOD_BEGIN; // Only one day period - beginingperiodend = $PERIOD_END; // Only one day period - endgranularity = DAILY;datatype = HISTORICAL_TOTALS;

}

// Result expectedresult pvc_avl_result{

}

method UnavlRatio (column c_avl, column c_unavl) return column{

return (c_unavl / (c_avl + c_unavl) * 100);}

method TotalNbrOutages (column c_noutf, column c_noutm) return column{

return (c_noutf + c_noutm);}

report r1(){

column c_pvcavl;column c_pvcunavl;column c_pvcavl_ratio;

int i, pos_max1, pos_max2, pos_max3, pos_max4, pos_max5, pos_max6, pos_max7,pos_max8, pos_max9, pos_max10;

double aux_val, aux_swap, max1, max2, max3, max4, max5, max6, max7, max8, max9, max10;

max1=0;max2=0;max3=0;max4=0;

Page 51: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

49 E200301-01-314-V10.0I-01

max5=0;max6=0;max7=0;max8=0;max9=0;max10=0;

for ( i = 0; i < all_pvc_request.getNumberOfObjects(); i=i+1 ){

c_pvcavl = all_pvc_request.getColumn("ATMPVCAVL:AVL", i);c_pvcunavl = all_pvc_request.getColumn("ATMPVCAVL:UAVL",i);c_pvcavl_ratio = UnavlRatio (c_pvcavl, c_pvcunavl);

aux_val = c_pvcavl_ratio.getValue(c_pvcavl_ratio.getDate(0));// getDate(0) because there is only one day

if (aux_val == NO_DATA_VALUE) aux_val=0;

if (max1 < aux_val){

aux_swap= aux_val;aux_val = max1;max1 = aux_swap;pos_max1 = i;

}

if (max2 < aux_val){

aux_swap= aux_val;aux_val = max2;max2 = aux_swap;pos_max2 = i;

}

if (max3 < aux_val){

…}

if (max10 < aux_val){

max10 = aux_swap;pos_max10 = i;

}}

if (max1==0)misc_lib.error("Not able to execute the report, not enough data");

c_pvcavl = all_pvc_request.getColumn("ATMPVCAVL:AVL", pos_max1);pvc_avl_result.addColumn("AvlTime", all_pvc_request.getObjectReference (pos_max1),

"Sec", c_pvcavl.getResultColumn());c_pvcunavl = all_pvc_request.getColumn("ATMPVCAVL:UAVL", pos_max1);pvc_avl_result.addColumn("UnavlTime", all_pvc_request.getObjectReference (pos_max1),

"Sec", c_pvcunavl.getResultColumn());c_pvcavl_ratio = UnavlRatio (c_pvcavl, c_pvcunavl);pvc_avl_result.addColumn("%UnavlTime", all_pvc_request.getObjectReference (pos_max1),

"%", c_pvcavl_ratio.getResultColumn());

misc_lib.defineVariable("$OBJ1_PVC", all_pvc_request.getObjectName(pos_max1) );

if (max2!=0){

c_pvcavl = all_pvc_request.getColumn("ATMPVCAVL:AVL", pos_max2);pvc_avl_result.addColumn("AvlTime", all_pvc_request.getObjectReference (pos_max2),

"Sec", c_pvcavl.getResultColumn());c_pvcunavl = all_pvc_request.getColumn("ATMPVCAVL:UAVL", pos_max2);pvc_avl_result.addColumn("UnavlTime", all_pvc_request.getObjectReference (pos_max2),

"Sec", c_pvcunavl.getResultColumn());c_pvcavl_ratio = UnavlRatio (c_pvcavl, c_pvcunavl);pvc_avl_result.addColumn("%UnavlTime", all_pvc_request.getObjectReference (pos_max2),

"%", c_pvcavl_ratio.getResultColumn());

misc_lib.defineVariable("$OBJ2_PVC", all_pvc_request.getObjectName(pos_max2) );

}

if (max3!=0){

Page 52: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

50 E200301-01-314-V10.0I-01

}

if (max10!=0){

c_pvcavl = all_pvc_request.getColumn("ATMPVCAVL:AVL", pos_max10);pvc_avl_result.addColumn("AvlTime", all_pvc_request.getObjectReference (pos_max10),

"Sec", c_pvcavl.getResultColumn());c_pvcunavl = all_pvc_request.getColumn("ATMPVCAVL:UAVL", pos_max10);pvc_avl_result.addColumn("UnavlTime", all_pvc_request.getObjectReference (pos_max10),

"Sec", c_pvcunavl.getResultColumn());c_pvcavl_ratio = UnavlRatio (c_pvcavl, c_pvcunavl);pvc_avl_result.addColumn("%UnavlTime", all_pvc_request.getObjectReference (pos_max10),

"%", c_pvcavl_ratio.getResultColumn());

misc_lib.defineVariable("$OBJ10_PVC", all_pvc_request.getObjectName(pos_max10) );}

all_pvc_request.unload();

pvc_request.load();}

report r2(){

column c_pvcmnt;column c_pvcnoutf;column c_pvcnoutm;column c_pvcnout_tot;int i;

for ( i = 0; i < pvc_request.getNumberOfObjects(); i=i+1 ){// For the top 10 unavailable pvcs

c_pvcmnt = pvc_request.getColumn("ATMPVCAVL:MNT", i);pvc_avl_result.addColumn("MaintTime", pvc_request.getObjectReference (i), "Sec",

c_pvcmnt.getResultColumn());c_pvcnoutf = pvc_request.getColumn("ATMPVCAVL:NOUTF", i);pvc_avl_result.addColumn("NbrFailOutages", pvc_request.getObjectReference (i),

"Nr", c_pvcnoutf.getResultColumn());c_pvcnoutm = pvc_request.getColumn("ATMPVCAVL:NOUTM", i);pvc_avl_result.addColumn("NbrMaintOutages", pvc_request.getObjectReference (i),

"Nr", c_pvcnoutm.getResultColumn());c_pvcnout_tot = TotalNbrOutages (c_pvcnoutf, c_pvcnoutm);pvc_avl_result.addColumn("TotalNbrOutages", pvc_request.getObjectReference (i),

"Nr", c_pvcnout_tot);}

}

Page 53: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

51 E200301-01-314-V10.0I-01

5.2.6 Day Periods Time Evolution Report

This report uses detailed data (15 minutes granularity) and provides its (time) evolution over thespecified date interval for three time periods: morning (from 09:00 to 11:00), afternoon (from14:00 to 16:00) and night (from 20:00 to 22:00).

//// dest_day_period_tevl.sc//// Daily Period Time Evolution DEST Report - Source File//// Copyright (C) Siemens S.A. 2000// All Rights Reserved//// Redistribution and use in source and binary forms are not permitted// without an express written permission from Siemens S.A..// Advertising materials and other materials related to any// distribution or use of this software must be acknowledge that// the same was developed by Siemens S.A. and the above copyright// must be duplicated in all such forms and any documentation.// The name of Siemens S.A. may not be used to endorse or promote// products derived from this software. This software is provided// without any warranties, including, without limitation, the implied// warranties of merchantibility and fitness for a particular purpose.//

request dest_request{

classname = "DESTOC";objects = $OBJECTS;counters = "DEST:CC;DEST:CS_WA";periodbegin = $PERIOD_BEGIN;periodend = $PERIOD_END;granularity = HOUR_QUARTERLY; // in seconds = 15 minutesdatatype = DETAILED;

}

// Result expectedresult dest_test_result{

}

report r1(){

column c_aux, c_CC, c_CSWA;result_column c_I1,c_I2,c_I3;int i,j, k;double acc;

for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ){

c_CC = dest_request.getColumn("DEST:CC", i );

c_CSWA = dest_request.getColumn("DEST:CS_WA", i ) ;

// Execute the formula with the resulting rowsc_aux = (c_CSWA / c_CC)* 100;

for ( k = 0; k < c_aux.nelem(); k=k+96 ){

// Get date for morning periodj=k+35;

acc = c_aux[j];

for (j= k+36 ; j < (k+43) ; j=j+1){// Check value of the column to add to the acumulator

if ( c_aux[j]!=NO_DATA_VALUE ){

// The value is valid, so verify if value IN acumulator is validif (acc == NO_DATA_VALUE){

// The value is not valid, so initialise the acumulator to zeroacc =c_aux[j];

Page 54: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

52 E200301-01-314-V10.0I-01

}else{

// The value is valid, so execute the additionacc = acc + c_aux[j];

}}

}

// Add results for morning period to the c_I1 result_columnc_I1.addDateValue( c_aux.getDate(k+35), acc);

acc = c_aux[k+55];

for (j= k+56 ; j < (k+63) ; j=j+1){

// Check value of the column to add to the acumulatorif ( c_aux[j]!=NO_DATA_VALUE ){

// The value is valid, so verify if value IN acumulator is validif (acc == NO_DATA_VALUE){

// The value is not valid, so initialise the acumulator to zeroacc =c_aux[j];

}else{

// The value is valid, so execute the additionacc = acc + c_aux[j];

}}

}

// Add results for afternoon period to the c_I1 result_columnc_I2.addDateValue(c_aux.getDate(k+35),acc);

acc = c_aux[ k+79 ];

for (j= k+80 ; j < (k+87) ; j=j+1){

// Check value of the column to add to the acumulatorif ( c_aux[j]!=NO_DATA_VALUE ){

// The value is valid, so verify if value IN acumulator is validif (acc == NO_DATA_VALUE){

// The value is not valid, so initialise the acumulator to zeroacc =c_aux[j];

}else{

// The value is valid, so execute the additionacc = acc + c_aux[j];

}}

}

// Add results for night period to the c_I1 result_columnc_I3.addDateValue(c_aux.getDate(k+35),acc);

}

//Add c_I1 result_column to final table dest_testdest_test_result.addColumn("CallComp-Morning", dest_request.getObjectReference (i),

"NR", c_I1);dest_test_result.addColumn("CallComp-Aftenoon", dest_request.getObjectReference (i),

"NR", c_I2);dest_test_result.addColumn("CallComp-Night", dest_request.getObjectReference (i),

"NR", c_I3);

// clear valuesc_I1.clear();c_I2.clear();c_I3.clear();

}

}

Page 55: Spots 10.0 Report Processing Language

Report Processing Language (SPOTS V10 Drop 4) Siemens S.A.

53 E200301-01-314-V10.0I-01

6 References

[01] User ManualSPOTS V10(SSA Doc E200301-01-114-V10.0I-*)

Page 56: Spots 10.0 Report Processing Language

Siemens S.A. Report Processing Language (SPOTS V10 Drop 4)

54 E200301-01-314-V10.0I-01

7 Glossary & Abbreviations

DB Database.

GUI Graphical User Interface.

PBH Peak Busy Hour.

PM Performance Management.

SAS SPOTS Application Server.

SCL SPOTS Client application.

SOC Set of Counters.

SOO Set of Objects.

SPBH Sample at PBH.

SPOTS PM Tool.

SRL SPOTS Reporting Language.

TCBH Time Consistent Consistent Busy Hour.It is defined (for an interval of days) as the PBH of the "average day". Each va-lue of this "average day" is computed as the average of the corresponding dailydetailed values (e.g., the first detailed value of the "average day" is obtained di-viding, by the number of days of the interval, the sum of all daily values relatedto the first scantime interval).

TGRP Trunk Group.

VC Virtual Counter.