EasyManuals Logo

IBM ISERIES SC41-5210-04 User Manual

IBM ISERIES SC41-5210-04
294 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #201 background imageLoading...
Page #201 background image
In calculations involving many large fields, you can control your results better by breaking the expression
into parts, calculating each part as a separate result field. Then you can use these result fields in an
expression to calculate the result field you want. You can specify length and decimal positions for the
intermediate result fields to minimize the length of the final result field.
For example:
X12 = (1.2998−P−Q)/((R + S) * (T − U)) + 6
Instead of defining result field X12 in one step as above, you could do it in three:
X12PART1 = 1.2998−P−Q
X12PART2 = (R + S) * (T − U)
X12 = X12PART1/X12PART2 + 6
If the user knows that X12PART1, for example, is always a number between 0 and 1.2998, the user can
specify 5 for Len and 4 for Dec (on the Define Result Fields display) for X12PART1. This decreases the
length of X12.
Length and decimal positions used for internal numeric calculations in
Query for iSeries
The following formulas define the maximum length and decimal positions used internally by Query for
decimal calculations for numeric result fields. The maximum length and decimal positions do not
necessarily correspond with the presentation length and decimal positions assigned by Query. The
symbols p and d denote the length and decimal positions of the first operand. The symbols p
1
and d
1
denote the length and decimal positions of the second operand.
Addition and subtraction in Query for iSeries
The maximum length for the result field:
min(31,max(p-d,p
1
-d
1
)+max(d,d
1
)+1).
The maximum decimal positions:
max(d,d
1
).
Multiplication in Query for iSeries
The maximum length for the result field:
min(31,p+p
1
)
The maximum decimal positions:
min(31,d+d
1
).
Division in Query for iSeries
The maximum length for the result field:
31
The maximum decimal positions:
31-p+d-d
1
.
Chapter 17. Additional information about Query for iSeries for programmers 189

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM ISERIES SC41-5210-04 and is the answer not in the manual?

IBM ISERIES SC41-5210-04 Specifications

General IconGeneral
BrandIBM
ModelISERIES SC41-5210-04
CategoryServer
LanguageEnglish

Related product manuals