Normally, an S variable stream will be assigned to an output destination by means of an ASSIGN-STREAM command. The output destination may be a server or an S variable.
The EXECUTE-CMD command implicitly assigns the S variable stream SYSVAR to an
S variable. This assignment is, however, only temporary and only applies to the specified command.
Assignment using ASSIGN-STREAM
This command has two main operands: STREAM-NAME and TO.
The STREAM-NAME operand
The STREAM-NAME operand is used to specify the name of an S variable stream which is to be assigned. For this purpose, the system provides three predefined S variable streams, each of which begins with the prefix SYS: SYSINF, SYSMSG, SYSVAR. However, a userspecific S variable stream, or one with a user-specific name, may also be specified. The specification of user-defined S variable streams is useful, for instance, if FHS applications are to be used.
The TO operand
The TO operand is used to specify the output destination or the server which is to be linked to the S variable stream. It is possible to make the following specifications:
TO = *STD
This is the default value for the TO operand. The following table shows the operand values to which *STD corresponds, depending on the specification for the STREAM-NAME operand:STREAM-NAME=
TO=*STD
Information transferred
SYSINF
SYSVAR
Structured outputs from commands and programs
SYSMSG
SYSVAR
Structured guaranteed messages
SYSVAR
*DUMMY
Structured outputs from commands and programs, or
structured messages<structured-name 1..20>
*DUMMY
User variable stream
Unless otherwise specified, the variable stream for system output and guaranteed messages is SYSVAR, to which in turn *DUMMY is assigned by default. Thus, SYSOUT and SYSVAR outputs coexist. (If output to SYSOUT is to be suppressed, the assignment ASSIGN-SYSOUT TO-FILE=*DUMMY must be made.)
TO = <structured-name 1..20>
TO = Name of a (user-specific) server.*DUMMY
Specifying *DUMMY means: no assignment.TO = *SAME-AS-CALLING-PROC
Specifying *SAME-AS-CALLING-PROC means: the assignment specified in the calling procedure remains valid.TO = *VARIABLE(...)
Defines the specified S variable as the output destination. This indirectly assigns SDF-P as the server. It is possible to specify control variables for data exchange with the server. All variables specified must be declared as structure-type list variables.The data items will be processed in the following order:TRANSMIT-BY-STREAM
Direction
ASSIGN-STREAM
(1) VARIABLE-NAME ⎯⎯⎯-> VARIABLE-NAME (2) CONTROL-VAR-NAME ⎯⎯⎯-> CONTROL-VAR-NAME (3) RETURN-VARIABLE-NAME <-⎯⎯⎯ RETURN-VARIABLE-NAME (4) RET-CONTROL-VAR-NAME <-⎯⎯⎯ RET-CONTROL-VAR-NAME If an error arises during one of these operations, then this operation - and all subsequent ones - will be terminated. The transmission will then be aborted, with the time of error as the status.
TO = *SERVER(...)
Name of a server, e.g. FHS. Additional information such as name of the FHS format library can be passed to the server.
Notes
Even if the assignment is SYSVAR, the different information for SYSINF and SYSMSG can still be subject to separate subsequent processing.
Any specification of a system file (SYSDTA, SYSCMD, SYSOUT, SYSLST, SYSOPT, SYSIPT) for STREAM-NAME will be rejected.
If the S variables specified in *VARIABLE(...) are incompletely declared at the time of the ASSIGN-STREAM assignment, the assignment will be rejected.
If the variables are incompletely assigned at a point after the ASSIGN-STREAM assignment, e.g. because they have in the meantime been the subject of a DELETE-VARIABLE command, the next transmission will be rejected with a warning, and SDF-P will set the variable stream to *DUMMY.
If the same S variable is assigned to two different variable streams, the data items from the two variable streams will be processed in the order that they are transmitted.
S variables can be changed between two transmissions. The next transmission will take account of this change.
Example
/DECLARE-VARIABLE OPS-VAR(TYPE=*STRUCTURE),MULTIPLE-ELEMENTS=*LIST /ASSIGN-STREAM SYSINF,TO=*VARIABLE(OPS-VAR) /ASSIGN-SYSOUT TO=#ERROR-SYSOUT