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

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

3705.0. "Handling DECmcc errors within a DCL command procedure" by CADSYS::LEMONS (And we thank you for your support.) Tue Sep 08 1992 14:35

I'm creating a command procedure that uses the DCL command interface.  I'm
trying to trap for errors.  In short, I'm finding that DECmcc returns a success
status, even when an error has occurred:

$  manage/enter create bridge HLOMCC_NS:.MCC.BRIDGE.L2A1 forw data multi entr -
   AB-00-00-01-00-00
DECmcc (V1.2.0)


Bridge HLOMCC_NS:.MCC.BRIDGE.L2A1 Forwarding Database Multicast Entry AB-00-00-0
1-00-00
AT  8-SEP-1992 13:25:57

Invalid Password.
$ show symbol $status
  $STATUS == "%X03268061"
$ show symbol $severity
  $SEVERITY == "1"

Here's the output from a command that completes successfully:

$ manage/enter show  bridge HLOMCC_NS:.MCC.BRIDGE.R1B1
DECmcc (V1.2.0)

Using default ALL IDENTIFIERS

Bridge HLOMCC_NS:.MCC.BRIDGE.R1B1
AT  8-SEP-1992 13:27:28 Identifiers

Examination of attributes shows:
                                   Name = HLOMCC_NS:.MCC.BRIDGE.R1B1
                                Address = { 08-00-2B-26-DE-3C,
                                            08-00-2B-26-DE-3B }
$ show symbol $severity
  $SEVERITY == "1"
$ show symbol $status
  $STATUS == "%X03268049"

I sure don't want to have to figure out all of the DECmcc status codes, and
parse the errors myself.  Is there a better way?

Thanks!
tl
T.RTitleUserPersonal
Name
DateLines
3705.1messages are in sys$share:mcc_msg.hTOOK::MCPHERSONLife is hard. Play short.Tue Sep 08 1992 15:3136
>I'm creating a command procedure that uses the DCL command interface.  I'm
>trying to trap for errors.  In short, I'm finding that DECmcc returns a success
>status, even when an error has occurred:
		
	[ example deleted for brevity ]
	
>I sure don't want to have to figure out all of the DECmcc status codes, and
>parse the errors myself.  Is there a better way?

    You could just copy $status into a temp  variable, then  search the
    mcc_msg.h file for the value.  If it's other than MCC_S_RESPONSE, then
    you have a problem.  Hopefully, the constants in the .H file are named
    descriptively enough that you can figger out what the problem was (if
    you had a problem...)

    You could put this validation in a three-four line DCL Subroutine that
    could be called after any MCC command.... Examples:

	$! This example shows that you had Success with a specialized 
    	$! exception (e.g. bad password...)
	$ show symbol $status
	  $STATUS == "%X03268061"
	$ status = $status
	$ sea sys$share:mcc_msg.h 'status
	#define MCC_S_SPECIALIZED_EXCEPTION 52854881


	$! This example shows that the command completed no probs: 
	$ show symbol $status
	  $STATUS == "%X03268049"
	$ status = $status
	$ sea sys$share:mcc_msg.h 'status
	#define MCC_S_RESPONSE 52854857

    Can you make that work for you?
    /doug
3705.2CADSYS::LEMONSAnd we thank you for your support.Tue Sep 08 1992 16:4611
>    Can you make that work for you?

Cool!  Yep, that'll do it.  But,

$ dir sys$share:mcc_msg.h
%DIRECT-W-NOFILES, no files found

What kit do I install to get this file?

Thanks!
tl
3705.3DECMCC Developer's ToolkitTOOK::MCPHERSONLife is hard. Play short.Tue Sep 08 1992 16:558
> What kit do I install to get this file?

Install the DECmcc Developer's Toolkit (MCCTK012) & it contains the
necessary include files.  Or you can just copy it from
	MCDOUG::DUA1:[PUBLIC]mcc_msg.h

/doug

3705.4CADSYS::LEMONSAnd we thank you for your support.Thu Sep 10 1992 16:5913
Small change needed:

$ show symbol $status
  $STATUS == "%X03268049"
$ status = f$integer($status)
$ show symbol status
  STATUS = 52854857   Hex = 03268049  Octal = 00311500111
$ search sys$share:mcc_msg.h 52854857
#define MCC_S_RESPONSE 52854857

f$integer is needed to translate $status (which is text) to a numeric value.

tl
3705.5use sys$message:mcc_message.exeMCC1::DITMARSPeteFri Sep 11 1992 12:225
it's available without the toolkit.

$ set message SYS$COMMON:[SYSMSG]MCCMSG.EXE
$ write sys$output "''f$message(%X03268049)'"
%MCC-S-RESPONSE, success with response reply
3705.6Silly me.TOOK::MCPHERSONLife is hard. Play short.Fri Sep 11 1992 15:585
Of course!  Silly me.   
Pete's suggestion is better; using f$message() is more reliable and faster than
searching throuh .H files...
/doug