ADSM-L

Re: non-tivoli script calls, problems with narrow select....

2002-09-12 09:45:37
Subject: Re: non-tivoli script calls, problems with narrow select....
From: David Stabler <dstabler AT MORRISONHOMES DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 12 Sep 2002 09:34:32 -0400
Stupid User Tricks!!!!

When passing the doublequote to a process, like select, make sure you
send it quoted (usually with the backslash).

Thus
    dsmadmc .... 'select cast(process as char(30)) as "X..."  '
works, but
    dsmadmc ... "select cast(process as char(30)) as "X...." "
doesn't.  The "XXX" turns into XXX when the whole thing is just
doublequoted, instead of single.  And, since XXX is not an SQL token, I
get the strange 18column error.....stupid me.  Thanks for all your help!
 I hope this helps someone else in the future.

For the record, the command I'm running is

${CMD} \
 'select cast(process_num as decimal(8,0)) as "procid",
          substr(cast(START_TIME as varchar(26)),6,14) as "Start",
          substr(cast(current_timestamp - start_time
              as varchar(17)),3,8) as "Elapsed",
          cast(process as char(40))
              as "Process_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  from processes  ' | \
  tail +13 | \
  egrep -v -e "^ANS|^[ ]*$"

which gives me just want I need.  (As you may guess, CMD is set to the
dsmadmc command with userid and password).

-drs-

David Stabler, CATE/AIX, CNCE
Senior Systems Analyst

>>> seay_pd AT NAPTHEON DOT COM 09/12/02 02:50AM >>>
Try this, works for me:

select cast(process as char(30)) as "XXXXXXXXXXXXXXXXXXXXXXXXXXX" from
processes

XXXXXXXXXXXXXXXXXXXXXXXXXXX
---------------------------
Backup Storage Pool

Backup Storage Pool

Backup Storage Pool

Move Data

Backup Storage Pool

Backup Storage Pool

Backup Storage Pool

Backup Storage Pool

Backup Storage Pool

Backup Storage Pool

Move Data

Move Data

Backup Storage Pool

Paul D. Seay, Jr.
Technical Specialist
Naptheon Inc.
757-688-8180


-----Original Message-----
From: David Stabler [mailto:dstabler AT MORRISONHOMES DOT COM]
Sent: Wednesday, September 11, 2002 4:05 PM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: non-tivoli script calls, problems with narrow select....


I've been looking at old messages in adsm.org, but haven't seen a
satisfactory answer to my problem...

I'm writing a shell script to look at the processes running on the
system.
When I select process from processes, the width is set at 18
characters.  If
I cast it larger, nothing seems to happen.  If I select as
"XXXXXXXXXX"
where "X" is repeated 18+N (N>0) times, I get an error stating it can't
be
larger than 18 characters wide....

Is there a satisfactory way (no, creating individual scripts to "run"
for
each command with wide output isn't acceptable, I'm afraid) to make
this
happen?  I can't make the sqldisplaymode stick, as it is session bound,
but
that's the functionality I need to duplicate.

Thanks!

-drs-

David Stabler, CATE/AIX, CNCE
Senior Systems Analyst

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