Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

BEGIN-STRUCTURE Declare static structure

&pagelevel(4)&pagelevel

Domain: PROCEDURE

Command description

If a structure layout is declared, BEGIN-STRUCTURE identifies the beginning of the structure layout declaration. The structure layout must be declared before the static structures which are to correspond to it. The declaration of the structure layout is terminated with the END-STRUCTURE command.

If a static structure is declared with *BY-SYSCMD, the BEGIN-STRUCTURE command must directly follow the DECLARE-VARIABLE command in which the structure is declared. In this case, the command initiates the element declarations.

(See section “Variable declaration” for a description of structure declarations.)

Format

BEGIN-STRUCTURE

NAME = *NONE / <structured-name 1..20>(...)

<structured-name 1..20>(...)

SCOPE = CURRENT / PROCEDURE / TASK(...)

TASK(...)

STATE = ANY / *NEW

Operands

NAME =
Identifies the beginning of a structure layout declaration or the beginning of the element declaration of a static structure.

NAME = *NONE
Identifies the beginning of an element declaration for a static structure which was initiated with TYPE = *STRUCTURE(*BY-SYSCMD) in the DECLARE-VARIABLE command.

NAME = <structured-name 1..20>(...)
Name of a structure layout.
NAME can be used in a DECLARE-VARIABLE command with TYPE = *STRUCTURE(DEFINITION = <structured-name 1..20>) to refer to the structure layout. The name specified there for a structure layout must match the name specified here in the NAME operand. In this manner, a structure layout can be unambiguously assigned to the structure.

SCOPE =
Defines the scope of the structure layout.

SCOPE = *CURRENT
In a call procedure, corresponds to the PROCEDURE entry.
In an INCLUDE procedure, CURRENT means that the structure layout is created in the current INCLUDE procedure. The structure layout is then visible in this INCLUDE procedure (and in all INCLUDE procedures on lower nesting levels).
The structure layout disappears at the (dynamic) end of the CALL or INCLUDE procedure.

SCOPE = *PROCEDURE
The structure layout is declared in the current CALL procedure. In an include procedure, the current procedure is always the calling CALL procedure.
The structure layout is visible in the current CALL procedure and in all procedures called with INCLUDE-PROCEDURE from the current CALL procedure. The layout is declared in the current CALL procedure. It is therefore retained until the end of this procedure, even if it was declared in an INCLUDE procedure called from the current CALL procedure.

SCOPE = *TASK(...)
The life of the structure layout is determined by the life of the task. The structure layout is visible in all the procedures in which no other structure with the same name and a different scope (i.e. *CURRENT or *PROCEDURE) has been declared.

STATE = *ANY
If a structure layout of this name already exists in the task, the existing structure layout is used. A new structure layout is not created. In such multiple declarations, the rule is that the structure layout declared here must match the existing layout. If a structure layout with this name does not yet exist in the task, a new structure layout is defined.

STATE = *NEW
The structure layout cannot be present in the task. A new structure layout is declared.

Command return codes

(SC2)

SC1

Maincode

Meaning


0
1
1
3
32
64
130

CMD0001
CMD0202
SDP0118
CMD2203
CMD0221
SDP0091
SDP0099

No error
Syntax error
Command in false context
Incorrect syntax file
System error (internal error)
Semantic error
No further address space available

Example

See the DECLARE-ELEMENT command, "DECLARE-ELEMENT Declare structure element ".