Dear fellow listers,
In the last few weeks I've posted 2 or 3 versions of a command file that
report which volume set each MPE group resides. The attached version has
been expanded to allow wildcard characters in the MPE account specification,
allow the specification of 'posix' directories and also include in its
reporting any existing 'posix' directories.
Enjoy it!!
Paul H. Christidis
--------------------<Start Cut
parm select ="?" entry='MaIn'
#
# Command file: Showvol 1998/03/24
# Author: Paul H. Christidis
# Remarks: Shows the Volume Set and Sectors used for each
# MPE account, group or posix directory.
#
if "!entry" = "ReAdIt" then
setvar mpexfinfoany 1
setvar _sv_eof finfo(HPSTDIN,"eof")
if _sv_wild then
setvar _sv_eof _sv_eof - 1
endif
setvar _sv_count 0
setvar _sv_acthold ''
setvar _sv_dlen 26
echo !_sv_clear
echo Sectors Account/Group | Directory Volume Set
echo ------- ------------------------- ----------
while setvar(_sv_eof, _sv_eof - 1) >= 0 do
input _sv_text
setvar _sv_slpos POS("/",_sv_text)
if _sv_slpos <> 0 then
setvar _sv_text RTRIM(_sv_text)
setvar _sv_sectors LFT(_sv_text,10)
setvar _sv_slpos POS("/",_sv_text)
setvar _sv_directory &
STR(_sv_text,_sv_slpos,LEN(_sv_text) - _sv_slpos + 1)
setvar _sv_volume finfo(_sv_directory,35)
setvar _sv_acct _sv_directory - "/"
setvar _sv_acct STR(_sv_acct,1,(POS("/",_sv_acct) - 1))
if _sv_count = 0 then
setvar _sv_acthold _sv_acct
endif
if _sv_acct <> _sv_acthold then
echo
setvar _sv_acthold _sv_acct
endif
if LEN(_sv_directory) <= _sv_dlen then
setvar _sv_gaplen _sv_dlen - LEN(_sv_directory)
echo !_sv_sectors !_sv_directory ![RPT(" ",_sv_gaplen)] &
!_sv_volume
else
echo !_sv_sectors !_sv_directory
echo ![RPT(" ",38)] !_sv_volume
endif
setvar _sv_count _sv_count + 1
endif
endwhile
if _sv_count = 0 then
echo *** No directories qualified ***
endif
deletevar mpexfinfoany
return
else
setvar _sv_bell CHR(7)
if LFT("!select",1) <> "/" then
setvar _sv_select "/" + ups("!select") + "/"
else
setvar _sv_select "!select"
endif
setvar _sv_wild POS("@",_sv_select) <> 0 OR &
POS("#",_sv_select) <> 0 OR POS("?",_sv_select) <> 0
if _sv_select = "/?/" then
echo Usage: !_sv_bell
echo ![finfo(hpfile,"fname")] [ {Acctname, /posixdir } ]
echo
echo Acctname - A Valid MPE account name the input will be
echo upshifted.
echo
echo /posixdir - if the input start with a '/' the command
echo assumes we are dealing with a posix directory.
echo The input is *not* upshifted.
echo
echo NOTE: The sectors reported correspond to the entire directory
echo and thus there maybe some duplication.
return
endif
echo (PHC) Account/Volume Set mapping V98.03.23 !hpdatef, !hptimef
echo
setvar _sv_clear chr(27)+"&a0c-1R"+chr(27)+"J"+chr(27)+"&a0c-1R"
purge xsvfilex,temp > $null
file xsvfilex;rec=-80,,f,ascii;disc=100000;temp
echo !_sv_bell Getting directory names....
setjcw cierror 0
continue
diskuse !_sv_select > *xsvfilex
if cierror = 0 then
xeq !hpfile _sv_select ;entry="ReAdIt" < xsvfilex
else
echo
echo !_sv_bell **Error: Account "!select" is Invalid...
endif
reset xsvfilex
endif
if bound(traceon) then
showvar _sv@
else
deletevar _sv@
endif
------------------<End Cut
|