f



$SYNCHRONIZE ... why isn't $STATUS the $STATUS from the batch job?

Isn't $SYNCHRONIZE supposed to set $STATUS to the $STATUS from
the batch job?  See below ...  why am I getting the error message
for exit status 124 (not 123) and why is $STATUS being OR-ed with
%x10000000 ?



$ type 15sec.com
$ wait 00:00:15
$ exit 123

$ submit 15sec.com
Job 15SEC (queue SYS$BATCH, entry 607) started on SYS$BATCH

$ sync/entry=607
Job 15SEC (queue SYS$BATCH, entry 607) completed
%SYSTEM-I-DEVNOTMOUNT, device is not mounted

$ write sys$output $STATUS
%X1000007B
0
z750 (319)
6/23/2004 1:42:43 AM
comp.os.vms 21904 articles. 0 followers. Post Follow

16 Replies
448 Views

Similar Articles

[PageSpeed] 52

Z wrote:
> 
> Isn't $SYNCHRONIZE supposed to set $STATUS to the $STATUS from
> the batch job?  See below ...  why am I getting the error message
> for exit status 124 (not 123) and why is $STATUS being OR-ed with
> %x10000000 ?
> 
> $ type 15sec.com
> $ wait 00:00:15
> $ exit 123
> 
> $ submit 15sec.com
> Job 15SEC (queue SYS$BATCH, entry 607) started on SYS$BATCH
> 
> $ sync/entry=607
> Job 15SEC (queue SYS$BATCH, entry 607) completed
> %SYSTEM-I-DEVNOTMOUNT, device is not mounted
> 
> $ write sys$output $STATUS
> %X1000007B

DJAS01::DDACHTERA$ a = 123
DJAS01::DDACHTERA$ sh sym a
  A = 123   Hex = 0000007B  Octal = 00000000173

Get the idea?

