Customizable report programs


This topic describes the DASD MANAGER PLUS report programs and the external functions that the programs call, and provides brief notes on REXX as it applies to the report programs.

This topic illustrates report layout, variables, and SQL using a sample program. The customizable report programs are in the HLQ.CLIST library. (For more information, see Producing-reports.)

Report program structure

DASD MANAGER PLUS customizable report programs share the same basic structure.

Basic report program structure

Define report format
CONNECT to ssid
INIT report
OPEN cursor

DO UNTIL END OF DATA
   FETCH
   WRITE a report line
END

CLOSE cursor

EXIT

Sample report program

The DASD MANAGER PLUS sample program in the following figure is based on one of the report programs.

The adaptation produces the Volume free space report that lists the number of free tracks on DASD volumes that have names beginning with the letters DEV.

To emphasize the basic structure, the sample program does not include error checking, and it shows calls to ASURXRPT and ASURXSQL. The complete report programs include error checking and error reporting.

For more information about the DASD MANAGER PLUS external functions, see the following topics:

Sample REXX report program

01 /* rexx **************************************************************/
02 /* detail-line format definition                                             */
03  format. = ;
04  format.1 =     ' @<<<<<      @>>>>>>>>';
05  format.2 =     ' vl.volid    vl.freetrk';
06  format.3 =     ' . ';               /* end of format definition             */
07 /* top of page format definition                                             */
08  format.top.1 = ' ';
09  format.top.2 = '  @||||||||||||||||||||||||||||||||||| PAGE @<<<<';
10  format.top.3 = ' title                                 rpt.page# ';
11  format.top.4 = ' ';
12  format.top.5 = ' VOLUME       FREE TRK';
13  format.top.6 = ' ------       --------';
14  format.top.7 = ' . ';                          /* end of format definition  */
15  parse upper arg ssid plan volume .            /* obtain  ssid, plan, volume */
16  dmtable = asualias('BMCASU_SVOLUMES');         /* complete the table name   */
17  rc = asurxsql('CONNECT' ssid plan);               /* connect and open plan  */
18  rc = asurxrpt('INIT 66 suppress format');        /*  initialize report      */
20  title = 'FREE TRACKS ON 'volume' VOLUMES';
21 /* obtain volume data                                                        */
22    rc = asurxsql('OPEN ' ,                       /* open cursor              */
23                  'VL CURSOR FOR SELECT  ',
24                  'VOLID ,'              ,
25                  'FREETRK '              ,
26            'FROM ' dmtable 'A '        ,
27            'WHERE VOLID LIKE ''volume'' ' ,
28            '     AND TIMESTMP = (SELECT MAX(TIMESTMP) ' ,
29            '        FROM ' dmtable 'B ',
30            '        WHERE B.VOLID = A.VOLID) ' ,
31            'ORDER BY FREETRK ASC ' ,
32            'FOR FETCH ONLY ');
33    do forever                            /* loop for all volume rows        */
34      rc = asurxsql('FETCH VL');          /* fetch next row                  */
35      if (sqlcode = 100) then do          /* if end of data                  */
36        leave;                            /* leave forever loop              */
37      end                                 /* end if end of data              */
38      rc = asurxrpt('WRITE format');        /* output volume data            */
39    end                                   /* end do forever                  */
40    rc = asurxsql('CLOSE VL');            /* close cursor                    */
41  exit 0;

Sample Report

The following report is produced from the sample report program. The report programs use the data in the DASD MANAGER PLUS historical database, for example, from ATSV nn.RS_VOLUMES. However, you can also specify input from the Db2 catalog or your own databases.

Volume free space report

      FREE TRACKS ON DEV% VOLUMES      PAGE   1

 VOLUME       FREE TRK
 ------       --------
 DEV115             31
 DEV100            106
 DEVS91            165
 DEV055            436
 DEV020            782
 DEVS92            794
 DEV070            919
 DEV075            956
 DEV060           1059
 DEV095           1118
 DEV320           1223
 DEV035           1244

The input that created the report requires the following input parameters:

ssid plan volume

The example uses the following values for the input parameters: DBDA ASU620DC DEV%. See also Report-dependent variables.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*