HP's Enterprise reports a rising Q1 tide
Overview compares emulation strategies

Friday Fine-tune: Check on LDEV availability

Is there a way to have an HP 3000 jobstream check to see if a tape drive (LDEV) is available? I am not seeing a HP system variable that seems to list the status. I can see via a SHOWDEV that the device is available or not. I just need a jobstream to be able to do the same.

Roy Brown replies

We use a utility, apectrl.pub.orbit, that we found in our ORBIT account alongside Backup+. We use this, in a command file run as a jobstream, to check that tapes are mounted ready for our nightly backups, and, in the backup job itself, to eject them when complete.

Tom Hula says,

It's been awhile since I've messed with the 3000. I have a utility that I received from Terry Tipton many years ago that does that checking. It is called CHKTAPE. So if the tape drive is dev 7, I have CHKTAPE 7 in the jobstream and then check for the results in CHKTAPE_RESULT. We are looking for a value of 0, but here are all the results:

0 - Tape is unowned, online, at BOT and writeable
1 - Tape is unowned, online, at BOT and write protected
2 - An error occurred.  Probably an invalid device number
3 - Device is not a tape drive
4 - Device is owned by another process
5 - Device is owned by the system
6 - Tape is not online
7 - No tape in device

Terry has a reminder that the program must reside in a group with PM capability. I have been using it on all my backups since without any problems. Let me know if you are interested in getting a copy of this utility.

Alan Yeo adds,

We use the little ONLINE utility from Allegro to put a tape on-line, or back on-line; we use it to put automatically back on-line to do a verify after the store.

Donna Hofmeister replies

Here's a scripted solution to the question. MPE has the best scripting language of any OS. Thanks, Jeff (Vance)!

The following will return CI variables that can be easily used in a job:
parm tape=0,entry=main

if "!entry" = "main"
 if "!tape" = "0" or "!tape" = "?"
   echo ![basename(hpfile)] [tape_ldev_num]
   echo              req.
   echo ![basename(hpfile)] is designed to check the 
   echo !desired tape
   echo   device to see if a write-enabled tape is mounted and
   echo   available for use.
   echo
   echo The boolean variable _TAPE_READY will be returned.
   echo The string  variable _TAPE_LABEL will be returned, if available.
   return
 endif
 if numeric("!tape")
   setvar _ct_tape !tape
 else
   echo ERROR: The parameter "!tape" is not numeric
   return
 endif
 file sdtemp;rec=-80,,f,ascii;temp
 if finfo("*sdtemp","exists")
   purge sdtemp,temp
 endif
 errclear
 continue
 showdev !_ct_tape > *sdtemp
 if hpcierr <> 0
   echo !hpcierr   !hpcierrmsg
   escape !hpcierr
 endif
 setvar _ct_tape_ready false
 setvar _tape_ready false
 setvar _tape_label ''
 xeq !hpfile !_ct_tape,process < *sdtemp
 if _ct_tape_ready
   setvar _tape_ready true
 endif
 if _ct_tape_label > ''
   setvar _tape_label _ct_tape_label
 endif
 deletevar _ct_@
 purge sdtemp,temp
 reset sdtemp
elseif "!entry" = "process"
 setvar _ct_eof finfo(hpstdin,'eof')
 while setvar(_ct_eof,_ct_eof-1) >= 0
   input _ct_rec
   if numeric(word(_ct_rec))
     if pos("AVAIL    (W)",_ct_rec) > 0
       setvar _ct_tape_ready true
     endif
     setvar _ct_tape_label   repl(str(_ct_rec,43,14),' ','')
   endif
 endwhile
endif

In a job, it might look something like this:

!chktape 7
!if not _TAPE_READY
! tellop No Tape is mounted
! setjcw jcw=fatal
!endif

Comments