Examples of DSNADMSB invocation

Use the DSNADMSB invocation examples as models for generating your own DSNADMSB output.

Example: Collecting data from a PLAN_TABLE

Suppose that you want DSNADMSB to retrieve data from plan table SYSADM.PLAN_TABLE rows for which PROGNAME is APROGRAM and 1<=QUERYNO<=12345. You want DSNADMSB to create the output in data sets whose names and characteristics you specify. The parameter values that you specify are:

Parameter Value Explanation
table-creator SYSADM These two parameters direct DSNADMSB to collect data from SYSADM.PLAN_TABLE.
table-name PLAN_TABLE
catalog-creator DEFAULT For catalog queries, directs DSNADMSB to use the default catalog table qualifier of SYSIBM.
plan-info APROGRAM-1-12345 Directs DSNADMSB to collect data only for rows for which PROGNAME is 'APROGRAM' and QUERYNO is between 1 and 12345, inclusive.
collect-ddl Y Directs DSNADMSB to collect the data definition statements that created SYSADM.PLAN_TABLE and associated objects.
collect-stats Y Directs DSNADBMSB to collect statistics about tables from the Db2 catalog.
collect-colstats N Directs DSNADBMSB not to collect statistics about table columns from the Db2 catalog.
edit-ddl Y Directs DSNADMSB to modify the data definition language statements that it generates so that the data definition language statements can be more easily executed by IBM® Support.
edit-version-mode NONE Directs DSNADMSB not to modify its output to run on a different Db2 version from the version for which the data was collected.
partition-rotation N Directs DSNADMSB not to check partition rotation.
output-method D These two parameters direct DSNADMSB to write data to output data sets that DSNADMSB allocates on volume EDSDMP, with the specified data set names and space allocations.
output-info DDL;SYSADM.DDL.P12345;EDSDMP;TRK;200;200- +SQL;SYSADM.SQL.P12345;EDSDMP;TRK;200;200- +STATS;SYSADM.STATS.P12345;EDSDMP;TRK;200;200- +COLST;DEFAULT;EDSDMP;TRK;50;50-+EXPL;SYSADM.EXPL.P12345;EDSDMP;TRK;200;200- +PARM;SYSADM.PARM.P12345;EDSDMP;TRK;200;200
pmr-info TS123456789 This value is the 9-digit support case ID number for the problem that requires data collection.

The JCL for the step that executes DSNADMSB looks like this:

//DSNADMSB EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)                   
//SYSTSPRT DD  SYSOUT=*                                                
//SYSPRINT DD  SYSOUT=*,DCB=(RECFM=VB,LRECL=4096) 
//SYSUDUMP DD  SYSOUT=*                                                
//SYSTSIN  DD  *                                                       
  DSN SYSTEM(DSN)                                                     
  RUN PROGRAM(DSNADMSB)  PLAN(DSNADMSB)                                
//INPUTP  DD *
SYSADM
PLAN_TABLE
DEFAULT
APROGRAM-1-12345
Y
Y
N
Y
NONE
N
D
DDL;SYSADM.DDL.P12345;EDSDMP;TRK;200;200-
+SQL;SYSADM.SQL.P12345;EDSDMP;TRK;200;200-
+STATS;SYSADM.STATS.P12345;EDSDMP;TRK;200;200-
+COLST;DEFAULT;EDSDMP;TRK;50;50-
+EXPL;SYSADM.EXPL.P12345;EDSDMP;TRK;200;200-
+PARM;SYSADM.PARM.P12345;EDSDMP;TRK;200;200
TS123456789

Example: Collecting data for all rows in a PLAN_TABLE

Suppose that you want DSNADMSB to retrieve data about all rows in a PLAN_TABLE. You want DSNADMSB to generate the names for the output data sets. The generated names are:

  • T12345.S6789.Dyymmdd.Dhhmmss.VXX.COLST
  • T12345.S6789.Dyymmdd.Dhhmmss.VXX.DDL
  • T12345.S6789.Dyymmdd.Dhhmmss.VXX.EXPL
  • T12345.S6789.Dyymmdd.Dhhmmss.VXX.PARM
  • T12345.S6789.Dyymmdd.Dhhmmss.VXX.SQL
  • T12345.S6789.Dyymmdd.Dhhmmss.VXX.STATS

