ADSM-L

Re: Redirecting select statement output from a script

2005-06-03 08:20:54
Subject: Re: Redirecting select statement output from a script
From: Jerico Pena <JPena AT STATESTREET DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 3 Jun 2005 08:20:43 -0400
If you write a script to either create the macro and use it every time, or
simply have the macro in the directory of dsmadmc then you can get the
information you need just as easily.  I don't know of a way to script this
through TSM but externally you could do it.  (I use Perl).

It works perfect.

Jerico Pena
Backup Administrator
State Street Corporation
617-985-0705




             Matthew Large
             <Matthew.Large@av
             iva.com>                                                   To
             Sent by: "ADSM:           ADSM-L AT vm.marist DOT edu
             Dist Stor                                                  cc
             Manager"
             <[email protected]                                     Subject
             .edu>                     Re: [ADSM-L] Redirecting select
                                       statement output from a script

             06/03/2005 03:43
             AM


             Please respond to
             "ADSM: Dist Stor
                 Manager"
             <[email protected]
                   .edu>






Cheers Andy,

I had my suspicions..

Looks like it's back to admin schedules running an external script which
logs in - other peoples suggestions of macros are no good - you can't
schedule their execution.

Regards,
Matthew





Andrew Raibeck <storman AT US.IBM DOT COM>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
02/06/2005 15:11
Please respond to
"ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>


To
ADSM-L AT VM.MARIST DOT EDU
cc

Subject
Re: [ADSM-L] Redirecting select statement output from a script






I don't think that redirection is supported during the execution of a
script, which is why Matthew's original error occurred.

Yes, the issues regarding redirection from within the Admin CLI are that
it is not easy to distinguish when '>' is for redirection versus "greater
than". When redirecting from the Admin CLI, you need one or more spaces
before and after the '>'. Using a trivial example:

INCORRECT:
   select node_name from nodes>sel.out
   select node_name from nodes >sel.out
   select node_name from nodes> sel.out

CORRECT:
   select node_name from nodes > sel.out

You need to be careful when mixing "greater than" with redirection:

INCORRECT:
   select node_name from nodes where client_version > 3 > sel.out

CORRECT:
   select node_name from nodes where client_version>3 > sel.out
   select node_name from nodes where client_version >3 > sel.out
   select node_name from nodes where client_version> 3 > sel.out

When you intend to use '>' to mean "greater than" while running in batch
mode, i.e.:

   dsmadmc -id=blah -pa=blech <select statement>

then you might run into operating system command line interpreter issues,
where the interpreter wants to always view the '>' as redirection. In this
case, put quotes around the entire statement:

   dsmadmc -id=blah -pa=blech "select node_name from nodes where
client_version>3"

And to redirect to a file:

   dsmadmc -id=blah -pa=blech "select node_name from nodes where
client_version>3" > sel.out

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-06-02
06:28:39:

> Hi Matthew
>
>
> I notice you have a space after the '>'.  I remember a discussion on how
> the
> '> redirect' gets confused with '> greater than'  and the (rather vague)
> solution
> was to interpret the space after the '>' as an indicator that this was a
>
> greater than, and not a redirect... hence the illegal sql operator
> message.
>
> Try dropping the space.. maybe.
>
>
> Someone who recognises this 'feature' could possibly correct me on its
> actual
> usage.
>
>
> Regards,
>
> David le Blanc
>
> --
> Senior Technical Specialist
> I d e n t i t y   S o l u t i o n s
>
> Level 1, 369 Camberwell Road, Melbourne, Vic 3124
> Ph 03 9813 1388 Fax 03 9813 1688 Mobile 0417 595 550
> Email david.leblanc AT identity-solutions.com DOT au
>
> -----Original Message-----
> From: Matthew Large [mailto:Matthew.Large AT AVIVA DOT COM]
> Sent: Thursday, 2 June 2005 9:21 PM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: [ADSM-L] Redirecting select statement output from a script
>
> Hi chaps/chappesses,
>
> I've had a look in the archives, and there doesn't seem to be an
> immediate solution to this one, so please help!
> I'm trying to redirect the output of a script containing select
> statements to a file in the file system. I can see that the redirect
> works from the command line but from within scripts I just get errors.
>
> tsm: TSML003A>run large_monitor
> ANR2907E Unexpected SQL operator token - '>'.
>
>                                                            |
>          ..................................................V............
>          from occupancy where stgpool_name='APPS_DISKPOOL' > stgdisk.txt
>
> ANR2907E Unexpected SQL operator token - '>'.
>
> I've also tried with double right-angled bracket, without success.
> The Quickfacts state there is no escape character to render it
> 'unspecial', but that was written a while ago, perhaps there is now a
> way?
>
>
> Thanks
> Matthew
>
>
>
>
> Aviva plc
> Registered Office: St. Helen's, 1 Undershaft, London EC3P 3DQ Registered
> in England Number 02468686 www.aviva.com
>
> This message and any attachments are confidential.
> If you are not the intended recipient, please telephone or e-mail the
> sender and delete this message and any attachment from your system.
> Also, if you are not the intended recipient you must not copy this
> message or attachment or disclose the contents to any other person.





Aviva plc
Registered Office: St. Helen's, 1 Undershaft, London EC3P 3DQ
Registered in England Number 02468686
www.aviva.com

This message and any attachments are confidential.
If you are not the intended recipient, please telephone
or e-mail the sender and delete this message and any
attachment from your system. Also, if you are not the
intended recipient you must not copy this message or
attachment or disclose the contents to any other person.