Rules for concatenation
If a symbolic parameter in a model statement is immediately preceded
or followed by other characters or another symbolic parameter, the
characters that correspond to the symbolic parameter are combined in the
generated statement with the other characters, or with the characters
that correspond to the other symbolic parameter.
This process is called concatenation.
When variable symbols are concatenated to ordinary character strings,
the following rules apply to the use of the concatenation character (a
period). The concatenation character is mandatory when:
- 1
- An alphanumeric character follows a variable symbol.
- 2
- A left parenthesis that does not enclose a subscript follows
a variable symbol.
- 3 -- 4
- A period (.) is to be generated.
Two periods must be specified in the concatenated string following
a variable symbol.
The concatenation character is not required when:
- 5
- An ordinary character string precedes a variable symbol.
- 6
- A special character, except a left parenthesis or a period,
is to follow a variable symbol.
- 7
- A variable symbol follows another variable symbol.
- 8
- A variable symbol is used with a subscript. The concatenation
character must not be used between a variable
symbol and its subscript; otherwise, the characters are considered
a concatenated string and not a subscripted variable symbol.
Table 37, in which the numbers correspond
to the numbers in the above list,
gives the rules for concatenating
variable symbols to ordinary character strings.
Table 37. Rules for concatenation
| Concatenated String |
Values to be
Substituted |
Generated Result |
| Variable Symbol |
Value |
&FIELD.A 1
&FIELDA |
&FIELD
&FIELDA |
AREA
SUM |
AREAA
SUM |
&DISP.(&BASE)1
^ ^
2 6 |
&DISP
&BASE |
100
10 |
100(10) |
DC D'&INT..&FRACT'1
^
3
DC D'&INT&FRACT'
^
7 |
&INT
&FRACT |
99
88 |
DC D'99.88'
^
4
DC D'9988' |
FIELD&A 5 |
&A |
A |
FIELDA |
&A+&B*3-D
^ ^
*--*-- 6 |
&A
&B |
A
B |
A+B*3-D |
&SYM(&SUBSCR)
^
8 |
&SUBSCR
&SYM(10) |
10
ENTRY |
ENTRY |
|
Notes:
- The concatenation character is not generated.
|
Concatenation of fields containing double-byte data
If the DBCS assembler option is specified, then the following
additional rules apply:
- Because ampersand is not recognized in double-byte data, variable
symbols must not be present in double-byte data.
- The concatenation character is mandatory when double-byte data is
to follow a variable symbol.
- The assembler checks for redundant SI and SO at concatenation
points. If the byte to the left of the join is SI and the byte to
the right of the join is SO, then the SI/SO pair is considered
redundant and is removed.
Note:
The rules for redundant SI and SO are different for variable
substition and listing display, which are described at
Listing of generated fields containing double-byte data.
The following example shows these rules:
&SYMBOL SETC '<DcDd>'
DBCS DC C'<DaDb>&SYMBOL.<.&.S.Y.M.B.O.L>'
The SI/SO pairs between double-byte characters Db and
Dc, and Dd and .&, are removed.
The variable symbol &SYMBOL is recognized
between the double-byte strings but not
in the double-byte strings. The result after concatenation
is:
DBCS DC C'<DaDbDcDd.&.S.Y.M.B.O.L>'
[ Top of Page | Previous Page | Next Page | Contents | Index ]