Constants
You can specify a value explicitly by writing a string constant, an integer constant, or a floating-point constant.
String constant
'). The sequence can contain any characters. You must add one apostrophe
(') before the sequence and another apostrophe (') after the
sequence. See the following examples:'A 2'
'a:b'
''A string constant
represents the character string within the enclosing apostrophes. Therefore, the first two constants
in the example represent the strings A 2 and a:b. The first string
contains a blank in the middle. The last example is a sequence of zero characters that represents an
empty string. A string constant might contain sequences of double-byte characters, each enclosed between shift-out (SO, x'0E' in EBCDIC) and shift-in (SI, x'0F' in EBCDIC) characters. The apostrophes are single-byte characters and are recognized outside a double-byte sequence.
The maximum length of a string that is represented by a string constant is 254 bytes, which includes any shift-out and shift-in characters that enclose sequences of double-byte characters.
Integer constant
-127
0
5
32767
720176
0000000015An integer constant represents a
whole number in decimal notation. The number must be no greater than 2,147,483,647, and no smaller
than -2,147,483,648. The maximum length of a constant is 32 characters.Floating-point constant
25.5
1000.
0.0
37589.33333
15E1
2.5E5
2.2E-1
5.E+22A
floating-point constant represents a 64-bit floating-point number of S/390® architecture. The number is represented in decimal notation, with
Enn meaning multiplied by 10 to power nn. For example, 2.5E5
means 2.5*105, and 2.2E-1 means 2.2*10-1. The specified value is rounded to
the closest value that can be represented as a 64-bit floating-point number.The number must not exceed 1663-1649, which is approximately 7.2E75. The smallest value different from 0 is 16-65, which is approximately 54.E-79. The maximum length of a constant is 32 characters.
Integer constants or floating-point constants can represent non-negative numbers only. To
represent a negative number, add a minus operator (-) in front of the constant.