Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I want to capture the system errors and write to a file.
Eg:%DCL-E-INVEST,invalid IF-THEN-ELSE nessting structure or data inconsistencyI want to record this error in a file .Kindly help
Shari

Shari,
I'm not sure I understand your wish.......
To redirect errormessages you can redefine
SYS$ERROR to point to file$ DEFINE SYS$ERROR ERRORLOG.LIS
But if you want to check a command for success or not, VMS stores information about how a DCL-command worked in two symbols. $STATUS and $SEVERITY.
example
$ SHOW TIME
12-OCT-2004 19:08:57
$ SHOW SYMBOL $S*
$SEVERITY == "1"
$STATUS == "%X00030001"SEVERITY = 1 means "SUCCESS"
$ WRITE SYS$OUTPUT F$MESSAGE(%X00030001)
%CLI-S-NORMAL, normal successful completion$ THISISNOTACOMMAND
%DCL-W-IVVERB, unrecognized command verb - check validity and spelling
\THISISNOTACOMMAND\$ SHOW SYM $S*
$SEVERITY == "0"
$STATUS == "%X00038090"SEVERITY = 0 means "WARNING"
$ WRITE SYS$OUTPUT F$MESSAGE(%X00038090)
%CLI-W-IVVERB, unrecognized command verb - check validity and spellingPlease explain your problem more detailed....

Shari,
Hakan has some good suggestions, allow me to suggest two more:
- Do a SPAWN/OUTPUT=filename
- SET HOST 0/LOG=filenameBoth are documented in the HELP text, use the HELP command to get the specifics of each command.
I hope that the above is helpful!
- Bob

If it is a command procedure, you can use the /OUTPUT qualifier e.g.
$ @MYCOMMANDFILE /OUTPUT=MYOUTPUT.TXT

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |