[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

441.0. "SEARCH's useless message" by SHIRE::GOLDBLATT (David Goldblatt Europe/IS) Fri Apr 10 1987 07:33

Is it possible to suppress the "no strings matched" message that is written 
on SYS$COMMAND by the DCL SEARCH command ?  Even using the "NOLOG" 
and "OUT=" parameters will not prevent this message from appearing on 
SYS$COMMAND.

Regards,

David
T.RTitleUserPersonal
Name
DateLines
441.1JETSAM::NORRISWhat is it, Miss Pfeffernuss?Fri Apr 10 1987 12:537
    You can use:
    
    	$ set message/nofac/noident/nosever/notext
    	$ search file string
    	$ set message/fac/ident/sever/text
    
    Ed
441.2reassign sys$output?BISTRO::HEINIf We don't Have it,You don't Need it!Fri Apr 10 1987 13:017
    That message is produced through a LIB$SIGNAL.
        
    Isn't it going to SYS$OUTPUT. Can't you supress it through
    assinging (/user) sys$output to nl: (combined with /out=...
    for the real output).
    
441.3It works!SHIRE::GOLDBLATTDavid Goldblatt Europe/ISFri Apr 10 1987 14:269
    I tried Ed's suggestion in .1 and it worked.  Thanks a lot Ed.
    
    Concerning the suggestion in .2, redefining SYS$OUTPUT places the
    message in the new file (to which SYS$OUTPUT now points), but does
    nothing at all for SYS$COMMAND.
    
    Thank you both, and best regards,
    
    David
441.4previous replies are close, but not quiteIDE::NELSONJENelsonFri Apr 10 1987 15:0037
    There are two ways for you to fix this.
    
    1.  As reply 1 suggested, use SET MESSAGE/NOT/NOI/NOS/NOF.
    	However, I strongly urge that you use the lexical
    	F$ENVIRONMENT("MESSAGE") to save the user's original
    	message flags, and then restore them when you're through.
    	Your code becomes:
    
    	$ save_flags = f$environment("message")
    	$ set message/not/noi/nos/nof
    	$ search...
    	$ status = $status	! save status to test for later
    	$ set message'save_flags'
    	$ if status ...
    
    2.  The suggestion in reply 2 was close, but not quite.  In order
    	to supress messages you must not only redirect SYS$OUTPUT, but
    	SYS$ERROR, too (and not SYS$COMMAND, as reply 3 suggested).  To
    	understand why, you have to know how $PUTMSG works.  ($PUTMSG is
    	the system service that displays the messages you see on your
    	terminal.)
    
    	$PUTMSG will write the error message to both SYS$OUTPUT and
    	SYS$ERROR iff both logical names point to different places.
    	If the logicals point to the same place (as is normally the
    	case), $PUTMSG only writes to one of them.  Therefore, in order
    	to supress error messages, you must redefine SYS$OUTPUT and
    	SYS$ERROR, like this:
    
    	$ define/user sys$output nl:
    	$ define/user sys$error  nl:
    	$ search...
    	$ if $status ...

    Now, which solution is better?  It's up to you.
    
    				JENelson
441.5I can't all but fail to disagree with you lessVIDEO::OSMANtype video::user$7:[osman]eric.sixMon Apr 13 1987 17:2811
The following method *is* better than the SET MESSAGE method:

	$ def/user sys$output nl:
	$ def/user sys$error nl:
	$ search . . .

The reason it's better, is look what happens if someone hits ^Y during
each method !

/Eric