Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Variable name syntax

&pagelevel(5)&pagelevel

The following metasyntax applies:

Symbol

Meaning

:=

Definition

< >

SDF data type

m..n

Value range

...

Repetition

/

Alternative entry

[ ]

Optional entry

The SDF data types <composed-name> and <structured-name> are used for variable names and partial variable names in SDF-P in the command syntax. However, the syntax checked by SDF-P is restricted in comparison with these data types and is therefore described here in more detail.

A variable name (composed-variable-name) in SDF-P consists of one or more structure names (structured-variable-name) separated from each other by periods. The period in each case marks the name of a substructure. Blanks are not permitted within a variable name.

composed-variable-name:=structured-variable-name[.structured-variable-name]

Length                          at least 1 character, not more than 255 characters

Example

ABCDEFGHIJKLMNO#l
A#l
A123#l
BCD.XYZ

A structure name consists of a partial variable name (pvn) which, if it refers to a list element or an array element, may be followed by a # and an index name.

structured-variable-name := pvn [# [indexname]]

Lengthat least 1 character, not more than 20 characters
Partial variablename (pvn):

Character set

all letters (A, ... Z)
all digits (0, ... 9)
@ and hyphen (-)

First character

a letter

Conventions


The string SYS at the beginning of a variable name is reserved for system variables, and should not be used. A hyphen may not be directly followed by another hyphen. The hyphen must not be the last character of the partial variable name.

Example

AREA-CODE
CLIENT#NUMBER

If the structure name refers to a list element or an array element, it is followed by a # and an index name.

indexname = <integer -2147483648..2147483647> / pvn

Example

TELEPHONE#223366
TELEPHONE#INDEX

Element names

In the case of element names, a distinction must be made between array elements, list elements and structure elements.
The syntax that is described under <composed-variable-name> also applies to element names.

List element names

List element names consist, at the user interface, of the following components:

  • list name (<composed-variable-name 1..253>)

  • #

  • optional: element number (<integer 1..2147483647>)

Array element names

Array element names are made up of the following components:

  • array name (<composed-variable-name 1..253>)

  • # (identifier for array elements when followed by additional characters)

  • array index (<integer -2147483648..2147483647>)

Both the list index and the array index can also be identified by a simple variable that contains an integer value within the range of valid values.

SDF-P analyzes the string that follows the aggregate symbol # in the element name: If the first character is a digit or hyphen (= minus sign), the string is interpreted as an integer value, i.e. as a direct entry of the index.

If the first character is a letter, the string is interpreted as a variable name. SDF-P then searches for a variable with the specified name. This name must refer to a simple variable, which must be initialized with a valid integer value. If this is not the case, an error message is issued. If the variable contains a valid integer value, this value is used in the array index or list index, and the aggregate element thus identified is accessed.

Example 1

ACCOUNT is a simple array. The array index can be specified in the array element name directly:

ACCOUNT#123

However, the array index can also be supplied by means of the variable INDEX:

/INDEX = 236
/SHOW-VAR ACCOUNT#INDEX

The string INDEX is recognized as a variable name and the variable contents are evaluated. Consequently, the SHOW-VARIABLE command outputs the contents of the array element ACCOUNT#236. Note, however, that the array element ACCOUNT#236 must have been declared and initialized previously.

Example 2

The array index entry is always evaluated as an integer value. Thus, the following entries designate the same element of the array ACCOUNT:

ACCOUNT#123
ACCOUNT#0123
ACCOUNT#00123
ACCOUNT#NUMBER

A prerequisite for the ACCOUNT#NUMBER entry is that a variable NUMBER has been declared and initialized with the value 123.

Structure element names

Structure element names are made up of the following components:

  • structure name (<composed-variable-name 1..253>)

  • “.” (identifier for structures)

  • element subname (<structured-variable-name 1..20>)

Example

The following variables are elements of the structure ADDRESS:

ADDRESS.SURNAME
ADDRESS.FORENAME
ADDRESS.TITLE
ADDRESS.STREET