ADSM-L

Re: When Defining Script ...

2005-01-28 00:36:26
Subject: Re: When Defining Script ...
From: Andrew Raibeck <storman AT US.IBM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 27 Jan 2005 22:36:01 -0700
It looks to me like the quoting is at issue. With a mixture of double and
single quotes in the SELECT statement itself, it gets tricky when you have
to surround the command with another set of quotes to satisfy the DEFINE
SCRIPT syntax.

In this situation, use two pairs of double quotes instead of one pair of
double quotes around the double-quoted elements in the SELECT statement,
i.e.:

define script sessioninfo
   "select cast(session_id as decimal(7,0)) as ""Session"",
   client_name as ""Client"",
   cast(left(client_platform,10) as char(10)) as ""Platform"",
   cast(left(state,5) as char(5)) as ""State"",
   cast(wait_seconds as decimal(9,0)) as ""Wait secs"",
   time(start_time) as ""Start time"",
   cast(bytes_received/1024/1024 as decimal(10,2)) as ""MBytes rcvd"",
   cast(bytes_received/1024/cast((current_timestamp-start_time)seconds
      as decimal(10,0)) as decimal(7,2)) as ""KB/Sec""
   from sessions where session_type='Node'" description='session info'

Regards,

Andy

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.

"ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU> wrote on 2005-01-27
12:51:48:

> Hello,
>
> Yesterday Guillaume Gilbert posted some very nice select statements.  Of
> course I am always looking out for cool statements. BTW thx for that.
>
> As I found it worthy.. I decided to added it to the TSM server.
>
> define script sessioninfo "select cast(session_id as decimal(7,0)) as
> "Session", client_name as "Client", cast(left(client_platform,10) as
> char(10)) as "Platform", cast(left(state,5) as char(5)) as "State",
> cast(wait_seconds as decimal(9,0)) as "Wait secs", time(start_time) as
> "Start time",cast(bytes_received/1024/1024 as decimal(10,2)) as "MBytes
> rcvd",
cast(bytes_received/1024/cast((current_timestamp-start_time)seconds
> as decimal(10,0)) as decimal(7,2)) as "KB/Sec" from sessions where
> session_type='Node'" description='session info'
>
> When I ran this command I kept getting code 3.   ANS8001I.  No info.
found
> on help.
>
> After I tried for a while I decided to use the file method.
> Created a file called sessioninfo with just the select statement inside
of
> it.
>
> define script sessioninfo file=/home/sunglee/sessioninfo
> description='session info' and worked.
>
> Now if I understood correctly.. there is a limit on how long the line
can
> be if you are doing remote dsmadmc.  Since I am using it locally there
> shouldn't be any limit... or is there?
> What am I do wrong?  Thanks,
>
>
> Sung Y. Lee

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