The software product SDF-P is a procedural language which enhances the command language of BS2000 into a programming language. Procedures which are created in accordance with the rules of SDF-P are call structured procedures (S procedures). SDF-P offers a variables concept in which both composite variables (S variables) and variable streams (S variable streams) can be processed. Detailed information on SDF-P and on working with S variables is provided in the manuals “ Programming in the Command Language” and “ Commands, Volume 1”.
SESADM supplies outputs in S variables for most SHOW administration statements if the STRUCTURE-OUTPUT
operand (see "Syntax for output in S variables") has a value other than *NONE
. The S variables can be evaluated and processed using SDF-P. This facilitates automatic analysis using SESADM.
Administration statements with output in S variables
SESADM offers output in S variables for the following administration statements:
Administration statement | Application area |
SHOW-CATALOG-USERS | DBH administration |
SHOW-CATID-LIST | DBH administration |
SHOW-DISTRIBUTION-RULE-ENTRIES | DCN administration |
SHOW-INACTIVE-SQL-USERS | DBH administration |
SHOW-MAIL-PARAMETERS | DBH administration |
SHOW-OLD-TABLE-CATALOG-ENTRIES | DBH administration |
SHOW-PARTITIONS | DBH administration |
SHOW-SPACE-USERS | DBH administration |
SHOW-SQL-DB-CATALOG-ENTRIES | DBH administration |
SHOW-TRANSACTIONS | DBH and DCN administration |
SHOW-USERS | DBH and DCN administration |
SHOW-USER-SPACES | DBH administration |
Table 14: Administration statements with output in S variables
Output in S variables is a component part of each command description. The structure and content of the S variables are listed in tabular form after the command descriptions, specifying the name, meaning and content.
The structure of the S variables is predefined for each statement and is guaranteed for subsequent versions, i.e. it will not be changed in a way that makes it incompatible.
Name components of the S variables
The names of the list elements (e.g. CATID
) are predefined for each information command. They follow the S variable name declared by the user. The names are based as far as possible on the corresponding output names. If the information at this level is structured further in a hierarchy, further names will follow, separated by a period.
Content of the S variables
The content of the S variables matches the corresponding output values. The data type of the SESADM S variables is always <string>
, i.e. a string is output.
Working with S variables in SESADM
Output in S variables takes place in addition to the normal output if the STRUCTURE-OUTPUT
operand is not specified as *NONE
. However, no separator or header lines are output in S variables.
The STRUCTURE-OUTPUT
operand (see "Syntax for output in S variables") controls the output in S variables:
STRUCTURE-OUTPUT=*NONE
supplies no output in S variablesSTRUCTURE-OUTPUT=<name of the S variable>(WRITE-MODE=*REPLACE/*EXTEND)
supplies output in the specified S variable. Beforehand the S variable must be declared as a dynamic, structured list variable in the S procedure. The S variable can be overwritten (*REPLACE
) or extended (*EXTEND
). See the example on "Structured output in S variables".STUCTURE-OUTPUT=*SYSINF
supplies output to the variable stream SYSINF to which an S variable is assigned by means of ASSIGN-STREAM. The S variable is updated. The content can be deleted using the SDF-P commandFREE-VARIABLE
. See the example on "Structured output in S variables".
In the case of structured output in S variables, each of the current items of information is stored as the content of an S variable. Independently of the layout of the screen or list output the user accesses the required item of information in the information command via the names and structure identifiers of the S variables.
It is recommendable to use different S variables for different administration statements as the structure elements generated are dependent on the statement.
Example
In the example below the entries of the SQL directories of two DBHs of a configuration are written and output in an S variable:
/DECLARE-VARIABLE - / VARIABLE-NAME=ADMVAR(TYPE=*STRUCTURE(DEFINITION=*DYNAMIC)), - / MULTIPLE-ELEMENTS=*LIST 1. /START-SESAM-ADMINISTRATION 2. //START-DBH-ADMINISTRATION PASSWORD=C'ADM',DBH-NAME=W 3. //SHOW-SQL-DB-CATALOG-ENTRIES SELECT=*ALL, - // STRUCTURE-OUTPUT=ADMVAR(WRITE-MODE=*REPLACE) 4. <catalog-name> | Copy-|Class| UserID | Status | Info <physical-name> | Nr | | | | --------------------------------------------------------------- DCCAT | |ADMIN| SQLDB112 | ACTIVE | WIE | | | | | VIRST | |ADMIN| SQLDB112 | ACTIVE | WIE.FIRST | | | | | % <date> <time> SES7215 END OF OUTPUT //START-DBH-ADMINISTRATION PASSWORD=C'ADM',DBH-NAME=V 5. //SHOW-SQL-DB-CATALOG-ENTRIES SELECT=*ALL, - // STRUCTURE-OUTPUT=ADMVAR(WRITE-MODE=*EXTEND) 6. <catalog-name> | Copy-|Class| UserID | Status | Info <physical-name> | Nr | | | | --------------------------------------------------------------- DCCAT | |ADMIN| SQLDB112 | ACTIVE | WIE | | | | | SECON | |ADMIN| SQLDB112 | ACTIVE | WIE.SEC | | | | | % <date> <time> SES7215 END OF OUTPUT //END 7. Continued on the next page
The composite structured S variable ADMVAR of the type list is created.
SESADM is started.
The administration of DBH W is started.
Statement for outputting the DBHs’ SQL directories. The S variable
ADMVAR
is overwritten (*REPLACE
, default value). The output on SYSLST follows.The administration of DBH V is started.
Statement for outputting the DBHs’ SQL directories. The S variable
ADMVAR
is update (*EXTEND
). The output on SYSLST follows.The administration with SESADM is terminated.
/SHOW-VARIABLE VAR-NAME=ADMVAR, - / INFORMATION=*PARAMETER(LIST-INDEX-NUMBER=*YES) 8. (OUT) ADMVAR#1.CATALOG = DCCAT (OUT) ADMVAR#1.ACCESS-MODE = ADMIN (OUT) ADMVAR#1.USERID = SQLDB112 (OUT) ADMVAR#1.STATE = ACTIVE (OUT) ADMVAR#1.INFORMATION = (OUT) ADMVAR#1.PHYSICAL-NAME = WIE (OUT) ADMVAR#1.COPY-NUMBER = (OUT) ADMVAR#2.CATALOG = VIRST (OUT) ADMVAR#2.ACCESS-MODE = ADMIN (OUT) ADMVAR#2.USERID = SQLDB112 (OUT) ADMVAR#2.STATE = ACTIVE (OUT) ADMVAR#2.INFORMATION = (OUT) ADMVAR#2.PHYSICAL-NAME = WIE.FIRST (OUT) ADMVAR#2.COPY-NUMBER = (OUT) ADMVAR#3.CATALOG = DCCAT (OUT) ADMVAR#3.ACCESS-MODE = ADMIN (OUT) ADMVAR#3.USERID = SQLDB112 (OUT) ADMVAR#3.STATE = ACTIVE (OUT) ADMVAR#3.INFORMATION = (OUT) ADMVAR#3.PHYSICAL-NAME = WIE (OUT) ADMVAR#3.COPY-NUMBER = (OUT) ADMVAR#4.CATALOG = SECON (OUT) ADMVAR#4.ACCESS-MODE = ADMIN (OUT) ADMVAR#4.USERID = SQLDB112 (OUT) ADMVAR#4.STATE = ACTIVE (OUT) ADMVAR#4.INFORMATION = (OUT) ADMVAR#4.PHYSICAL-NAME = WIE.SEC (OUT) ADMVAR#4.COPY-NUMBER =
The content of the S variable
ADMVAR
is output.In the case of the list elements, the element number is appended to the name instead of(*LIST)
.
When the variable stream SYSINF is used, the corresponding statements are:
/DECLARE-VARIABLE - / VARIABLE-NAME=ADMVAR(TYPE=*STRUCTURE(DEFINITION=*DYNAMIC)), - / MULTIPLE-ELEMENTS=*LIST /ASSIGN-STREAM STREAM-NAME=SYSINF,TO=*VARIABLE(VARIABLE-NAME=ADMVAR) 1. /START-SESAM-ADMINISTRATION //START-DBH-ADMINISTRATION PASSWORD=C'ADM',DBH-NAME=W //SHOW-SQL-DB-CATALOG-ENTRIES SELECT=*ALL,STRUCTURE-OUTPUT=*SYSINF 2. //START-DBH-ADMINISTRATION PASSWORD=C'ADM',DBH-NAME=V //SHOW-SQL-DB-CATALOG-ENTRIES SELECT=*ALL,STRUCTURE-OUTPUT=*SYSINF //END /SHOW-VARIABLE VAR-NAME=ADMVAR, - // INFORMATION=*PARAMETER(LIST-INDEX-NUMBER=*YES)
The ASSIGN-STREAM command assigns an S variable stream for structured outputs to an (output) server which controls further processing of the variable stream. The server’s output is the S variable.
The output is directed to the S variable stream SYSINF and consequently to the S variable.
Special cases
If no output information is present, the content of the S variable concerned is deleted if WRITE-MODE=*REPLACE
for WRITE-MODE=*EXTEND
, it remains unchanged.
If output information is present but cannot be written in the S variable, a message to this effect (SEA7032
, SEA7033
) is issued. These message numbers are also noted in the S variable SESADM-RESULT, see section “Result of the administration statements”.