ADSM-L

Re: Another select question

2000-02-28 12:42:03
Subject: Re: Another select question
From: Miles Purdy <PURDYM AT NISA.GC DOT CA>
Date: Mon, 28 Feb 2000 11:42:03 -0600
This isn't exactly what you ask for, but it does accomplish the same thing. 
This is a UNIX script, you may be able to modify it. This will print any errors 
since I last logged in. The important line is the 'dsmadmc' command.

miles

#!/bin/ksh
# Scan the Error log file for new errors
# If it doesn't exist, create a control file

CONTROL_FILE=.adsmlog
SEP="-----------------------------------------------------------------------"
if [[ ! -f ~/$CONTROL_FILE ]]
if [[ ! -f ~/$CONTROL_FILE ]]
then
   echo "010900002000" >~/$CONTROL_FILE
fi

# Read the date from the control file
cat ~/$CONTROL_FILE | read TIME
MONTH=`echo $TIME | cut -c -2`
DAY=`echo $TIME | cut -c 3-4`
HOUR=`echo $TIME | cut -c 5-6`
MINUTE=`echo $TIME | cut -c 7-8`
YEAR=`echo $TIME | cut -c 9-12`

NEWTIME="$DAY/$MONTH/$YEAR $HOUR:$MINUTE"

# List errors from the control date forward
dsmadmc -id=query -password=query q actlog begind="$MONTH/$DAY/$YEAR" 
begint="$HOUR:$MINUTE" | grep -E 
"^.*ANR[0-9][0-9][0-9][0-9]E|^.*ANR[0-9][0-9][0-9][0-9]W" >/tmp/$CONTROL_FILE.$$

echo $(date +%m%d%H%M%Y) >~/$CONTROL_FILE
echo "--------------- ADSM Server Errors since $NEWTIME -------------"
cat /tmp/$CONTROL_FILE.$$ | cut -c 12-
echo $SEP
rm /tmp/$CONTROL_FILE.$$
exit 0



-------------------------------------------------------------------------------------------
----------------
Miles Purdy, System Manager
Miles Purdy, System Manager
purdym AT nisa.gc DOT ca
Net Income Stabilization Account
Winnipeg, MB, CA
(204) 984-1602


>>> "Dana Mitchell;" <Dana.Mitchell AT ING-DM DOT COM> 28-Feb-00 11:26:51 AM >>>
Hello,

I am working on coding SELECT commands to display errors from clients.  I
would like to get just the errors from the last 24 hours but I can't get it
to work.  This is with TSM 3.7.0 under OS/390.  I have tried various
combinations such as:

SELECT DATE_TIME, MESSAGE, NODENAME, SEVERITY -
FROM ACTLOG -
WHERE NODENAME IS NOT NULL AND -
SEVERITY = 'E' AND -
(DATE_TIME = (CURRENT_TIMESTAMP)DATE OR -
 DATE_TIME = (CURRENT_TIMESTAMP)DATE - 1)



and I can't find a way to get it to work without hard coding the date and
time.  Does anyone have any suggestions or examples of this type of code?

Thanks in advance
Dana
<Prev in Thread] Current Thread [Next in Thread>