ONLINE Copyright (c) 1991 Allegro Consultants, Inc. www.allegrosupport.com Written by Stan Sieler (sieler@gmail.com) and Charlie Rand. (email: sieler@gmail.com) ONLINE is a privileged program that tries to put most tapes "on line". ("Tapes" includes: nine track, DDS (DAT), and DLT.) Usage: run online;info = "ldev []" or: run online;parm = ldev [;info=""] (e.g.: run online; parm=7) For more help information, do: run online, help ::= [NO]BACKground BACKGROUND tells ONLINE to activate its parent process prior to talking to the tape drive. Note: this works only if the parent is a user process (i.e., not the top-level CI) NOTE: "BACKGROUND" is not recommended for general use. Most users want ONLINE to wait until the tape is accessible... this won't happen if the BACKGROUND option is used. Default: NOBACKGROUND [NO]CHECKonline CHECKONLINE tells ONLINE to first see if the tape is online ... if it is, ONLINE terminates quickly. NOCHECKONLINE tells ONLINE to skip the online check. Default: CHECKONLINE Help (or: ?) HELP displays this text. [NO]QUIET QUIET tells ONLINE to suppress most messages (except warnings and errors). Default: NOQUIET [NO]WAITavr WAITAVR tells ONLINE to wait for AVR to complete (see the "Notes" section below). NOWAITAVR tells ONLINE not to wait for AVR. Default: WAITAVR Examples: (assuming program is ONLINE.PUB.SYS, and assuming LDEV 7 is a tape drive of some kind with a tape (or cartridge/cassette) mounted, but off-line) online 7 run online.pub.sys; parm = 7 run online.pub.sys; info = "7" All of the above examples put LDEV 7 back on line. Notes: If tape is already mounted and online, this program will complete immediately, noting that the tape drive is already online. HP7978B tape drives cannot be put online programmatically. Using ONLINE for an HP7978B will result in an "LDEV NOT READY" message on the system console, and will probably require you to /ABORT ONLINE. HP7980XC tape drives may require that you break/abort ONLINE and run it a second time if tape data compression is enabled. If the tape is not mounted, this program will hang until it is mounted, or an ABORTIO is done on the LDEV (or until you hit and enter: ABORT). Sorry, but this is a shortcoming in the design of the awkward HP intrinsic ONLINE calls. If an ABORTIO is done, the intrinsic returns the incorrect "warning": "The operation was successful with retries.", which, of course, it wasn't. If the LDEV you specify is not a tape drive, ONLINE may generate a misleading error. Again, this is the fault of the intrinsic. ONLINE attempts to avoid this by using simple privileged code to check the type of LDEV you specify. (#1) If you try to place a tape online after another process has already "grabbed" the drive, your request will be rejected with error -3/$8f, and the tape may have to be placed online manually. (Again, due to the intrinsic.) (If you do an ABORTIO after running ONLINE in this case, the online-request may be belatedly honored by the drive.) Once ONLINE has issued the "online" request, it will wait up to one minute for the drive to be "ready". (It is waiting for Automatic Volume Recognition (AVR) to complete.) This wait can be terminated by pressing control-Y. (The "ready" check uses simple privileged code (#1).) The wait-for-AVR can be bypassed by using the NOWAITAVR option. At present, it appears that ONLINE cannot tell when a DLT tape has been AVR'd (automatic volume recognition ... the second part of coming "online"). #1: If you do not like using privileged code, a non-privileged version of ONLINE (ONLINENP) is available. JCW values set by ONLINE: Values less than 0 indicate an error. Values greater than 0 indicate a warning. Value of 0 means "no error, no warning" -1 LDEV out of range -2 hpdevcontrol failed -3 LDEV <= 0 -4 LDT DST problem -5 LDEV not configured -6 LDEV not a tape drive -8 unknown option 0 worked 1 worked, already online 2 control-Y 3 AVR failed, possibly online ================================================================= How does ONLINE interact with Automatic Volume Recognition? The following is a commented copy of the output generated by ONLINE if run with the "DEBUG1 DEBUG2" INFO options. Status prior to ONLINE trying to put the DLT online: ------------------------- Max LDEV = 4679 LDT entry @ $0.0, #halfs = 7 LPDT entry @ $0.0, #halfs = 4 LDT entry = $0000 $0000 $8018 $2000 $0180 $0000 $0000 ^ (density) LPDT entry = $0000 $0807 $ffff $2000 ^ (device_ownership) LDEV AVAIL OWNERSHIP VOLID DEN 31 AVAIL Trying to put LDEV 31 online...waiting for AVR... Essentially immediately after we attempt to put the DLT online, the state goes to "unavailable" (as reported by SHOWDEV): ------------------------- Max LDEV = 4679 LDT entry @ $0.0, #halfs = 7 LPDT entry @ $0.0, #halfs = 4 (reserved / unavail) LDT entry = $0000 $0000 $8018 $2000 $0180 $0000 $0000 ^ (density) LPDT entry = $0000 $c807 $ffff $2000 ^ (device_ownership) LDEV AVAIL OWNERSHIP VOLID DEN 31 UNAVAIL SYS ------------------------- After a bit, AVR (Automatic Volume Recognition) reports that the tape is mounted. Note that the tape is *NOT* ready to access yet! 20:32/20/Vol (unlabelled) mounted on LDEV# 31 ------------------------- Max LDEV = 4679 LDT entry @ $0.0, #halfs = 7 LPDT entry @ $0.0, #halfs = 4 (reserved / unavail) LDT entry = $0000 $0000 $8018 $2000 $0180 $0000 $0000 ^ (density) LPDT entry = $0000 $c807 $ffff $2000 ^ (device_ownership) LDEV AVAIL OWNERSHIP VOLID DEN 31 UNAVAIL SYS (Nolabel) After a second or two more, the tape goes to the "AVAIL" state, the density flag is set, and the tape is actually accessible: ------------------------- Max LDEV = 4679 LDT entry @ $0.0, #halfs = 7 LPDT entry @ $0.0, #halfs = 4 LDT entry = $0000 $0000 $8018 $2008 $0180 $0000 $0000 ^ (density) LPDT entry = $0000 $0807 $ffff $2000 ^ (device_ownership) LDEV AVAIL OWNERSHIP VOLID DEN 31 AVAIL (Nolabel) 1600 At this point, ONLINE reports success and terminates. ONLINE was waiting for both the density flag to be set, and the ownership to go to "none" (AVAIL). ================================================================= ONLINE 20210927