IBM 15 Switch User Manual


 
128
Chapter 8
For more information, see the topic Values and Data Types in Chapter 7 on p. 110. Additionally,
these rules ar
e covered in more detail in the following topics.
Integers
Integer s are represent ed as a sequence of decimal digits. O ptionally, you c an place a minus s ign
(−) before the integer to deno te a ne gative number—for example, 1234, 999, 77.
The CLEM language handles integers of arbitrary pr ecision. The maximum integer size
depends on your platform. If the values are too large to be displayed in an integer eld, changing
the eld type to Real usually restores the value.
Reals
Real refers to a oating-point number. Reals are repr esented by one or more digits followed by a
decimal point followed by one or more digits. CLEM reals are held in double precision.
Optionally, you can place a min us sign (−) before the real to denote a negative number––for
example, 1.234, 0.999, 77.001. Use the form <number> e <exponent> to express a real numb er
in exponential notation—for example, 1234.0e5, 1.7e2. When the IBM® SPSS® Modeler
applicat ion reads numbe r strings from les and converts t hem automatically to numbers, numbers
with no leading digit before the decimal point or with no digit after the point are accepted––for
example, 999. or .11. How ever, these forms are illegal in CLEM expressions.
Note: When referencing real nu mbers in C LEM expressions, a period must be used as the decimal
separat or, regardless of any s ettings for the current stream or locale. Fo r example, specify
Na > 0.6
rather than
Na > 0,6
This applies even i f a comma is selected as the decimal symbol in the stream p r operties dialog
box and is consistent with the general guideline that code syntax should be inde pendent of any
specic locale or convention.
Characters
Charac ters (usually shown as CHAR) are typically used within a CLEM express ion to perform
tests on strings. For example, you can use the function isuppercode to determine whether the rst
character of a string is upper ca se. The following CLEM expressio n uses a character to indicate
that the test should be performed on the rst character of the string:
isuppercode(subscrs(1, "MyString"))
To express the cod e (in contrast to the location) of a particular character in a CLEM expression,
use single backquotes of the form `<character>`––for example, `A`, `Z`.
Note: There is no CHAR storage type for a eld, so if a eld is derived or lled with an expression
that results in a CHAR, then that result will be converted to a string.