ADSM-L

Re: [ADSM-L] API for TSM Admin commands

2010-11-08 14:20:21
Subject: Re: [ADSM-L] API for TSM Admin commands
From: Roger Deschner <rogerd AT UIC DOT EDU>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Mon, 8 Nov 2010 11:48:23 -0600
A lot of the worst problems with dsmadmc, such as commas within numbers
that are nice for human readability but trouble to parse, can be solved
by:

Change all QUERY commands to SELECT, and invoke dsmadmc with the -comma
or -tab options. This avoids all questions as to whether sqldisplaymode
wide is set, and writes all output as either comma or tab delimited
without wrapping.

Then redirect the output from the SELECT command to a file. It's
important to do this at the TSM SELECT command level, not the OS dsmadmc
command level, because the OS will collect a lot of junk lines you don't
want, such as column headings, version data, etc.

Build the select command as a TSM macro in a separate file, and invoke
it with a MACRO command on the dsmadmc command line. This avoids
problems of the redirection character > and other special characters
being interpreted and performed by the operating system on the dsmadmc
command line, which is not what you want. This also avoids problems with
misinterpretation of quote characters that are necessary in SQL syntax,
by either the OS or the scripting language. You could avoid using this
macro file by using enough OS command line escape characters to make it
work, but it's really ugly and tough to debug that way. I tried it once,
but by the time I was adding multiple escape characters to protect
escape characters, I was lost. Use a separate file; it's much easier.

So, there is a useable general-purpose API, even though it's a bit
clunky because it has to be used with two temporary files. You can build
the SELECT command exactly the way you want in one file, and then the
output file is a pure comma or tab delimited file with no junk lines
that your app can just read. These files cab be read directly with
facilities built into IBM SPSS, MS Excel, or many other apps.

Roger Deschner      University of Illinois at Chicago     rogerd AT uic DOT edu
====You will take a long journey. Remember to export your variables.====



On Sun, 7 Nov 2010, Richard Sims wrote:

>TSM is notoriously lacking in the area of APIs. There has never been an 
>administrative API, and the client API is incompatible with what the B/A 
>client produces. You have to make do with what you can perform via commands.
>
>    Richard Sims
>
>On Nov 7, 2010, at 2:34 PM, Maurice van 't Loo wrote:
>
>> Hi All,
>>
>> I'm thinking about an yatac (Yust Another TSM Admin Console), just
>> like the famous dsmadmc, but without the also famous problems as
>> comma's in q sess/proc, better ways of displaying table's, etc etc.
>> And if possible, without using the dsmadmc itself, as not everybody
>> does install it at the same location.
>>
>> Does anybody know if there is an API for admin command's? Or how to
>> use the dll of the dsmadmc if that is usefull.
>>
>> Thanks,
>> Maurice
>