Column headings in Query for iSeries
If you want to specify a column heading to be used for a result field, type the heading you want on the
three lines (up to 20 characters each) of the display that correspond to your result field. The heading will
appear in your query output exactly as you enter it on the three lines.
If you do not want any heading for a result field, type
*NONE
in the first five positions on the first line for
that field. (You must use all capital letters, and the remainder of the line and the next two lines must be
blank.) If you do not specify either a heading or *NONE, Query uses the result field name as the column
heading.
Length and decimal positions in Query for iSeries
For character (SBCS and DBCS), date, time, and timestamp result fields, you must leave the
Len
and
Dec
values blank. If you do not specify anything in the
Len
and
Dec
columns when you define a result field,
Query determines the length of the result field. When Query determines these values, you have fewer
things to consider when changing expressions. If you want to know the length of the result field, press F13
to see the layout of the report and count the number of 9s (numeric fields) and Xs (SBCS character fields).
If you are using a DBCS-capable display and have DBCS data, count the number of:
Double-byte Js, which represent DBCS-only data
Double-byte Os, which represent DBCS-open (mixed) data
Double-byte Es, which represent DBCS-either data
Double-byte Gs, which represent DBCS-graphic data
For date, time, or timestamp fields, look at the length of the current date, time, or timestamp in the result
field.
For numeric result fields, length is the total number of digits in the field. It includes the number of digits to
the left and right of the decimal point but not the decimal point itself. Decimal is the number of decimal
positions to the right of the decimal point. If you want to type your own value for the length, to prevent
unexpected results, you should first read “Length and decimal positions in Query for iSeries reports” on
page 120 and “Result field length and decimal positions in Query for iSeries” on page 188. Also, observe
the following:
v
If you specify a value for
Len
, you must also specify a value for
Dec
(decimal positions).
v
If you increase or decrease the value in
Dec
, you should increase or decrease the value in
Len
the
same amount. Also, you may need to change these values later if you make changes to the numeric
expression.
v
If you leave
Len
and
Dec
blank, Query changes the value if the expression changes.
If you are creating result fields by using multiplication and division operations, you
may
be able to reduce
the length value if the actual data in your files will not require the maximum field size as established by
Query. For example, an inventory master file would typically have a
PRICE
field and a
QUANTITY
field. Both
fields would have to have sufficient length to handle the largest value possible. When these two fields are
multiplied to create a result field called
AMOUNT
, the maximum length would be the sum of the sizes of both
fields. Since items with high prices are usually stocked in low quantities, the maximum field size for
AMOUNT
would probably be too large for practical use (for example, in a report).
Note:
If you want to decrease the field length because you only want a certain number of positions shown
on a report, you should not change the field length on the Define Result Fields display. Change the
field length on the Specify Report Column Formatting display instead. If you specify a field length
on the Define Result Fields display, the result of an numeric expression may be truncated or
rounded, depending on what you specify on the Specify Processing Options display.
Chapter 5. Defining result fields in Query for iSeries
85
Summary of Contents for @server iSeries
Page 1: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 2: ......
Page 3: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 12: ...x Query for iSeries Use V5R2 ...
Page 14: ...2 Query for iSeries Use V5R2 ...
Page 32: ...20 Query for iSeries Use V5R2 ...
Page 38: ...26 Query for iSeries Use V5R2 ...
Page 44: ...32 Query for iSeries Use V5R2 ...
Page 116: ...104 Query for iSeries Use V5R2 ...
Page 122: ...110 Query for iSeries Use V5R2 ...
Page 146: ...134 Query for iSeries Use V5R2 ...
Page 150: ...138 Query for iSeries Use V5R2 ...
Page 174: ...162 Query for iSeries Use V5R2 ...
Page 178: ...166 Query for iSeries Use V5R2 ...
Page 196: ...184 Query for iSeries Use V5R2 ...
Page 198: ...186 Query for iSeries Use V5R2 ...
Page 204: ...192 Query for iSeries Use V5R2 ...
Page 205: ...Part 4 Appendixes Copyright IBM Corp 2000 2002 193 ...
Page 206: ...194 Query for iSeries Use V5R2 ...
Page 210: ...198 Query for iSeries Use V5R2 ...
Page 242: ...230 Query for iSeries Use V5R2 ...
Page 256: ...244 Query for iSeries Use V5R2 ...
Page 270: ...258 Query for iSeries Use V5R2 ...
Page 272: ...260 Query for iSeries Use V5R2 ...
Page 292: ...280 Query for iSeries Use V5R2 ...
Page 293: ......
Page 294: ... Printed in U S A SC41 5210 04 ...