Select Function
Data from a Select Function is delimited by the DATASOURCE boundaries. It includes:
The name of the Select Function - displayed in quotation marks
A "Function(Field)" designation - displayed in quotation marks
The actual value returned by the "Function(Field)" designation It is a single value when the function is Average, Count, Count Distinct, Max, Min, Mode, Sum, or Standard Deviation. It repeats for every row of data in the Select Function, when the function is Data. The field can be either the name of a field in the Select Function, or * for every field in the Select Function
When "Function(Field)" returns one value, the format is as follows:
<DATASOURCE name="
select function name
" field="
FUNCTION(FIELD NAME)
">
actual value
</DATASOURCE>
Example:
<DATASOURCE name="Sum Tran Amt by Tran Code"field="MAX(TRAN_AMT)">
2255
</DATASOURCE>
When the function is Data, the format is as follows:
- <DATASOURCE name="
select function name
" field="DATA(*)">
- <ROW>
<FIELD name="
FIELD1 NAME
">
field value
</FIELD>
<FIELD name="
FIELD2 NAME
">
field value
</FIELD>
<FIELD name="
FIELD+n NAME
">
field value
</FIELD>
</ROW>
- <ROW+n>
<FIELD name="
FIELD1 NAME
">
field value
</FIELD>
<FIELD name="
FIELD2 NAME
">
field value
</FIELD>
<FIELD name="
FIELD+n NAME
">
field value
</FIELD>
</ROW+n>
</DATASOURCE>
Example:
- <DATASOURCE name=“Sum Tran Amt by tran Code”field=“DATA(*)”>
- <ROW>
<FIELD name= “TRAN_AMT”>2505</FIELD>
<FIELD name=“TRAN_CODE”>203</FIELD>
</ROW>
</DATASOURCE>
Copyright IBM Corporation 2012. All Rights Reserved.