Operating System - OpenVMS

search/exclude issue

Go to solution

search/exclude issue

Hello all,
I'm trying to perform a search excluding GLOBAL_SALES*.COM with the following symbol:

CHECKINFO :== pipe search sy0:[operator.logs]opslog1.log/exclude=GLOBAL_SALES*.COM "''f$cvtime(,"ABSOLUTE","DATE")'","''
f$cvtime("YESTERDAY","ABSOLUTE","DATE")'"|search sys$pipe: info

But it's not recognising the 'exclude='.
Any super brains see what I'm doing wrong?
Many thanks in advance.
Willem Grooters
Honored Contributor

Re: search/exclude issue

"But it's not recognising the 'exclude='."

How can you tell: Error message? get all?

What would you like to exclude?
Willem Grooters
OpenVMS Developer & System Manager
Honored Contributor

Re: search/exclude issue

basic question

dir sy0:[operator.logs]opslog1.log
gives an error message or shows one or several files ?

And the shorter command

search sy0:[operator.logs]opslog1.log/exclude=GLOBAL_SALES*.COM "''f$cvtime(,"ABSOLUTE","DATE")'","''

shows what ?
Trusted Contributor

Re: search/exclude issue

I must be missing something. I do not see how "sy0:[operator.logs]opslog1.log" includes "global_sales*.com", so why do you have to exclude them?

To expand on someone else's question, if you


does it show any global_sales*.com?

So what are you really trying to do?

Re: search/exclude issue

Apologies - the symbol CHECKINFO currently produces a list of all jobs that produce an "Info" message. I wish to exclude from this list all jobs named 'Global_Sales*.com.

It is currently ignoring the '/exclude=GLOBAL_SALES*.COM, as jobs named 'Global_Sales*.com' are still appearing.
I hope this is clearer.

Re: search/exclude issue


Your command provides a list which includes all logmessages, not just "Info", and also doesn't exclude 'Global_Sales*.com'.
Honored Contributor

Re: search/exclude issue

It could be inferred that there is some confusion around the meaning of /EXCLUDE. /EXCLUDE excludes input files from consideration. /EXCLUDE does not exclude search targets from within matching files.

If you want to exclude matching strings within files as I am guessing is the case, you'll need to use a series of SEARCH commands and some with /MATCH=NOT or similar such.

I've switched to grep a while back. Far more cryptic, but also far more capable than SEARCH.
Willem Grooters
Honored Contributor

Re: search/exclude issue

OpenVMS 8.3?

sea sy0:[operator.logs]opslog1.log /out=1.out
sea/match=NAND/out=2.out 1.out info, GLOBAL_SALES
sea 2.out info

(just a hint)
Willem Grooters
OpenVMS Developer & System Manager
John Gillings
Honored Contributor

Re: search/exclude issue


Just an aside... please make sure you realise that the references to F$CVTIME are resolved at the time the symbol is defined, not at the time you enter the CHECKINFO command.

I can't think of a way to substitute variable dates inside a symbol, other than executing a procedure.

(oh, and I tend to agree with Hoff, grep blows SEARCH away).
A crucible of informative mistakes