If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to display 'list application' without header?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-14-05, 01:19
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
How to display 'list application' without header?

Hi,

I would like to display 'list application' without header. Below sample returs applications with header.

Sample: db2 list application for database sample
Code:
Auth Id  Application    Appl.      Application Id                 DB       # of
         Name           Handle                                    Name    Agents
-------- -------------- ---------- ------------------------------ -------- -----
DBuser   db2bp.exe      3          *LOCAL.DB2.050214061106        SAMPLE   1
I would like to get only:
Code:
DBuser   db2bp.exe      3          *LOCAL.DB2.050214061106        SAMPLE   1
Is there any command to get result of 'list application' without header?

Thanks,
Grofaty
Reply With Quote
  #2 (permalink)  
Old 02-14-05, 02:37
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
AFAIK, you cannot using the command ...

You may try using the udfs to get the same output without headers
Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 02-14-05, 03:13
jacampbell jacampbell is offline
Registered User
 
Join Date: Jan 2005
Posts: 191
db2 list applications | grep -v "^Auth\|^--\|^ "

This does assume that you have a grep command available (ie you're using a *ix or have Windows with cygwin or have MKS etc)

James Campvell
Reply With Quote
  #4 (permalink)  
Old 02-14-05, 05:00
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
jacampbell,
thanks a lot! You gave me a super idea. I used 'find' instread of 'grep' so the command on Windows is:

db2 list application for database sample | find /v "Auth" | find /v "--" | find /v "Name"

Grofaty

Last edited by grofaty; 02-14-05 at 05:03.
Reply With Quote
  #5 (permalink)  
Old 02-14-05, 16:17
GertK GertK is offline
Registered User
 
Join Date: Nov 2003
Location: Netherlands
Posts: 96
Quote:
Originally Posted by grofaty
jacampbell,
thanks a lot! You gave me a super idea. I used 'find' instread of 'grep' so the command on Windows is:

db2 list application for database sample | find /v "Auth" | find /v "--" | find /v "Name"

Grofaty
Hi,
Another great standard available command is findstr. It also supports regular expressions.
Reply With Quote
  #6 (permalink)  
Old 02-14-05, 16:59
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
how about this:
Code:
db2 -x "select t.auth_id, t.appl_name, t.agent_id, t.appl_id, t.db_name, t.num_assoc_agents from table(snapshot_appl_info('ZZZ',-1)) t"

Last edited by n_i; 02-14-05 at 19:56.
Reply With Quote
  #7 (permalink)  
Old 02-15-05, 03:17
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

Thanks a lot, to all of you. I have solved my problem!
BTW, n_i: executing command above returns error:
Code:
SQL0440N  No function by the name "SNAPSHOT_APPL_INFO" having compatible
arguments was found in the function path.  SQLSTATE=42884
My system:
Windows XP SP2
DB2 v7.2 FP5

Thanks,
Grofaty

Last edited by grofaty; 02-15-05 at 03:22.
Reply With Quote
  #8 (permalink)  
Old 02-15-05, 09:25
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Snapshot functions are only available in v8.
Reply With Quote
  #9 (permalink)  
Old 02-15-05, 11:55
chavadb2 chavadb2 is offline
Registered User
 
Join Date: Aug 2004
Posts: 138
Quote:
Originally Posted by grofaty
Hi,

Thanks a lot, to all of you. I have solved my problem!
BTW, n_i: executing command above returns error:
Code:
SQL0440N  No function by the name "SNAPSHOT_APPL_INFO" having compatible
arguments was found in the function path.  SQLSTATE=42884
My system:
Windows XP SP2
DB2 v7.2 FP5

Thanks,
Grofaty
the one that worked for me

db2 list applications | grep -v "^Auth"| grep -v "^--"|grep -v "^ "

the last grep---> "grep -v "^followed by 8 spaces"

n_i, your command resulting in same error, SQL0440N . I am using v8.1 fp6a

Last edited by chavadb2; 02-15-05 at 15:45.
Reply With Quote
  #10 (permalink)  
Old 02-16-05, 23:36
jacampbell jacampbell is offline
Registered User
 
Join Date: Jan 2005
Posts: 191
Since this is still alive, I suppose I should add that the first grep test should be: grep -v "^Auth Id " in case someone has a userid that starts Auth.

James Campbell
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On