The "1" in the high-order digit just tells the system not to repeat the
error message (it wouldn't anyway for $SEVERITY = 3, "informational").

D.J.D.
0
6/23/2004 2:30:27 AM
David J Dachtera wrote:
>>Isn't $SYNCHRONIZE supposed to set $STATUS to the $STATUS from
>>the batch job?  See below ...  why am I getting the error message
>>for exit status 124 (not 123) and why is $STATUS being OR-ed with
>>%x10000000 ?
>>
>>$ type 15sec.com
>>$ wait 00:00:15
>>$ exit 123
>>
>>$ submit 15sec.com
>>Job 15SEC (queue SYS$BATCH, entry 607) started on SYS$BATCH
>>
>>$ sync/entry=607
>>Job 15SEC (queue SYS$BATCH, entry 607) completed
>>%SYSTEM-I-DEVNOTMOUNT, device is not mounted
>>
>>$ write sys$output $STATUS
>>%X1000007B
> 
> 
> DJAS01::DDACHTERA$ a = 123
> DJAS01::DDACHTERA$ sh sym a
>   A = 123   Hex = 0000007B  Octal = 00000000173
> 
> Get the idea?

I'm not sure what you're getting at ... yes, I understand
that 7Bh is 123.  But that's not my problem.


I have 2 problems:

1.
The batch jobs exits with 123 but the $STATUS after SYNC
returns isn't 123.  It's 123 OR-ed with %x10000000.  This
is not what I expected.  And that contradicts the OpenVMS
DCL Dictionary, N-Z:

 From DCL II-490:
....
Description:
....
The completion status form the SYCNHRONIZE command is that
same as the completion status of the last command executed
in the job.


2.
I'm getting an error message for status 124 or maybe 122
(DEVNOTMOUNT) even though I exit with 123.  Why is that
hapenning?
0
z750 (319)
6/23/2004 2:58:47 AM
Z wrote:
> 
> David J Dachtera wrote:
> >>Isn't $SYNCHRONIZE supposed to set $STATUS to the $STATUS from
> >>the batch job?  See below ...  why am I getting the error message
> >>for exit status 124 (not 123) and why is $STATUS being OR-ed with
> >>%x10000000 ?
> >>
> >>$ type 15sec.com
> >>$ wait 00:00:15
> >>$ exit 123
> >>
> >>$ submit 15sec.com
> >>Job 15SEC (queue SYS$BATCH, entry 607) started on SYS$BATCH
> >>
> >>$ sync/entry=607
> >>Job 15SEC (queue SYS$BATCH, entry 607) completed
> >>%SYSTEM-I-DEVNOTMOUNT, device is not mounted
> >>
> >>$ write sys$output $STATUS
> >>%X1000007B
> >
> >
> > DJAS01::DDACHTERA$ a = 123
> > DJAS01::DDACHTERA$ sh sym a
> >   A = 123   Hex = 0000007B  Octal = 00000000173
> >
> > Get the idea?
> 
> I'm not sure what you're getting at ... yes, I understand
> that 7Bh is 123.  But that's not my problem.
> 
> I have 2 problems:
> 
> 1.
> The batch jobs exits with 123 but the $STATUS after SYNC
> returns isn't 123.  It's 123 OR-ed with %x10000000.  This
> is not what I expected.  And that contradicts the OpenVMS
> DCL Dictionary, N-Z:
> 
>  From DCL II-490:
> ...
> Description:
> ...
> The completion status form the SYCNHRONIZE command is that
> same as the completion status of the last command executed
> in the job.
> 
> 2.
> I'm getting an error message for status 124 or maybe 122
> (DEVNOTMOUNT) even though I exit with 123.  Why is that
> hapenning?

OpenVMS V6.2 :
$write sys$output f$message(123)
%SYSTEM-I-DEVNOTMOUNT, device is not mounted

-- 
---------------------------------------------------------------------
Usual disclaimer: All opinions are mine alone, perhaps not even that.
Mike Rechtman                            *rechtman@tzora.co.il*
Kibbutz Tzor'a.                          Voice (home): 972-2-9908337  
  "20% of a job takes 80% of the time, the rest takes another 80%"
---------------------------------------------------------------------
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS d(-)pu s:+>:- a++ C++ U-- L-- W++ N++ K? w--- V+++$
PS+ PE-- t 5? X- tv-- b+ DI+ D-- G e++ h--- r+++ y+++@
------END GEEK CODE BLOCK------
0
6/23/2004 8:24:32 AM
Mike Rechtman wrote:
>>1.
>>The batch jobs exits with 123 but the $STATUS after SYNC
>>returns isn't 123.  It's 123 OR-ed with %x10000000.  This
>>is not what I expected.  And that contradicts the OpenVMS
>>DCL Dictionary, N-Z:
>>
>> From DCL II-490:
>>...
>>Description:
>>...
>>The completion status from the SYCNHRONIZE command is the
>>same as the completion status of the last command executed
>>in the job.
>>
>>2.
>>I'm getting an error message for status 124 or maybe 122
>>(DEVNOTMOUNT) even though I exit with 123.  Why is that
>>hapenning?
> 
> 
> OpenVMS V6.2 :
> $write sys$output f$message(123)
> %SYSTEM-I-DEVNOTMOUNT, device is not mounted

I'll be darned.  I assumed all odd $STATUSes were not error
messages.  D'Oh!

Thank you.  I just have the 1. problem left.
0
z750 (319)
6/23/2004 10:24:29 AM
On Tue, 22 Jun 2004 19:58:47 -0700, Z <z@no.spam> wrote:

>I have 2 problems:
>
>1.
>The batch jobs exits with 123 but the $STATUS after SYNC
>returns isn't 123.  It's 123 OR-ed with %x10000000.  This
>is not what I expected.  And that contradicts the OpenVMS
>DCL Dictionary, N-Z:
>
> From DCL II-490:
>...
>Description:
>...
>The completion status form the SYCNHRONIZE command is that
>same as the completion status of the last command executed
>in the job.
>
>
>2.
>I'm getting an error message for status 124 or maybe 122
>(DEVNOTMOUNT) even though I exit with 123.  Why is that
>hapenning?

Perhaps the documentation is not explaining things very well, but it is not
as incorrect as you perhaps perceive.  The status value is made up of
several bit-fields.  The lowest 3 bits are the severity.  Any one "status"
can thus have up to 8 different levels.  They include values that translate
to -I-, -W-, -S-, -E-, -F- as seen in typical messages.  Odd values are
"true", even values "false".  There are then bit-fields for the actual
message number itself, the facility within which that message is meaningful,
and finally (in the highest bits), 4 bits that control message output.  In
this last nibble, the low bit suppresses output when set (it's the only
defined bit in fact).  Thus, any values that start with 1 (in hex) do not
display.  You can see this from your SYNCHRONIZE examples.  It is open to
debate whether this is a good thing or not, but at least it means you will
only get an error message when you have entered an erroneous SYNCHRONIZE
command.  Suppose you misspelt it - you will get %DCL-W-IVVERB, unrecognized
command verb, etc.  How could you distinguish this case from your batch job
itself dying due to a misspelt command, if they both yielded the same
message on-screen ?

In general, to properly handle status values within DCL, you should mask off
the low 3 bits and the high 4 bits, or use F$MESSAGE to extract the field
you are interested in.  (In fact, the help for F$MESSAGE has an example
involving SYNCHRONIZE !)

-- 
Thank you for not breathing while I smoke. 

Mail john rather than nospam...
0
nospam71 (197)
6/23/2004 11:35:31 AM
Z> I have 2 problems:
> 
> 1.
> The batch jobs exits with 123 but the $STATUS after SYNC
> returns isn't 123.  It's 123 OR-ed with %x10000000.  This
> is not what I expected.  
> 

Somewhat unexpected. The bit is set by the function that outputs
a message to indicate that it has already been output and shouldn't
be output again. Sounds like either the documentation is wrong or there
is a bug.

> 
> 2.
> I'm getting an error message for status 124 or maybe 122
> (DEVNOTMOUNT) even though I exit with 123.  Why is that
> hapenning?

That is the informational message for 123:

$ wri sys$output f$message(123)
%SYSTEM-I-DEVNOTMOUNT, device is not mounted

The bottom three bits of a status are the severity so:

$ wri sys$output f$message(120)
%SYSTEM-W-DEVNOTMOUNT, device is not mounted
$ wri sys$output f$message(121)
%SYSTEM-S-DEVNOTMOUNT, device is not mounted
$ wri sys$output f$message(122)
%SYSTEM-E-DEVNOTMOUNT, device is not mounted
$ wri sys$output f$message(123)
%SYSTEM-I-DEVNOTMOUNT, device is not mounted
$ wri sys$output f$message(124)
%SYSTEM-F-DEVNOTMOUNT, device is not mounted

Martin Kirby
0
6/23/2004 12:22:11 PM
Z <z@no.spam> wrote in message news:<10dhsdtf8o8qsa7@corp.supernews.com>...
> David J Dachtera wrote:
> >>Isn't $SYNCHRONIZE supposed to set $STATUS to the $STATUS from
> >>the batch job?  See below ...  why am I getting the error message
> >>for exit status 124 (not 123) and why is $STATUS being OR-ed with
> >>%x10000000 ?
> >>
> >>$ type 15sec.com
> >>$ wait 00:00:15
> >>$ exit 123
> >>
> >>$ submit 15sec.com
> >>Job 15SEC (queue SYS$BATCH, entry 607) started on SYS$BATCH
> >>
> >>$ sync/entry=607
> >>Job 15SEC (queue SYS$BATCH, entry 607) completed
> >>%SYSTEM-I-DEVNOTMOUNT, device is not mounted
> >>
> >>$ write sys$output $STATUS
> >>%X1000007B
> > 
> > 
> > DJAS01::DDACHTERA$ a = 123
> > DJAS01::DDACHTERA$ sh sym a
> >   A = 123   Hex = 0000007B  Octal = 00000000173
> > 
> > Get the idea?
> 
> I'm not sure what you're getting at ... yes, I understand
> that 7Bh is 123.  But that's not my problem.
> 
> 
> I have 2 problems:
> 
> 1.
> The batch jobs exits with 123 but the $STATUS after SYNC
> returns isn't 123.  It's 123 OR-ed with %x10000000.  This
> is not what I expected.  And that contradicts the OpenVMS
> DCL Dictionary, N-Z:
> 
>  From DCL II-490:
> ...
> Description:
> ...
> The completion status form the SYCNHRONIZE command is that
> same as the completion status of the last command executed
> in the job.

But for practical purposes it *is* the same. You can .and. it with
%0fffffff if you want to get rid of the leading 1.

But why is this a problem? The leading 1 is just the inhibit-display
bit, which is documented somewhere in the VMS Doc Set, though I
usually look up the status code breakdown in Hoff and Paul's book
"Writing Real Programs in DCL" (p. 92).

> 2.
> I'm getting an error message for status 124 or maybe 122
> (DEVNOTMOUNT) even though I exit with 123.  Why is that
> hapenning?

I don't see your point here. But...

$ WRITE SYS$OUTPUT F$MESSAGE("122")
%SYSTEM-E-DEVNOTMOUNT, device is not mounted
$ WRITE SYS$OUTPUT F$MESSAGE("123")
%SYSTEM-I-DEVNOTMOUNT, device is not mounted
$ WRITE SYS$OUTPUT F$MESSAGE("124")
%SYSTEM-F-DEVNOTMOUNT, device is not mounted

And up above it looks like you are indeed getting 123 (though I doubt
any command will actually give status 123 -- you'd get 124 instead if
you try to dismount a device that is not mounted).
0
spamsink2001 (3130)
6/23/2004 1:54:08 PM
In article <10dhnv9td54v249@corp.supernews.com>, Z <z@no.spam> writes:
> Isn't $SYNCHRONIZE supposed to set $STATUS to the $STATUS from
> the batch job?  See below ...  why am I getting the error message
> for exit status 124 (not 123) and why is $STATUS being OR-ed with
> %x10000000 ?
> 
> 
> 
> $ type 15sec.com
> $ wait 00:00:15
> $ exit 123
> 
> $ submit 15sec.com
> Job 15SEC (queue SYS$BATCH, entry 607) started on SYS$BATCH
> 
> $ sync/entry=607
> Job 15SEC (queue SYS$BATCH, entry 607) completed
> %SYSTEM-I-DEVNOTMOUNT, device is not mounted
> 
> $ write sys$output $STATUS
> %X1000007B

Differing $SEVERITYs for the same event to be used at the discretion
of the programmer - note the -F-, -E-, -I-, and -S- below

A$ $ write sys$output f$mess(124) 
%SYSTEM-F-DEVNOTMOUNT, device is not mounted
A$ $ write sys$output f$mess(123)
%SYSTEM-I-DEVNOTMOUNT, device is not mounted
A$ $ write sys$output f$mess(122)
%SYSTEM-E-DEVNOTMOUNT, device is not mounted
A$ $ write sys$output f$mess(121)
%SYSTEM-S-DEVNOTMOUNT, device is not mounted

I suspect the inhibit bit is being set since the status is not indicative
of the result of an event that occurs in the job where it is being set -
this will prevent the associated error message from being displayed
should the SYNC be followed by an EXIT.
0
mckinneyj (41)
6/23/2004 2:29:47 PM
In article <224291b.0406230422.28b7bf74@posting.google.com>, martinkirby12@yahoo.co.uk (Martin Kirby) writes:
> Z> I have 2 problems:
>> 
>> 1.
>> The batch jobs exits with 123 but the $STATUS after SYNC
>> returns isn't 123.  It's 123 OR-ed with %x10000000.  This
>> is not what I expected.  
>> 
> 
> Somewhat unexpected. The bit is set by the function that outputs
> a message to indicate that it has already been output and shouldn't
> be output again. Sounds like either the documentation is wrong or there
> is a bug.

It _was_ output - to SYS$OUTPUT of the detached process.
Checking in the accounting file should find that bit set.
0
Kilgallen (2738)
6/23/2004 4:05:08 PM
On 23 Jun 2004 10:05:08 -0600, Kilgallen@SpamCop.net (Larry Kilgallen)
wrote:

>In article <224291b.0406230422.28b7bf74@posting.google.com>, martinkirby12@yahoo.co.uk (Martin Kirby) writes:
>> Z> I have 2 problems:
>>> 
>>> 1.
>>> The batch jobs exits with 123 but the $STATUS after SYNC
>>> returns isn't 123.  It's 123 OR-ed with %x10000000.  This
>>> is not what I expected.  
>>> 
>> Somewhat unexpected. The bit is set by the function that outputs
>> a message to indicate that it has already been output and shouldn't
>> be output again. Sounds like either the documentation is wrong or there
>> is a bug.
>
>It _was_ output - to SYS$OUTPUT of the detached process.
>Checking in the accounting file should find that bit set.

It is clear that, having collected the final status (from the job
controller, I guess, as the command invokes QUEMAN.EXE), the SYNCHRONIZE
code then deliberately sets that bit so that when *it* exits with the same
status value, no message is displayed, but the user can proceed to examine
$status.

There is no other way of distinguishing messages from the command itself,
and messages from the process that the command is targetting, otherwise.
Although one might argue for an additional qualifier on SYNCHRONIZE to force
it to exit with exactly the same status on demand (some users might think it
"nice" to see how the batch job exited, and I can see their point).

-- 
Hello this is 911, If you're reporting a murder, press 1... 

Mail john rather than nospam...
0
nospam71 (197)
6/23/2004 5:20:37 PM
In article <6iejd0hdjfb5vlkddu14svjgdci0udjj4b@4ax.com>, John Laird <nospam@laird-towers.org.uk> writes:

> Although one might argue for an additional qualifier on SYNCHRONIZE to force
> it to exit with exactly the same status on demand (some users might think it
> "nice" to see how the batch job exited, and I can see their point).

	$ ON WARNING THEN EXIT $STATUS .OR. %X0fffffff

0
Kilgallen (2738)
6/23/2004 7:42:20 PM
On 23 Jun 2004 13:42:20 -0600, Kilgallen@SpamCop.net (Larry Kilgallen)
wrote:

>In article <6iejd0hdjfb5vlkddu14svjgdci0udjj4b@4ax.com>, John Laird <nospam@laird-towers.org.uk> writes:
>
>> Although one might argue for an additional qualifier on SYNCHRONIZE to force
>> it to exit with exactly the same status on demand (some users might think it
>> "nice" to see how the batch job exited, and I can see their point).
>
>	$ ON WARNING THEN EXIT $STATUS .OR. %X0fffffff

I was thinking more of the occasions when you invoke SYNCHRONIZE
interactively.  But yes, wrapped in DCL that will do the job.

-- 
Do the impossible and your boss will add it to your duties. 

Mail john rather than nospam...
0
nospam71 (197)
6/23/2004 9:22:09 PM
John Laird <nospam@laird-towers.org.uk> wrote in message news:<6iejd0hdjfb5vlkddu14svjgdci0udjj4b@4ax.com>...
> On 23 Jun 2004 10:05:08 -0600, Kilgallen@SpamCop.net (Larry Kilgallen)
> wrote:
> 
> >In article <224291b.0406230422.28b7bf74@posting.google.com>, martinkirby12@yahoo.co.uk (Martin Kirby) writes:
> >> Z> I have 2 problems:
> >>> 
> >>> 1.
> >>> The batch jobs exits with 123 but the $STATUS after SYNC
> >>> returns isn't 123.  It's 123 OR-ed with %x10000000.  This
> >>> is not what I expected.  
> >>> 
> >> Somewhat unexpected. The bit is set by the function that outputs
> >> a message to indicate that it has already been output and shouldn't
> >> be output again. Sounds like either the documentation is wrong or there
> >> is a bug.
> >
> >It _was_ output - to SYS$OUTPUT of the detached process.
> >Checking in the accounting file should find that bit set.
> 
> It is clear that, having collected the final status (from the job
> controller, I guess, as the command invokes QUEMAN.EXE), the SYNCHRONIZE
> code then deliberately sets that bit so that when *it* exits with the same
> status value, no message is displayed, but the user can proceed to examine
> $status.
> 
> There is no other way of distinguishing messages from the command itself,
> and messages from the process that the command is targetting, otherwise.
> Although one might argue for an additional qualifier on SYNCHRONIZE to force
> it to exit with exactly the same status on demand (some users might think it
> "nice" to see how the batch job exited, and I can see their point).

Example run on VMS v6.2:

$ SYNC/ENT=0
%JBC-E-NOSUCHENT, no such entry
$ SH SYM $STATUS
  $STATUS == "%X100481DA"

$ TYPE NOENT.COM
$ SHOW ENT 0

$ SUBMIT NOENT/AFTER="+::15"
Job NOENT (queue ABCDE$QUE, entry 774) holding until 23-JUN-2004 18:27
$ SYNC/ENT=774
$ SH SYM $STATUS
  $STATUS == "%X100481DA"

In this case, the only way I found to distinguish the two cases is to
capture the message sent to SYS$ERROR.

I made a comprehensive study of all such possibilities including
things like job deleted before execution, queue being reset, notify
job being killed by the $FORCEX service, delete/entry for the target
or notify job, etc., and wrote a DCL program called NOTIFY.COM. AFAIK,
NOTIFY.COM correctly distinguishes between target job errors and
notify job errors for all cases. (Bug reports are welcome!) It was
written for interactive use, however, but could be modified to work in
batch mode.

The purpose of NOTIFY.COM is to submit a batch job that watches a
target job that either is running under another username or is running
without /NOTIFY. The job then uses REPLY or MAIL to send a message to
your terminal when the watched job completes. This message tells you
the final status of the target job or gives an error message for
itself if it encounters a problem.

NOTIFY.COM is freeware on the freeware CD v6. I can email a copy to
anyone if they like. Send requests to spamsink2001@yahoo.com.
0
spamsink2001 (3130)
6/23/2004 10:50:22 PM
John Laird <nospam@laird-towers.org.uk> wrote in message news:<ssmid0lf1thpcajcu0t9j8nkbp1p0e277s@4ax.com>...
> On Tue, 22 Jun 2004 19:58:47 -0700, Z <z@no.spam> wrote:
> 
> >I have 2 problems:
> >
> >1.
> >The batch jobs exits with 123 but the $STATUS after SYNC
> >returns isn't 123.  It's 123 OR-ed with %x10000000.  This
> >is not what I expected.  And that contradicts the OpenVMS
> >DCL Dictionary, N-Z:
> >
> > From DCL II-490:
> >...
> >Description:
> >...
> >The completion status form the SYCNHRONIZE command is that
> >same as the completion status of the last command executed
> >in the job.
> >
[...]
> 
> Perhaps the documentation is not explaining things very well, but it is not
> as incorrect as you perhaps perceive.  The status value is made up of
> several bit-fields.  The lowest 3 bits are the severity.  Any one "status"
> can thus have up to 8 different levels.  They include values that translate
> to -I-, -W-, -S-, -E-, -F- as seen in typical messages.  Odd values are
> "true", even values "false".  There are then bit-fields for the actual
> message number itself, the facility within which that message is meaningful,
> and finally (in the highest bits), 4 bits that control message output.  In
> this last nibble, the low bit suppresses output when set (it's the only
> defined bit in fact).  Thus, any values that start with 1 (in hex) do not
> display.  You can see this from your SYNCHRONIZE examples.  It is open to
> debate whether this is a good thing or not, but at least it means you will
> only get an error message when you have entered an erroneous SYNCHRONIZE
> command.  Suppose you misspelt it - you will get %DCL-W-IVVERB, unrecognized
> command verb, etc.  How could you distinguish this case from your batch job
> itself dying due to a misspelt command, if they both yielded the same
> message on-screen ?

Unfortunately, there are exceptions:

Example run on VMS v6.2:

$ TYPE SHSYM.COM
$ SHOW SYM ASDF

$ @SHSYM
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
$ SH SYM $STATUS
  $STATUS == "%X00038140"

$ SUBMIT SHSYM /AFTER="+::15"
Job SHSYM (queue ABCDE$QUE, entry 787) holding until 23-JUN-2004 20:04
$ SYNC/ENT=787
%CLI-W-UNDSYM, undefined symbol - check validity and spelling
$ SH SYM $STATUS
  $STATUS == "%X10038140"
$

For some reason, the inhibit-display bit doesn't get set for some
commands. And this causes the SYNC command to display the error
message when it shouldn't. But another weird thing is that %DCL
somehow got transformed to %CLI. Anyone know why?

> In general, to properly handle status values within DCL, you should mask off
> the low 3 bits and the high 4 bits, or use F$MESSAGE to extract the field
> you are interested in.  (In fact, the help for F$MESSAGE has an example
> involving SYNCHRONIZE !)

Well, that depends on exactly you want to do. 

JMHO
0
spamsink2001 (3130)
6/24/2004 12:14:25 AM
Z wrote:
> 
> David J Dachtera wrote:
> >>Isn't $SYNCHRONIZE supposed to set $STATUS to the $STATUS from
> >>the batch job?  See below ...  why am I getting the error message
> >>for exit status 124 (not 123) and why is $STATUS being OR-ed with
> >>%x10000000 ?
> >>
> >>$ type 15sec.com
> >>$ wait 00:00:15
> >>$ exit 123
> >>
> >>$ submit 15sec.com
> >>Job 15SEC (queue SYS$BATCH, entry 607) started on SYS$BATCH
> >>
> >>$ sync/entry=607
> >>Job 15SEC (queue SYS$BATCH, entry 607) completed
> >>%SYSTEM-I-DEVNOTMOUNT, device is not mounted
> >>
> >>$ write sys$output $STATUS
> >>%X1000007B
> >
> >
> > DJAS01::DDACHTERA$ a = 123
> > DJAS01::DDACHTERA$ sh sym a
> >   A = 123   Hex = 0000007B  Octal = 00000000173
> >
> > Get the idea?
> 
> I'm not sure what you're getting at ... yes, I understand
> that 7Bh is 123.  But that's not my problem.
> 
> I have 2 problems:
> 
> 1.
> The batch jobs exits with 123 but the $STATUS after SYNC
> returns isn't 123.  It's 123 OR-ed with %x10000000.  This
> is not what I expected.  And that contradicts the OpenVMS
> DCL Dictionary, N-Z:
> 
>  From DCL II-490:
> ...
> Description:
> ...
> The completion status form the SYCNHRONIZE command is that
> same as the completion status of the last command executed
> in the job.

Well, technically, the doc. is correct. There's just somethings you
can't take for granted.

I usually test that (&$STATUS .AND. %X7FFFFFFF) .EQ. some_value because
that tests only the part of the $STATUS bitmask that I'm interested in.

> 2.
> I'm getting an error message for status 124 or maybe 122
> (DEVNOTMOUNT) even though I exit with 123.  Why is that
> hapenning?

Because of what VMS calls "severity". It's in the low-order three bits
of the status code:

$STATUS .AND. 7 .EQ. 0	-W-	WARNING
$STATUS .AND. 7 .EQ. 1	-S-	SUCCESS
$STATUS .AND. 7 .EQ. 2	-E-	ERROR
$STATUS .AND. 7 .EQ. 3	-I-	INFORMATIONAL
$STATUS .AND. 7 .EQ. 4	-F-	SEVERE_ERROR

You'll also find it in $SEVERITY, until the next that command changes it
and $STATUS. Severities 5 thru 7 are currently undefined.

So, yes, odd $STATUS is success (-S- or -I-), even $STATUS is not
success (-W-, -E- or -F-).

VMS Error messages look like this:

%facility_name-severity-message_ident, message_text

These correspond to:

$ SET MESSAGE/[NO]FACILITITY/[NO]SEVERITY/[NO]IDENT/[NO]TEXT

See HELP SET MESSAGE.

D.J.D.
0
6/24/2004 1:24:06 AM
John Laird <nospam@laird-towers.org.uk> wrote in message news:<62tjd09blqssjo33etogd56m87kt44vfu8@4ax.com>...
> On 23 Jun 2004 13:42:20 -0600, Kilgallen@SpamCop.net (Larry Kilgallen)
> wrote:
> 
> >In article <6iejd0hdjfb5vlkddu14svjgdci0udjj4b@4ax.com>, John Laird <nospam@laird-towers.org.uk> writes:
> >
> >> Although one might argue for an additional qualifier on SYNCHRONIZE to force
> >> it to exit with exactly the same status on demand (some users might think it
> >> "nice" to see how the batch job exited, and I can see their point).
> >
> >	$ ON WARNING THEN EXIT $STATUS .OR. %X0fffffff
> 
> I was thinking more of the occasions when you invoke SYNCHRONIZE
> interactively.  But yes, wrapped in DCL that will do the job.

But you need to change .OR. to .AND.
0
spamsink2001 (3130)
6/24/2004 2:34:06 AM
Reply: