.; DOWN.IND, IND control file. .; .; Assigns default (or user-specified) logical name to .; specified logical disk file. .; The control file will search a predetermined sequence of .; devices looking for the file if the device name is not .; specified in the filespec. .; You can also have the DOWN find the first available LD unit .; for the mount. If you do not give a value to parameter P3, .; DOWN will look for the first free LD unit (starting with unit .; LDSTART). If you specify P3, that LD unit will be used. .; .; This command file can support several levels of nesting, .; starting with the LD unit defined by 'LDSTRT' and going .; down to LD7. (Nested subdevices should have increasing LD .; unit numbers). The file is set up for one level of nesting .; (i.e., one subdevice inside another.) You can readily get .; two levels of nesting by uncommenting two lines below. To .; get more levels you will need to add some code. .; The file SY:CURDK.TMP holds the current default information. .; .; NOTE... You must assign the logical name WF: to some device. .; READLD.SAV must be located on SY:. PARSE.IND must be located .; on SY:. .; .; The parameters of the control file are: .; P1 File name (XXXXXX.DSK is default). .; P2 Logical name (DK is default). .; P3 LD unit to use (Default is automatic determination). .; .; When used in conjunction with a UCL, you can type .; DO[WN] FILNAM and have that file become the default. .; The UCL entry is .; DOWN == R IND\SY:DOWN ^1 ^2 ^3 (assuming you are using UCL+). .; .; Written by: .; R. W. Barnard .; BIO/Comp Applications .; Albuquerque, NM 87185 .; .; Version 3.11, 19-Feb-88. .; .enable global .enable quiet .; .sets LDN "" .;Extra level of nesting available. .; .; ********* Start of User-Changeable Setup Parameters ********* .; .; Specify starting LD unit number. .setn LDSTRT 6 .; .; .setn LDNEST 'LDSTRT'+1 .;If you want another level of nesting, .; .sets LDN "LD'LDNEST':" .;uncomment these lines. .; .; Specify search order and number of disks to be searched here. .; (If LD unit specified by 'LDSTRT' is first, you will search .; for nested files properly). .; Must use three characters plus : for every device!! .sets DISKS "LD'LDSTRT':'LDN'DU3:FW4:FW6:FW5:DU0:DL0:DU1:DU2:FW0:" .; .sets DISKS "LD'LDSTRT':'LDN'DU3:DU0:DU1:" .; Be sure to modify NUMDSK also. .setn NUMDSK 10 .;Change this to match # of devices above. .; .setn NUMDSK 4 .; .; Specify default extension here. .sets $DEFXT ".DSK" .;Default extension name. .; .; ***************** End of User-Changeable Parameters *************** .; .disable lowercase .disable prefix,suffix .disable octal .; .sets $DEFDV "" .;Use a null device because we want to search. .setn NDSK NUMDSK*4 .; .start: .if P1 ne "" .goto 10 .asks P1 Down to which file .parse P1 " " P1 P2 P3 .goto start .; .10: @SY:PARSE.IND 'P1' .; .if $DEV eq "" .goto 20 .;Device name wasn't supplied. .testfile '$FILSP' .if eq 230 .goto badnm2 .goto 70 .;Go straght to mount. .; .20: .setn COUNT 1 .;Try to find file on devices. .setn UNMNT 1 .;Index of unmounted devices. .dsklp: .sets DEV DISKS[COUNT:COUNT+3] .; Look for the file on each disk. .testdevice 'DEV' .parse "," DEVNAM A A A A A ONL MOU A .; Don't check a file if no disk. .if ONL eq "OFL" .or .if DEVNAM eq "NSD" .goto 50 .sets $FILSP "'DEV''$FILNM'" .;We also need complete file spec. .testfile '$FILSP' .if eq 230 .setn ERRSAV 230 .;Remember if no file. .if eq .goto 70 .;Found it. .goto 60 .50: .enable lowercase .sets NOMT'UNMNT' " 'DEV' is not mounted." .inc UNMNT .disable lowercase .60: .setn COUNT COUNT+4 .;Try again. .if COUNT gt NDSK .goto badnam .;Ran out of disks. .goto dsklp .; .70: .sets LOGICL "DK" .;Now do the logical assignment. .if P2 ne "" .sets LOGICL "'P2'" .; .test P3 .if ge 3 .sets CURLD "LD"+P3[3:3]+":" .;See if LD specified. .if eq 1 .sets CURLD "LD"+P3+":" .ifdf CURLD .goto mount .;It was. R READLD .if ne .exit .openr WF:LDLGCL.TMP .again: .read LINE .parse LINE " : ," LD DEV FILNAM A A A A .if LD eq "" .or .if LD eq "No" .goto notmtd .if $FILSP eq DEV+":"+FILNAM .goto found .goto again .; .found: .sets CURLD LD+":" .goto mount .; .notmtd: .setn COUNT LDSTRT .;We need to find the first .ldloop: .sets CURLD "LD'COUNT':" .;free LD unit. .testdevice 'CURLD' .parse "," DEVNAM A A A A A ONL MOU A .inc COUNT .if MOU ne "MTD" .goto mount .if COUNT lt 8 .goto ldloop ; No Available LD units!  .exit .; .mount: .close MOUNT 'CURLD' '$FILSP' 'LOGICL' .if gt .exit .; .; Show where we are. .open SY:CURDK.TMP .data E '$FILSP' is 'LOGICL', mounted on 'CURLD' .close .; Message is printed bold, and is positioned better on screen. TYPE SY:CURDK.TMP .; .exit .; .badnam: .;See what's wrong. .if ERRSAV eq 230 ;E No such file '$FILNM' on any device. .sets NOMT'UNMNT' "" .;Report on disks not mounted. .setn UNMNT 1 .enable lowercase .badlp: .;Keep reporting disks not mounted .if NOMT'UNMNT' eq "" .exit .sets A NOMT'UNMNT' .;until reaching a blank. ;'A' .inc UNMNT .goto badlp .; .badnm2: ;E No such file '$FILNM'. .exit