ADSM-L

AW: define script problem

2004-03-26 10:35:33
Subject: AW: define script problem
From: Salak Juraj <j.salak AT ASAMER DOT AT>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 26 Mar 2004 16:39:41 +0100
Hi,
you are on the right path, it has to do with parameters parsing,
an issue common to all command line interpreteres, including tsm command
line.
You DEFINE SCRIPT command is interpreted as follows:

        parameter1=VAULTING 

        parameter2=select volume_name 
Why it end here? It is a string defined by pair of quotes.

        parameter3=Volumes 
        parameter4=to 
        etc. etc.

Solution: Tell the (dsmadmc) interpreter not to interpret some quotes, e.g.
those two:
                "Volumes to go offsite"
but to accept them as characters.

How to do it?
While many common shells accept an special character for it, e.g. backslash:

"select volume_name \"Volumes to go offsite\", voltype
as \"Volume Type\" from drmedia where state=\"MOUNTABLE \" order by
volume_name"    

would be in many shells interpreted like that (numbers mean character number
#) :

1 "     opening quote, defines begining of a string, 
        thus any space characters found within will NOT be interpreted as
delimiter
2  s    common character, pass it further as (a part of a ) string
3  e    common character, pass it further as (a part of a ) string
4  l    common character, pass it further as (a part of a ) string
5  e    common character, pass it further as (a part of a ) string
6  c    common character, pass it further as (a part of a ) string
7  t    common character, pass it further as (a part of a ) string
8       [space] normall parameter delimiter, but because quoted 
        it is common character, pass it further as (a part of a ) string
9  v    common character, pass it further as (a part of a ) string
10 o    common character, pass it further as (a part of a ) string
...     etc. etc.
21 \    backlash means: not to interpret the following character but accept
it as a common character
22 "    because of above, do not interpret as quote, only pass it further as
(a part of a ) string
23 V    common character, pass it further as (a part of a ) string
24 o    common character, pass it further as (a part of a ) string
25 l    common character, pass it further as (a part of a ) string
etc. etc.
115     common character, pass it further as (a part of a ) string
116 "   closing qoute, end of quoted string
117  [space] parameter delimiter, thus the above´s string is to be
understodd as end of one parameter


BUT I am afraid backslash 
does not work this way in dsmadmc interpreter, so you are to use quoting of
quotes instead:

"select volume_name """Volumes to go offsite""", voltype
as """Volume Type""" from drmedia where state="""MOUNTABLE """ order by
volume_name"    

Wait - I always have doubts about proper count of """ quotes,
While I guess I made a proper suggestion for this case,
play around, maybe """"" is to be used here instead :-)))

hope I was not annoying
Juraj







-----Ursprüngliche Nachricht-----
Von: Smith, Rachel [mailto:Rachel.Smith AT IRL.XEROX DOT COM]
Gesendet: Freitag, 26. März 2004 16:03
An: ADSM-L AT VM.MARIST DOT EDU
Betreff: define script problem


Hi,

I am trying to create a script that will produce a list of media to send
offsite.
I defined a script:
DEFINE SCRIPT VAULTING "select volume_name "Volumes to go offsite", voltype
as "Volume Type" from drmedia where state="MOUNTABLE " order by volume_name"
desc="Create vault lists"
And it fails with:  ANR2023E DEFINE SCRIPT: Extraneous parameter

I know it is something to do with the double quotes, but I also tried single
quotes but it failed with the same error.
Could someone tell me what I'm missing.

Thanks again.

<Prev in Thread] Current Thread [Next in Thread>
  • AW: define script problem, Salak Juraj <=