Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with version checking script

 
SOLVED
Go to solution
John A. Beard
Regular Advisor

Problem with version checking script

Hi folks,

I am trying to get a script working that will read a pre-defined list of disks and check for LOG files with a version number in excess of a specified limit. The problem I'm having is that after it encounters its first .LOG file it exits without continuing to check the rest of the disk (or read the next disk in the list).

$ set noon
$ open/read disklist NODESYS:[EMSHELP]isxv06_ems_disk.lis
$ploop:
$ read/end=fini disklist drec
$ device_name = f$extract(0,10,drec)
$ write sys$output ""
$ write sys$output "Reading ''device_name'"
$ write sys$output ""
$l1:
$ tmp = F$Search("''device_name'[*...]*.LOG;")
$ if (tmp.nes."")
$ then
$ vers = F$Parse("''Tmp'",,,"version")-";"
$ endif
$ if (vers .gt. 5000)
$ then
$ write sys$output tmp
$ endif
$fini:
$ close disklist
$ exit
Glacann fear críonna comhairle.
6 REPLIES 6
Thomas Ritter
Respected Contributor

Re: Problem with version checking script

Missing goto I1 ? What if tmp = "" ?
John A. Beard
Regular Advisor

Re: Problem with version checking script

FYI This is a VMS 7.1-2 box and I don't have access to a version of DFU that will run with it...I have PCSI versions for 301 and 302 but nothing prior.
Glacann fear críonna comhairle.
The Brit
Honored Contributor

Re: Problem with version checking script

Hi John,
Thomas fingered your problems.

1. You need some kind of loop back to l1 after every logfile found.
2. When the loop reaches the end of the device, f$search will return "". At that point you probably need to go to Ploop and read the next device.

These two explain why it only goes through the loop once, and why to doesnt go to the next device.

Dave.
John A. Beard
Regular Advisor

Re: Problem with version checking script

Hi Dave,

If I insert a GOTO into the script I get the following result...


Reading $1$DKB201:

$1$DKB201:[EMS_LOGIN_HAG.MIS_USER.EMSSAP]UCX$FTPSERVER.LOG;5815
$1$DKB201:[EMS_LOGIN_HAG.MIS_USER.EMSSAP]UCX$FTPSERVER.LOG;5815
$1$DKB201:[EMS_LOGIN_HAG.MIS_USER.EMSSAP]UCX$FTPSERVER.LOG;5815
$1$DKB201:[EMS_LOGIN_HAG.MIS_USER.EMSSAP]UCX$FTPSERVER.LOG;5815
Ctl/Y Interrupt

$ set noon
$ open/read disklist NODESYS:[EMSHELP]isxv06_ems_disk.lis
$ploop:
$ read/end=fini disklist drec
$ device_name = f$extract(0,10,drec)
$ write sys$output ""
$ write sys$output "Reading ''device_name'"
$ write sys$output ""
$l1:
$ tmp = F$Search("''device_name'[*...]*.LOG;")
$ if (tmp.nes."")
$ then
$ vers = F$Parse("''Tmp'",,,"version")-";"
$ endif
$ if (vers .gt. 5000)
$ then
$ write sys$output tmp
$ endif
$ GOTO L1
$fini:
$ close disklist
$ exit
Glacann fear críonna comhairle.
Hein van den Heuvel
Honored Contributor
Solution

Re: Problem with version checking script

$ set noon

$close/nolog disklist

$ open/read disklist NODESYS:[EMSHELP]isxv06_ems_disk.lis
$ploop:
$ read/end=fini disklist drec
$ device_name = f$extract(0,10,drec)
$ write sys$output ""
$ write sys$output "Reading ''device_name'"
$ write sys$output ""
$l1:
$ tmp = F$Search("''device_name'[*...]*.LOG;")

$ if tmp.eqs."" then goto ploop

$ vers = F$Parse("''Tmp'",,,"version")-";"
$ if (vers .gt. 5000)
$ then
$ write sys$output tmp
$ endif
$ GOTO L1
$fini:
$ close disklist
$ exit
John A. Beard
Regular Advisor

Re: Problem with version checking script

Thanks to one and all...it works perfectly now. If you were in Toronto I'd buy you a beer..guess it will have to be a rain check!
Glacann fear críonna comhairle.