From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  8-NOV-1990 16:40:07.93
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	Re: Compressing NOTES

Received:  by crdgw1.ge.com (5.57/GE 1.76)
	 id AA14322; Thu, 8 Nov 90 16:00:41 EST
Message-Id:  <9011082100.AA14322@crdgw1.ge.com>
Received: From RELAY.MOD.UK by CRVAX.SRI.COM with TCP; Thu,  8 NOV 90 02:01:33 PDT
Received: from hermes.mod.uk by relay.MOD.UK   via PSS with NIFTP  id aa00661;
          8 Nov 90 9:29 WET
Date:           Thu, 8 Nov 90   9:53 GMT
From: Graham Evans <"CCF::GPE%hermes.mod.uk"@relay.MOD.UK>
To: INFO-VAX <@relay.MOD.UK:INFO-VAX@crvax.sri.com>
Subject:        Re: Compressing NOTES

Here is what we use to tidy up our NOTES. The key code is in the subroutine
optnote - the rest is just automation of the process.

Disclaimer - use at your own risk.

Graham Evans

Username: GPE
Site:UK.MOD.HERMES

$! Utility to re-optimize all .note files in NOTES$LIBRARY
$!
$! Change record
$!
$! Setting up
$ SET NOON
$ oldpriv = F$SETPRV("BYPASS,EXQUOTA")
$ SET DEF NOTES$LIBRARY
$ DIR/SIZ=ALL *.NOTE
$!           
$! Initial information - generate control file
$!
$ DIR *.note/notrail/col=1/output=notefiles.tmp
$!
$! Process the control file
$!
$ OPEN/READ control_file notefiles.tmp
$!
$control_loop:
$ READ/END_OF_FILE=all_done control_file control_line
$ IF F$LOCATE(".NOTE",control_line) .EQ. F$LENGTH(control_line) -
     THEN GOTO control_loop
$ notename = F$ELEMENT(0,".",control_line)
$!
$ GOSUB optnote
$!
$ GOTO control_loop
$!
$! Tidy up and exit
$!
$ all_done:
$!
$ CLOSE control_file
$ PURGE notefiles.tmp
$ DELETE *.FDL;*
$ DIR/SIZ=ALL *.NOTE
$ oldpriv=f$setprv(oldpriv)
$ EXIT
$!
$!-------------------Subroutine
$!
$! Input: Symbol notename - a note file in current default
$!
$optnote:
$ ANALYZE/RMS/FDL 'notename'.NOTE
$ EDIT/FDL/ANALYZE='notename'.FDL/NOINTERACTIVE 'notename'.FDL
$ CONVERT/FDL='notename'.FDL 'notename'.NOTE 'notename'.NOTE
$ PURGE 'notename'.NOTE
$ RETURN

