ADSM-L

Re: [ADSM-L] SV: [ADSM-L] "group by" assistance.

2009-10-22 13:56:17
Subject: Re: [ADSM-L] SV: [ADSM-L] "group by" assistance.
From: Shawn Drew <shawn.drew AT AMERICAS.BNPPARIBAS DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 22 Oct 2009 13:55:11 -0400
FYI, My colleague showed me how to do this in perl, so in case any one is 
interested: 

dsmadmc -id=USER -pa=PASS -datao=yes "select cast((bytes/1024/1024/1024) 
as decimal(8,2)), cast(end_time as date) from summary where 
activity='STGPOOL BACKUP'" | perl -e ' while (<>){ chomp; s/ +/ /sg; 
@a=split(/ /,$_); $H{$a[2]}= $H{$a[2]} + $a[1];  } foreach $x (sort keys 
%H ){ print "$x $H{$x}\n"; }'

It should work for any summary table activity.

Regards, 
Shawn
________________________________________________
Shawn Drew





Internet
Shawn DREW

Sent by: ADSM-L AT VM.MARIST DOT EDU
10/22/2009 10:39 AM
Please respond to
ADSM-L AT VM.MARIST DOT EDU


To
ADSM-L
cc

Subject
Re: [ADSM-L] SV: [ADSM-L] "group by" assistance.






That didn't work for me.  What version of TSM do you have?

Regards, 
Shawn
________________________________________________
Shawn Drew





Internet
cm AT CMOLDRUP DOT DK

Sent by: ADSM-L AT VM.MARIST DOT EDU
10/22/2009 03:01 AM
Please respond to
ADSM-L AT VM.MARIST DOT EDU


To
ADSM-L
cc

Subject
[ADSM-L] SV: [ADSM-L] "group by" assistance.






Hi Shawn

select sum(CAST((bytes/1024/1024/1024) as decimal(8,2))) AS "GB",
cast(end_time as date) as "Date" from summary where activity='STGPOOL
BACKUP' group by cast(end_time as date)

..would work

Regards
Carsten Moldrup

-----Oprindelig meddelelse-----
Fra: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] På vegne af 
Shawn
Drew
Sendt: 21. oktober 2009 23:20
Til: ADSM-L AT VM.MARIST DOT EDU
Emne: [ADSM-L] "group by" assistance.

I'm having some trouble with the group by clause.  It seems I can't group
data that has been "cast"ed

First start with:
select cast((bytes/1024/1024/1024) as decimal(8,2)) AS "GB", cast(end_time
as date) as "Date" from summary where activity='STGPOOL BACKUP'

                          1794.26     2009-10-19
                          1026.27     2009-10-19
                          1371.60     2009-10-20
                          1524.60     2009-10-20
                          1053.99     2009-10-21
                          1755.08     2009-10-21

As expected, it shows one line per process.  I would like to group these
by the date so we have a total amount of Gigabytes per day.
But when I add the "sum" and "group by" clauses, it doesn't change the
output:

select sum(CAST((bytes/1024/1024/1024) as decimal(8,2))) AS "GB",
cast(end_time as date) as "Date" from summary where activity='STGPOOL
BACKUP' group by end_time

                          1794.26     2009-10-19
                          1026.27     2009-10-19
                          1371.60     2009-10-20
                          1524.60     2009-10-20
                          1053.99     2009-10-21
                          1755.08     2009-10-21


Also, it doesn't let me group by "Date".  It needs to be grouped by the
"end_time"
Any ideas to produce what I'm looking for?


TSM 5.5.3 on AIX 6.1


Regards,
Shawn
________________________________________________
Shawn Drew
Data Protection Engineer
Core IT Production
BNP Paribas RCC, Inc.
Office:   201.850.6998
Mobile: 917.774.8141


This message and any attachments (the "message") is intended solely for
the addressees and is confidential. If you receive this message in error,
please delete it and immediately notify the sender. Any use not in accord
with its purpose, any dissemination or disclosure, either whole or 
partial,
is prohibited except formal approval. The internet can not guarantee the
integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will)
not therefore be liable for the message if modified. Please note that
certain
functions and services for BNP Paribas may be performed by BNP Paribas 
RCC,
Inc.