Printing DB2 Admin results
if you need to print the results from a DB2 Admin query
Following is the procedure to follow, if you need to print the results from a DB2 Admin query, such as the listing of table spaces, SM function, and so on:
1 - Using TSO option 3.2 create a sequential data set ( let's assume the name is DBADB2.SPACE.REPORT1)
2 - Using TSO option 6 (for commands) enter the following:
ALLOCATE DDNAME( adminout ) DSN(' dbadb2.space.report1 ') old reuse
where:
adminout may be any name
dbadb2.space.report1 is the data set created in step 1
3 - Go to DB2ADMIN
4 - Perform your query. One good example is using the SM function described under the DB2 ADMIN - Space Gatherings
5 - When you get the results you want printed enter the following command in the command line:
> PRINT TABLE ON FILE adminout (note the > before the command)
6 - DB2ADMIN will prompt you to select the columns you want printed, so enter S beside the column list for the columns you want printed
7 - Hit enter and the selected columns will have a '*'
8 - Hit F3 and the data set will contain the results.
Note: you have to allocate (step 2) before you go to DB2ADMIN. Note also that the key is leaving the disp of old on the admin print file and not letting it go back to defaults on the DB2 admin profile