© gilbertsaint-flour@newsgroup

Dieses Programm wird aus dem DS-List-Panel (3.4) aufgerufen und liefert interessante Informationen über die Dateizuweisungen.

/* rexx
   additional infos at bottom
*/
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           TLDDTAP  */
dtb    = PTR(dta+016)           /* DTB address           DTADTB   */
IF dtb=0 THEN DO
   SAY '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'
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))
/*
Date:    Sat, 19 Apr 1997 14:28:43 -0400
From:    Gilbert Saint-flour 
Subject: Data Set List temp table

This is a sample EXEC (I call it TALLY) that can be invoked from the
Data Set List panel (PDF 3.4) using a simple TSO %TALLY command.  It
calculates (and displays) the total number of tracks allocated by the
data sets for which VTOC info has been previously retrieved.

The traditional method to achieve this result is (1) issue a SAVE
command to create a disk data set then (2) run an EXEC against the saved
list to do the counting.

This EXEC uses a different approach: it retrieves the temporary
in-storage table created by the Data Set List (DSL) function from ISPF's
internal control blocks and processes it using standard table management
functions (e.g. TBxxxxx).  Note that this technique is not documented
and, although it works in ISPF 3.5 through 4.3, it may not work in
future (or prior) releases.  You may use TBQUERY to retrieve the
variable names associated with each row in the table.

The technique used in this EXEC can be used to write all sorts of EXECs,
such as identifying uncatalogued or poorly-blocked data-sets on a pack.
Note that this is a sample EXEC, so error handling is minimal.

I hope some of you find this technique useful.

Gilbert Saint-flour
*/
zurück zu The Power of REXX