T.R | Title | User | Personal Name | Date | Lines |
---|
3705.1 | messages are in sys$share:mcc_msg.h | TOOK::MCPHERSON | Life is hard. Play short. | Tue Sep 08 1992 15:31 | 36 |
| >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.2 | | CADSYS::LEMONS | And we thank you for your support. | Tue Sep 08 1992 16:46 | 11 |
| > 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.3 | DECMCC Developer's Toolkit | TOOK::MCPHERSON | Life is hard. Play short. | Tue Sep 08 1992 16:55 | 8 |
| > 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.4 | | CADSYS::LEMONS | And we thank you for your support. | Thu Sep 10 1992 16:59 | 13 |
| 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.5 | use sys$message:mcc_message.exe | MCC1::DITMARS | Pete | Fri Sep 11 1992 12:22 | 5 |
| 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.6 | Silly me. | TOOK::MCPHERSON | Life is hard. Play short. | Fri Sep 11 1992 15:58 | 5 |
| Of course! Silly me.
Pete's suggestion is better; using f$message() is more reliable and faster than
searching throuh .H files...
/doug
|