Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: 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

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  3. #3
    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

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    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 06:03.

  5. #5
    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.

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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 20:56.

  7. #7
    Join Date
    Jan 2003
    Posts
    1,605
    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 04:22.

  8. #8
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Snapshot functions are only available in v8.

  9. #9
    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 16:45.

  10. #10
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •