CREATE OBJECTSET syntax and option descriptions (PTF BPJ1993 applied)
The SCCBSET syntax and option descriptions in this section are the control statements that SCCIN input uses.
SCCBSET syntax for building an object set based on catalog search (indexes, user-defined SQL, table name, or table spaces) is shown in the following sections.
For information about syntax rules and wildcard support, see SCCIN DD syntax rules (PTF BPJ1993 applied).
Syntax for creating object sets: Catalog search method
Use the syntax in the following diagram to create groups based on catalog search (indexes, user-defined SQL, table name, or table spaces):
SCCBSET—CREATE OBJECTSET
For details about the catalog search command options, see CREATE OBJECTSET option descriptions (catalog search).
The following diagrams provide details about the control statements:
SCCBSET—CREATE OBJECTSET—table space and table options
For details about the options, see INCLUDE TABLESPACE and TABLE.
SCCBSET Control Statement—CREATE OBJECTSET—SQL options
For details about the options, see INCLUDE SQL.
SCCBSET Control Statement—CREATE OBJECTSET—index options
For details about the options, see INCLUDE INDEX.
SCCBSET Control Statement—CREATE OBJECTSET—index space options
For details about the options, see INCLUDE INDEXSPACE.
SCCBSET Control Statement—CREATE OBJECTSET—package options
For details about the options, see INCLUDE PACKAGE.
SCCBSET Control Statement—CREATE OBJECTSET—plan options
For details about the options, see INCLUDE PLAN.
SCCBSET Control Statement—CREATE OBJECTSET—stogroup options
For details about the options, see INCLUDE STOGROUP.
SCCBSET Control Statement—CREATE OBJECTSET—object set options
For details about the options, see INCLUDE OBJECTSET.
CREATE OBJECTSET option descriptions (catalog search)
This section contains descriptions of the options that you can use with the catalog search method of the CREATE OBJECTSET command.
CREATE OBJECTSET
The CREATE OBJECTSET control statement is required when you create an object set based on the catalog search method.
You can repeat the CREATE OBJECTSET statement for as many object sets as you want to create, using the format creator.name.
To view the syntax diagram, see SCCBSET—CREATE OBJECTSET
Option | Description |
---|---|
DESCRIPTION (optional) | You can add a description of the object set. The description can be up to 60 characters long and you must enclose it in double quotation marks ( " " ). |
REPLACE | Set REPLACE YES to automatically update an existing object set when object changes are detected. The default value is NO. You can add objects to existing object sets by using REPLACE YES with the LIKE syntax and RETAIN OBJECTS YES. For more information, see Adding new objects to existing object sets using RETAIN OBJECTS YES. |
LIKE | LIKE copies an existing object set. You can copy all utility options and objects to the new object set that you are creating. Observe the following rules for the option:
|
RETAIN OBJECTS | The RETAIN OBJECTS option is valid in conjunction with the LIKE statement. Use one of the following values:
You can also add objects to existing object sets by using REPLACE YES with the LIKE syntax and RETAIN OBJECTS YES. For more information, see Adding new objects to existing object sets using RETAIN OBJECTS YES. |
Adding new objects to existing object sets using RETAIN OBJECTS YES
You can create the object set with the same object set name using the LIKE syntax, and then add new objects using the INCLUDE syntax. Using REPLACE YES with LIKE and RETAIN OBJECTS YES adds objects to the existing object set.
RETAIN OBJECTS YES option descriptions
RETAIN OBJECTS YES retains all of the objects and object definitions from the existing object set in the new object set.
When you copy object sets, you can also rename or delete some specifications as a batch operation in the new object set by using the following options:
- RENAME_SPEC
- DELETE_SPEC
Renaming specifications as a batch operation
Use the following format to rename specifications as a batch operation:
RENAME_SPEC Value oldName TO newName
The code renames the specification Value from oldName to newName. The old name must precisely match the name of the specification you want to rename. The following specification values are supported for renaming:
Specification value | Description |
---|---|
DBNAME | Renames the value of the database name of the specification types TS and IS |
TSNAME | Renames the value of the table space name of the specification type TS |
IXSPACE | Renames the value of the index space name of the specification type IS |
IXCREATOR | Renames the value of the index creator of the specification type IX |
IXNAME | Renames the value of the index name of the specification type IX |
TBCREATOR | Renames the value of the table creator of the specification type TB |
TBNAME | Renames the value of the table name of the specification type TB |
Sample of changing object set specifications when copying an object set
The following code changes any table creator named XXX of specification type TB to YYY, and renames any table name TB01* of specification type TB to TB02:
RETAIN OBJECTS YES
RENAME_SPEC TBCREATOR XXX TO YYY
RENAME_SPEC TBNAME TB01* TO TB02
In the following example, specifications are renamed, and the object set is processed:
CREATE OBJECTSET RMDQA.RNMEXMPL
REPLACE YES LIKE RMDQA.RNMEXMPL
RETAIN OBJECTS YES
RENAME_SPEC DBNAME * TO RNMDB*
RENAME_SPEC DBNAME RMDDB45 TO RNMDB45
RENAME_SPEC TSNAME TS47P021 TO RNMTS47
RENAME_SPEC IXCREATOR RMD TO RNMIXCR
RENAME_SPEC IXNAME IC45P021 TO RNMIXNM
;
BMC80591I PROCESSING OBJECTSET RMDQA.RNMEXMPL
BMC80799I SPEC RENAME TOTALS = 6
BMC80540I OBJECTSET SAVED THE OBJECTSET WAS SAVED SUCCESSFULLY
BMC80570I COMMAND COMPLETE RC = 0
Deleting specifications as a batch operation
Use the following format to delete specifications as a batch operation:
DELETE_SPEC Value specName
The code removes the specification Value with the name specName from the object set. The specification name must precisely match the name of the specification you want to remove. The following specification values are supported for deleting:
Specification value | Description |
---|---|
TABLESPACE | Removes the matching specification of the type TS from the object set |
INDEXSPACE | Removes the matching specification of the type IS from the object set |
TABLE | Removes the matching specification of the type TB from the object set |
INDEX | Removes the matching specification of the type IX from the object set |
Sample of deleting an object set specification when copying an object set
The following code deletes any table space specification DB01.TS01* of the specification type TS:
RETAIN OBJECTS YES
DELETE_SPEC
INCLUDE TABLESPACE DB01.TS01*
In the following example, specifications are deleted, and the object set is processed:
CREATE OBJECTSET RMDQA.DELEXMPL
REPLACE YES LIKE RMDQA.DELEXMPL
RETAIN OBJECTS YES
DELETE_SPEC
INCLUDE TABLESPACE RMDDB*.*
;
BMC80591I PROCESSING OBJECTSET RMDQA.DELEXMPL
BMC80799I SPEC DELETE TOTALS = 1
BMC80540I OBJECTSET SAVED THE OBJECTSET WAS SAVED SUCCESSFULLY
BMC80570I COMMAND COMPLETE RC = 0
INCLUDE TABLESPACE and TABLE
Use the INCLUDE TABLESPACE and INCLUDE TABLE options to create object sets by table spaces or tables:
- Use INCLUDE TABLESPACE to create an object set by table space by including any number of table space names or wildcard patterns.
The syntax for the table space name is databaseName.tableSpaceName[.owner], where .owner is optional. - Use INCLUDE TABLE to create an object set by table name by including any number of table names or wildcard patterns.
The syntax for the table name is creator.tableName.
To view the syntax diagram, see SCCBSET—CREATE OBJECTSET—table space and table options.
Option | Description |
---|---|
LIKE | When used in conjunction with INCLUDE INDEX, the LIKE option builds an object set using the name pattern that you specified for tables or table spaces. The attributes, utility options, and objects of the existing object set are copied to the new object set that you are creating. You can code the LIKE parameter before or after the INCLUDE TABLESPACE option.Observe the following rules for the option:
|
RETAIN OBJECTS | The RETAIN OBJECTS option is valid in conjunction with the LIKE statement. Use one of the following values:
|
BYPART | Use BYPART to add tables spaces to the object set by partition. The option is only valid with partitioned table spaces. |
DSNUM | Use DSNUM with INCLUDE TABLESPACE to include a specified table space by partition. You cannot use DSNUM with the BYPART option. Use one of the following values:
Tip We recommend that you use DSNUM ALL with PBG table spaces, when the number of partitions can change. |
EXCLUDEPARTS | Use EXCLUDEPARTS to exclude partitions when you create an object set by partition using the BYPART YES option. This option is only valid with BYPART YES. You must specify the EXCLUDEPARTS parameter before the EXCLUDE table space parameter. The value of the EXCLUDEPARTS parameter remains in effect for all subsequent EXCLUDE parameters until you specify a new EXCLUDEPARTS value. EXCLUDEPARTS replaces the EXCLUDEALLPARTS parameter. Important You cannot use EXCLUDEPARTS for object sets built with INCLUDE TABLE syntax. Use one of the following values:
|
EXCLUDE | Enter a table space name (or wildcard pattern) to exclude those spaces from the object set when you use INCLUDE TABLESPACE. The syntax for the table space name is databaseName.tableSpaceName[. owner], where owner is optional. Use EXCLUDE in conjunction with EXCLUDEPARTS to exclude specific partitions from the table spaces in the object set. When you use INCLUDE TABLE syntax, you can also use exclude with tableName. Enter the table name or table name list to exclude tables from the object set. |
EXCLUDE DSNUM | Use EXCLUDE DSNUM with INCLUDE TABLESPACE to exclude a specified table space by partition. You cannot use EXCLUDE DSNUM with the BYPART option. Use one of the following values:
|
EXCLUDEIX | Use EXCLUDEIX with INCLUDE TABLESPACE to exclude the specified indexes from the object set. |
INCLUDERI | Use INCLUDERI to include all table spaces associated by referential integrity in the object set. |
INCLUDEIX | Use INCLUDEIX to include all associated indexes in the object set. |
INCLUDELOB | Use INCLUDELOB to add all table spaces that are associated by LOB columns with the objects in the object set. Doing so ensures that both the base table space and LOB table space are included in the object set. |
INCLUDEXML | Use INCLUDEXML to add all table spaces that are associated by XML columns with the objects in the object set. Doing so ensures that all XML-related objects are included in the object set and will be processed together. |
INCLUDEHISTORY | Use INCLUDEHISTORY for DB2 Version 10 and later to add all of the objects that are associated by a history (versioning) relationship to those specified in the object set. The objects are also referred to as temporal objects and history objects. |
INCLUDEARCHIVE | Use INCLUDEARCHIVE for DB2 Version 11 and later to add all of the objects that are associated by an archive relationship to those specified in the object set. |
INCLUDE SQL
Use the INCLUDE SQL option to specify objects by using a user-defined SQL SELECT statement, delimited by #BEGINSQL
and #ENDSQL
. You can use multiple INCLUDE SQL statements with multiple SQL syntax in the same CREATE OBJECTSET syntax, as shown in the following example:
//SCCIN DD *
CREATE OBJECTSET RDAJTR.BY_SQL01
REPLACE YES
DESCRIPTION "SQL BY BATCH"
INCLUDE SQL
#BEGINSQL
SELECT 'TS', DBNAME, NAME
FROM SYSIBM.SYSTABLESPACE
WHERE DBNAME = 'SCCDBJTR'
#ENDSQL
INCLUDERI NO
INCLUDEIX NO
INCLUDELOB NO
INCLUDE SQL
#BEGINSQL
SELECT 'TS', DBNAME, NAME
FROM SYSIBM.SYSTABLESPACE
WHERE DBNAME = 'SCCDBLOB'
#ENDSQL
INCLUDERI NO
INCLUDEIX YES
INCLUDELOB YES
...
...
...
/*
To view the syntax diagram, see SCCBSET Control Statement—CREATE OBJECTSET—SQL options.
Option | Description |
---|---|
LIKE | When used in conjunction with INCLUDE INDEX, the LIKE option builds an object set using the name pattern that you specified. The attributes, utility options, and objects of the existing object set are copied to the new object set that you are creating. You can code the LIKE parameter before or after the INCLUDE SQL option. Observe the following rules for the option:
|
RETAIN OBJECTS | The RETAIN OBJECTS option is valid in conjunction with the LIKE statement. Use one of the following values:
|
#BEGINSQL ... #ENDSQL | Use #BEGINSQL and #ENDSQL to enclose SQL statements within the INCLUDE SQL syntax. SQL must begin with syntax #BEGINSQL and must end with #ENDSQL. |
INCLUDERI | Use INCLUDERI to include all table spaces associated by referential integrity in the object set. |
INCLUDEIX | Use INCLUDEIX to include all associated indexes in the object set. |
INCLUDELOB | Use INCLUDELOB to add all table spaces that are associated by LOB columns with the objects in the object set. Doing so ensures that both the base table space and LOB table space are included in the object set. |
INCLUDEXML | Use INCLUDEXML to add all table spaces that are associated by XML columns with the objects in the object set. Doing so ensures that all XML-related objects are included in the object set and will be processed together. |
INCLUDEHISTORY | Use INCLUDEHISTORY for DB2 Version 10 and later to add all of the objects that are associated by a history (versioning) relationship to those specified in the object set. The objects are also referred to as temporal objects and history objects. |
You can also add user-defined SQL by using the SCCSQL DD statement.
INCLUDE INDEX
When you create an object set by index, you can include any number of index names or wildcard patterns.
To view the syntax diagram, see SCCBSET Control Statement—CREATE OBJECTSET—index options.
Option | Description |
---|---|
LIKE | When used in conjunction with INCLUDE INDEX, the LIKE option builds an object set using the name pattern that you specified for indexes or index names. The attributes, utility options, and objects of the existing object set are copied to the new object set that you are creating. You can code the LIKE parameter before or after the INCLUDE INDEX option. Observe the following rules for the option:
|
RETAIN OBJECTS | The RETAIN OBJECTS option is valid in conjunction with the LIKE statement. Use one of the following values:
|
BYPART | Use BYPART to add indexes to the object set by partition. The option is only valid with partitioned index spaces. |
DSNUM | Use DSNUM with INCLUDE TABLESPACE to include a specified table space by partition. You cannot use DSNUM with the BYPART option. Use one of the following values:
Tip We recommend that you use DSNUM ALL with PBG table spaces, when the number of partitions can change. |
EXCLUDEPARTS | Use EXCLUDEPARTS to exclude partitions when you create an object set by partition (using the BYPART YES option). See CREATE OBJECTSET for more information. |
EXCLUDE | Enter index space names or wildcards patterns to exclude those spaces from the object set. Use EXCLUDE in conjunction with EXCLUDEPARTS to exclude specific partitions from the object set. |
EXCLUDE DSNUM | Use EXCLUDE DSNUM with INCLUDE TABLESPACE to exclude a specified table space by partition. You cannot use EXCLUDE DSNUM with the BYPART option. Use one of the following values:
|
INCLUDE INDEXSPACE
When you create an object set by index space, you can include any number of index space names or wildcard patterns.
The syntax for the index space name is creator.indexSpaceName.
To view the syntax diagram, see SCCBSET Control Statement—CREATE OBJECTSET—index space options.
Option | Description |
---|---|
BYPART | Use BYPART to add index spaces to the object set by partition. The option is only valid with partitioned index spaces. |
DSNUM | Use DSNUM with INCLUDE TABLESPACE to include a specified table space by partition. You cannot use DSNUM with the BYPART option. Use one of the following values:
Tip We recommend that you use DSNUM ALL with PBG table spaces, when the number of partitions can change. |
EXCLUDE | Enter the package name to exclude those spaces from the object set |
EXCLUDE DSNUM | Use EXCLUDE DSNUM with INCLUDE TABLESPACE to exclude a specified table space by partition. You cannot use EXCLUDE DSNUM with the BYPART option. Use one of the following values:
|
INCLUDERI | Use INCLUDERI to include all objects associated by referential integrity in the object set. |
INCLUDEIX | Use INCLUDEIX to include all associated indexes in the object set. |
INCLUDELOB | Use INCLUDELOB to add all objects that are associated by LOB columns with the objects in the object set. Doing so ensures that both the base table space and the LOB table space are included in the object set. |
INCLUDEXML | Use INCLUDEXML to add all objects that are associated by XML columns with the objects in the object set. Doing so ensures that all XML-related objects are included in the object set and will be processed together. |
INCLUDEHISTORY | Use INCLUDEHISTORY for DB2 Version 10 and later to add all of the objects that are associated by a history (versioning) relationship to those specified in the object set. The objects are also referred to as temporal objects and history objects. |
INCLUDE PACKAGE
Use the INCLUDE PACKAGE option to specify creating object sets by package names or patterns.
The syntax for the package name is collid.package.version.
To view the syntax diagram, see SCCBSET Control Statement—CREATE OBJECTSET—package options.
Option | Description |
---|---|
BYPART | Use BYPART to add tables spaces to the object set by partition. The option is only valid with partitioned table spaces. |
EXCLUDE | Enter the package name to exclude those spaces from the object set. |
INCLUDERI | Use INCLUDERI to include all objects associated by referential integrity in the object set. |
INCLUDEIX | Use INCLUDEIX to include all associated indexes in the object set. |
INCLUDELOB | Use INCLUDELOB to add all objects that are associated by LOB columns with the objects in the object set. Doing so ensures that both the base table space and the LOB table space are included in the object set. |
INCLUDEXML | Use INCLUDEXML to add all objects that are associated by XML columns with the objects in the object set. Doing so ensures that all XML-related objects are included in the object set and will be processed together. |
INCLUDEHISTORY | Use INCLUDEHISTORY for DB2 Version 10 and later to add all of the objects that are associated by a history (versioning) relationship to those specified in the object set. The objects are also referred to as temporal objects and history objects. |
INCLUDE PLAN
Use the INCLUDE PLAN option to specify creating object sets by plan names or patterns.
To view the syntax diagram, see SCCBSET Control Statement—CREATE OBJECTSET—plan options.
Option | Description |
---|---|
EXCLUDE | Enter the plan name to exclude those spaces from the object set. |
BYPART | Use BYPART to add tables spaces to the object set by partition. The option is only valid with partitioned table spaces. |
INCLUDERI | Use INCLUDERI to include all objects associated by referential integrity in the object set. |
INCLUDEIX | Use INCLUDEIX to include all associated indexes in the object set. |
INCLUDELOB | Use INCLUDELOB to add all objects that are associated by LOB columns with the objects in the object set. Doing so ensures that both the base table space and the LOB table space are included in the object set. |
INCLUDEXML | Use INCLUDEXML to add all objects that are associated by XML columns with the objects in the object set. Doing so ensures that all XML-related objects are included in the object set and will be processed together. |
INCLUDEHISTORY | Use INCLUDEHISTORY for DB2 Version 10 and later to add all of the objects that are associated by a history (versioning) relationship to those specified in the object set. The objects are also referred to as temporal objects and history objects. |
INCLUDE STOGROUP
Use the INCLUDE STOGROUP option to specify creating object sets by storage object set names or patterns.
To view the syntax diagram, see SCCBSET Control Statement—CREATE OBJECTSET—stogroup options
Following is sample JCL:
CREATE OBJECTSET RDAJTR.BY_STG1
REPLACE YES
DESCRIPTION "CREATE BY STORGOUP"
INCLUDE STOGROUP
JTR*
EXCLUDE
JTRXBMFC
INCLUDERI YES
INCLUDEIX YES
INCLUDELOB YES
INCLUDEXML YES
INCLUDEHISTORY YES
BYPART NO
;
Option | Description |
---|---|
BYPART | Use BYPART to add objects to the object set by partition. The option is only valid with partitioned table spaces. |
EXCLUDE | Enter storage object set name or pattern to exclude those spaces from the object set. |
INCLUDERI | Use INCLUDERI to include all objects associated by referential integrity in the object set. |
INCLUDEIX | Use INCLUDEIX to include all associated indexes in the object set. |
INCLUDELOB | Use INCLUDELOB to add all objects that are associated by LOB columns with the objects in the object set. Doing so ensures that both the base table space and the LOB table space are included in the object set. |
INCLUDEXML | Use INCLUDEXML to add all objects that are associated by XML columns with the objects in the object set. Doing so ensures that all XML-related objects are included in the object set and will be processed together. |
INCLUDEHISTORY | Use INCLUDEHISTORY for DB2 Version 10 and later to add all of the objects that are associated by a history (versioning) relationship to those specified in the object set. The objects are also referred to as temporal objects and history objects. |
INCLUDE OBJECTSET
When you create an object set from another object set or object sets, you can include any number of object set names or wildcard patterns.
Important
SCCBSET restricts the name change of any object set with an object set definition to avoid calling itself or getting into a loop. This is validated when creating object sets.
To view the syntax diagram, see SCCBSET Control Statement—CREATE OBJECTSET—object set options.
Following is an example of INCLUDE OBJECTSET syntax:
CREATE OBJECTSET RDAJTR.BY_GRP20
REPLACE YES
DESCRIPTION "TEST BSET BY OBJECTSET"
INCLUDE
OBJECTSET
'RDAJTR'.'BY_TS*'
EXCLUDEOBJECTSET
'RDAJTR'.'BY_TSXX'
Option | Description |
---|---|
EXCLUDEOBJECTSET | Enter an object set name or pattern to exclude those object sets from the new object set. |
Comments
Log in or register to comment.