1827704 Members
2876 Online
109967 Solutions
New Discussion

Show Dev DSA/rebuild

 
SOLVED
Go to solution
VMS Support
Frequent Advisor

Show Dev DSA/rebuild

Do we have a lexical function (F$GETDVI) for the following yet ? Running VMS 7.3-2.
Maybe a hidden one ?


VLCPR1 $show dev dsa/reb

Device Name Rebuild needed?

DSA0: No
DSA2: No
DSA3: No
DSA4: No
DSA5: No
DSA6: No
DSA7: No
DSA999: No
VLCPR1 $
3 REPLIES 3
Karl Rohwedder
Honored Contributor
Solution

Re: Show Dev DSA/rebuild

We use the following code snipped since eons:
$If F$Getdvi("''DISK'","SWL") Then $ Exit 1
$Open/Read/Error=CheckRebuild$99 'InLun
- 'Disk':[000000]Bitmap.Sys
$Read/Error=CheckRebuild$99 'InLun Scb
$Close/Error=CheckRebuild$99/NoLog 'InLun'
$Bits=F$cvui(28*8+1,2,scb)
$If Bits .Ne. 0
$ then rebuild isneeded...

regards Kalle
Robert Brooks_1
Honored Contributor

Re: Show Dev DSA/rebuild

It is likely that there will never be a $GETDVI item code to determine whether or not a rebuild of the volume is needed.

In order to determine that, we need to do I/O to the device, and $GETDVI cannot do any I/O.

Sorry!

-- Rob
IFX_1
Frequent Advisor

Re: Show Dev DSA/rebuild

I have actually write a script for this. And rebuild the disk if the the flag is yes.

It might make sense to you.

$ set verify
$ set noon
$ on error then continue
$ show time
$ set def sys$login:
$ show device d/rebuild_status/out=d.tmp
$ open/read file d.tmp
$ readline:
$ read/end_of_file=EXIT_LOOP file line
$ voldisk == f$elememt(0," ",line)
$ bldflag == f$elememt(18," ",line)
$ if bldflag .eqs. "Yes" then goto rebld_disk
$ goto readline
$!
$!
$ rebld_disk:
$ set volume/rebuild 'voldisk
$ write sys$output "Disk Rebuild - ", voldisk
$ goto readline
$!
$ EXIT_LOOP:
$ close file
$ show time
$!
$ delete/log/noconf sys$login:d.tmp;*
$ exit