ADSM-L

Re: MVS select statement

2003-07-07 10:24:27
Subject: Re: MVS select statement
From: Andrew Raibeck <storman AT US.IBM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Mon, 7 Jul 2003 08:23:53 -0600
AND has precendence over OR, so your "where" criteria are being evaluated
like this:

   where cond1 OR (cond2 AND cond3)

In your case, "cond1" is for the messages of severity 'E', so those are
displayed regardless of the date.

Put parentheses around the ORed conditions to fix the problem:

   where (cond1 OR cond2) AND cond3

i.e.

   select date_time, msgno, message
      from actlog
      where (severity='E' or severity='W')
      and date_time>(current_timestamp-(1 day))

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: storman AT us.ibm DOT com

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.




Joni Moyer <joni.moyer AT HIGHMARK DOT COM>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
07/07/2003 07:14
Please respond to "ADSM: Dist Stor Manager"


        To:     ADSM-L AT VM.MARIST DOT EDU
        cc:
        Subject:        MVS select statement



Hello all!

I have been trying to set up a select statement to look for all of the
error and warning messages within the past 24 hours.  Here is what I have
come up with:

select date_time, msgno, message
   from actlog
   where severity='E' or severity='W'
   and date_time>(current_timestamp-(1 day))

My problem is that it goes through the entire 14 days of the activity log
that I have and ignores the last statement.  Any suggestions?

Thanks in advance!!!


**************************************
             Joni Moyer
     Systems Programmer
   joni.moyer AT highmark DOT com
          (717)975-8338

<Prev in Thread] Current Thread [Next in Thread>