Date: Tue, 8 Apr 2008 09:05:14 -0400
Reply-To: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject: Re: Finding the highest and lowest obs
In-Reply-To: <000001c89977$a3e8a570$ebb9f050$@com>
Content-Type: text/plain; charset="us-ascii"
Lizette:
The SAS Proc SQL MIN and MAX summary functions will give you lowest and
highest time values if you group by whatever name you have for the
message ID:
e. g.,
...
select MAX(time) as maxTime,MIN(time) as minTime
from sampleData
group by ID
;
S
-----Original Message-----
From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]
On Behalf Of Lizette Koehler
Sent: Tuesday, April 08, 2008 8:54 AM
To: 'SAS(r) Discussion'
Subject: Finding the highest and lowest obs
I have a SAS dataset that holds a time stamp and msg. I need the
highest and lowest times for each message so I can determine which
process too several minutes instead of seconds. What is the best way to
code this?
Sample Data
02:34:42 ETRX671I COMPLETION CHECK COPYING PRODUCT MYVV01 TO TRX001
02:34:43 ETRX673I ITEMS REMAINING TO BE COPIED: 1381
02:34:48 ETRX673I ITEMS REMAINING TO BE COPIED: 1381
02:34:53 ETRX673I ITEMS REMAINING TO BE COPIED: 1311
02:34:58 ETRX673I ITEMS REMAINING TO BE COPIED: 1311
02:35:03 ETRX673I ITEMS REMAINING TO BE COPIED: 1089
02:35:08 ETRX673I ITEMS REMAINING TO BE COPIED: 1039
02:35:13 ETRX673I ITEMS REMAINING TO BE COPIED: 1038
02:35:18 ETRX673I ITEMS REMAINING TO BE COPIED: 995
02:35:20 ETRX673I ITEMS REMAINING TO BE COPIED: 993
02:35:22 ETRX673I ITEMS REMAINING TO BE COPIED: 989
02:35:24 ETRX673I ITEMS REMAINING TO BE COPIED: 985
02:35:26 ETRX673I ITEMS REMAINING TO BE COPIED: 981
02:35:28 ETRX673I ITEMS REMAINING TO BE COPIED: 978
02:35:30 ETRX673I ITEMS REMAINING TO BE COPIED: 977
02:35:32 ETRX673I ITEMS REMAINING TO BE COPIED: 977
02:57:37 ETRX671I COMPLETION CHECK COPYING PRODUCT MYVVB6 TO TRX297
02:57:37 ETRX673I ITEMS REMAINING TO BE COPIED: 0
02:57:37 ETRX671I COMPLETION CHECK COPYING PRODUCT MYVVB7 TO TRX298
02:57:37 ETRX673I ITEMS REMAINING TO BE COPIED: 0
02:57:37 ETRX671I COMPLETION CHECK COPYING PRODUCT MYVVB8 TO TRX299
02:57:37 ETRX673I ITEMS REMAINING TO BE COPIED: 0
I can just select the data based on the ETRX673I part of the message. I
am hoping to get the high and low times from the sequence of message
that follows that message.
I am trying to find out how long it takes to copy products. I can also
code this by holding the current line, comparing the next with the
message. Just not sure what is the best coding technique.
My results will look something like this
Process Start End
Total Time
MYVV01 TO TRX001 02:34:42 02:35:32 50 Secs
MYVVB6 TO TRX297 02:57:37 02:57:37 <1 secs
MYVVB7 TO TRX298 02:57:37 02:57:37 <1 secs
MYVVB8 TO TRX299 02:57:37 02:57:37 <1 secs
Thanks very much.
Lizette