/*--------------------------------------------------------------------*\ |* *| |* MODULE NAME = TALLY *| |* *| |* DESCRIPTIVE NAME = Tallies tracks on DSLIST panel. *| |* *| |* STATUS = R100 *| |* *| |* FUNCTION = Display the total number of tracks used up by the *| |* data sets currently displayed on the Data Set List *| |* panel (ISPF 3.4). Requires that the size information *| |* for all the data sets be previously obtained from the *| |* VTOC, for example with a SORT SIZE command. *| |* *| |* AUTHOR = Gilbert Saint-flour *| |* *| |* DEPENDENCIES = TSO/E V2 *| |* ISPF V3 or V4 *| |* *| |* SYNTAX = TALLY *| |* *| |* Must be issued while on the DSLIST panel, either *| |* as a line command (on any line) or as TSO %TALLY. *| |* *| \*--------------------------------------------------------------------*/ tcb = PTR(540) /* TCB (EXEC command) PSATOLD */ tcb = PTR(tcb+132) /* TCB (ISPTASK) TCBOTC */ fsa = PTR(tcb+112) /* first save area TCBFSA */ r1 = PTR(fsa+24) /* ISPTASK's R1 */ tld = PTR(r1) /* TLD address */ dta = PTR(tld+076) /* DTA address */ dtb = PTR(dta+016) /* DTB address */ IF dtb=0 THEN DO SAY 'Error: Table name could not be located' EXIT 12 END tbl = STORAGE(D2X(dtb+6),8) /* Name of temp table DSL12345 */ ADDRESS 'ISPEXEC' 'CONTROL ERRORS RETURN' 'TBTOP' tbl IF rc>0 THEN DO SAY 'TBTOP failed for table' tbl 'RC='rc EXIT END tally=0;rows=0;processed=0;zusize=0 /* Init counters */ DO FOREVER 'TBSKIP' tbl /* NEXT ROW */ IF rc>0 THEN LEAVE 'TBGET' tbl /* SET VARIABLES */ IF rc>0 THEN LEAVE rows=rows+1 /* count rows */ IF zusize = '' THEN ITERATE /* ignore migrated data sets */ tally=tally+zusize /* tally file size */ processed=processed+1 /* count processed data sets */ END ZMSG000S = tally 'Tracks' ZMSG000L = 'Total Data sets:' rows, ' Data sets processed:' processed, ' Total tracks:' tally "SETMSG MSG(ISPZ000)" EXIT PTR: RETURN C2D(STORAGE(D2X(ARG(1)),4))