TS123456789 is the case ID number. This number is split across the first two qualifiers. yymmdd and hhmmss are the date and time when DSNADMSB ran.

The parameter values that you specify are:

Parameter Value Explanation
table-creator SYSADM These two parameters direct DSNADMSB to collect data about SYSADM.PLAN_TABLE.
table-name PLAN_TABLE
catalog-creator DEFAULT For catalog queries, directs DSNADMSB to use the default catalog table qualifier of SYSIBM.
plan-info %-0-999999 This parameter tells DSNADMSB to collect data for all rows in SYSADM.PLAN_TABLE by requesting all rows for which PROGNAME='%' and 0<=QUERYNO<=999999.
collect-ddl Y Directs DSNADMSB to collect the data definition statements that created SYSADM.PLAN_TABLE and associated objects.
collect-stats Y Directs DSNADBMSB to collect statistics about tables from the Db2 catalog.
collect-colstats N Directs DSNADBMSB not to collect statistics about table columns from the Db2 catalog.
edit-ddl Y Directs DSNADMSB to modify the data definition language statements that it generates so that the data definition language statements can be more easily executed by IBM Support.
edit-version-mode NONE Directs DSNADMSB not to modify its output to run on a different Db2 version from the version for which the data was collected.
partition-rotation N Directs DSNADMSB not to check partition rotation.
output-method Q Q directs DSNADMSB to write output data to data sets that DSNADMSB creates. All output data sets have a data set qualifier of SYSADM, a primary allocation quantity of 200, and a secondary allocation quantity of 200.
output-info DEFAULT-200-200
pmr-info TS123456789 This value is the 9-digit support case ID number for the problem that requires data collection.

The JCL for the step that executes DSNADMSB looks like this:

//DSNADMSB EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)                   
//SYSTSPRT DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*,DCB=(RECFM=VB,LRECL=4096) 
//SYSUDUMP DD  SYSOUT=*                                                
//SYSTSIN  DD  *                                                       
  DSN SYSTEM(DSN)                                                     
  RUN PROGRAM(DSNADMSB)  PLAN(DSNADMSB)                                
//INPUTP  DD *
SYSADM
PLAN_TABLE
DEFAULT
%-0-999999
Y
Y
N
Y
NONE
N
Q
DEFAULT-200-200
TS123456789

Example: Collecting data using a table list as input

Suppose that you want DSNADMSB to retrieve data about the DSN8D10.EMP table and the DSN8D10.VDEPT view. You want DSNADMSB to send the output to the job stream.

Before you run DSNADMSB, you need to create a Db2 table with a CREATOR and a TABLE column, and insert rows that contain the qualifiers and names of the tables or views for which you want DSNADMSB to collect data. Use SQL statements like these:

CREATE TABLE TL1 (CREATOR VARCHAR(128),   
                  TABLE VARCHAR(128));        
INSERT INTO TL1 VALUES ('DSN8D10','EMP'); 
INSERT INTO TL1 VALUES ('DSN8D10','VDEPT');

The parameter values that you specify are:

Parameter Value Explanation
table-creator SYSADM These two parameters direct DSNADMSB to collect data about the tables whose names are in table SYSADM.LIST_TABLE-TL1.
table-name LIST_TABLE-TL1
catalog-creator DEFAULT For catalog queries, directs DSNADMSB to use the default catalog table qualifier of SYSIBM.
plan-info NONE This value must be NONE, because PLAN_TABLE data is not being collected.
collect-ddl Y Directs DSNADMSB to collect the data definition statements that created SYSADM.PLAN_TABLE and associated objects.
collect-stats Y Directs DSNADBMSB to collect statistics about tables from the Db2 catalog.
collect-colstats N Directs DSNADBMSB not to collect statistics about table columns from the Db2 catalog.
edit-ddl Y Directs DSNADMSB to modify the data definition language statements that it generates so that the data definition language statements can be more easily executed by IBM Support.
edit-version-mode NONE Directs DSNADMSB not to modify its output to run on a different Db2 version from the version for which the data was collected.
partition-rotation N Directs DSNADMSB not to check partition rotation.
output-method R R directs DSNADMSB to write output data to the job stream. When output-method is R, output-info must be NONE.
output-info NONE
pmr-info TS123456789 This value is the 9-digit support case ID number for the problem that requires data collection.

