ADSM-L

Re: Redirecting select statement output from a script

2005-06-02 08:58:40
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: Thu, 2 Jun 2005 08:58:23 -0400
Hi Matthew,

I can't say that I would know how to do that with select statements.  I'm
not sure if you can use if statements to print 0 if there are no matches
found. But, you could script something that would replace the "no matches"
with 0.

Hope this helps, maybe someone else has a better solution.

Jerico Pena
Backup Administrator





             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/02/2005 08:36
             AM


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






Hi Jerico,

Thanks for that - works a treat.
Now, some of the results I expect to be zero, but instead TSM reports
'ANR2034E SELECT: No Match found'.

Do you know how I can turn those results into a nice clean zero 0 for my
charts.

Many Thanks,
Mattheww





Jerico Pena <JPena AT STATESTREET DOT COM>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
02/06/2005 12:41
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






Hi,

To redirect the output of a select statement to a file,  you can write a
macro for the select statement and place the redirect symbol and filename
to redirect to at the end of the macro.   Then just call the macro and it
should work fine.

ie:

macro.mac:

Contents of macro.mac should look like this:

<BEGIN> select statement.................................. > filename
<END>

Good luck,

Jerico Pena
Backup Administrator




             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>                     [ADSM-L] Redirecting select
                                       statement output from a script

             06/02/2005 07:20
             AM


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






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.