The JCL for the step that executes DSNADMSB looks like this:

//DSNADMSB EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)                   
//SYSTSPRT DD  SYSOUT=*                                                
//SYSPRINT DD  SYSOUT=*,DCB=(RECFM=VB,LRECL=4096) 
//SYSUDUMP DD  SYSOUT=*                                                
//SYSTSIN  DD  *                                                       
  DSN SYSTEM(DSN)                                                     
  RUN PROGRAM(DSNADMSB)  PLAN(DSNADMSB)                                
//INPUTP  DD *
SYSADM             
LIST_TABLE-TL1     
DEFAULT            
NONE               
Y                  
Y                  
N                  
Y                  
NONE               
N                  
R                  
NONE               
TS123456789      

Example: Collecting environment data

Suppose that you want DSNADMSB to retrieve environment data about the ASCHEMA.ATABLE user table. You want DSNADMSB to send the output to the job stream.

The parameter values that you specify are:

Parameter Value Explanation
table-creator ASCHEMA These two parameters direct DSNADMSB to collect data about table ASCHEMA.ANAME.
table-name ATABLE
catalog-creator DEFAULT For catalog queries, directs DSNADMSB to use the default catalog table qualifier of SYSIBM.
plan-info NONE This value must be NONE, because PLAN_TABLE data is not being collected.
collect-ddl Y Directs DSNADMSB to collect the data definition statements that created ASCHEMA.ANAME and associated objects.
collect-stats Y Directs DSNADBMSB to collect statistics about tables from the Db2 catalog.
collect-colstats N Directs DSNADBMSB to collect statistics about table columns from the Db2 catalog.
edit-ddl Y Directs DSNADMSB to modify the data definition language statements that it generates so that the data definition language statements can be more easily executed by IBM Support.
edit-version-mode NONE Directs DSNADMSB not to modify its output to run on a different Db2 version from the version for which the data was collected.
partition-rotation N Directs DSNADMSB not to check partition rotation.
output-method R R directs DSNADMSB to write output data to the job stream. When output-method is R, output-info must be NONE.
output-info NONE
pmr-info TS123456789 This value is the 9-digit support case ID number for the problem that requires data collection.

The JCL for the step that executes DSNADMSB looks like this:

//DSNADMSB EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)                   
//SYSTSPRT DD  SYSOUT=*                                                
//SYSPRINT DD  SYSOUT=*,DCB=(RECFM=VB,LRECL=4096) 
//SYSUDUMP DD  SYSOUT=*                                                
//SYSTSIN  DD  *                                                       
  DSN SYSTEM(DSN)                                                     
  RUN PROGRAM(DSNADMSB)  PLAN(DSNADMSB)                                
//INPUTP  DD *
ASCHEMA
ATABLE
DEFAULT
NONE
Y
Y
N
Y
NONE
N
R
NONE
TS123456789

Collecting data for a table with a long table name with embedded blanks

Suppose that you want to collect the same data as in the previous example for a table with the schema name SYSADM, and the following name, which is 85 bytes long:

A234567891 234567892 234567893 234567894 234567895 234567896 234567897-
 234567898 2345

The record length of the INPUTP data set is 80 bytes, but only the first 71 bytes can contain input data, so you need to split the schema name and table name across input records. You can split the table name after any non-blank character in the record. DSNADMSB trims blanks at the end of each record.

The INPUTP data set might look like this. The table name is split across three records, after positions 50 and 65.

SYSADM
A234567891 234567892 234567893 234567894 234567895
+ 234567896 2345
+67897 234567898 2345
DEFAULT
NONE
Y
Y
N
Y
NONE
N
R
NONE
TS123456789

The first continued line must contain a blank after the plus sign, because the character at position 51 of the table name is a blank. The second continued line must not contain a blank after the plus sign, because the character at position 66 of the table name is not a blank.