Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: Script Out Telnet Session and Issue a DB2 RUNSTATS Command

    Does anyone know how to script out a telnet session? Here's what I have:

    I'm working in SQL Server and I have a DTS package that has a process that drops/creates a table, populates it, adds an index and then issues a command that updates the statistics on the table. The problem is that the update statistics command is actually a DB2 Utility (RUNSTATS) that can only be executed at a DB2 command prompt because it is a utility, not a SQL statement.

    My thought is if I could create a script that would open a telnet session, I could issue the command from there and then move on in my process. So basically, I'm looking for something similar to the ftp command where you specify the commands in a file and then point to the file using the -s parameter...

    ftp [-s: filename] [hostname]
    where -s: filename specifies a text file containing ftp commands; the commands automatically run after ftp starts.

    Is this possible to create a script that controls a telnet session?

    Or is there some other way to get statistics updated in DB2?

    TIA -- Brian

  2. #2
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Quote Originally Posted by bkellis
    Does anyone know how to script out a telnet session? Here's what I have:

    I'm working in SQL Server and I have a DTS package that has a process that drops/creates a table, populates it, adds an index and then issues a command that updates the statistics on the table. The problem is that the update statistics command is actually a DB2 Utility (RUNSTATS) that can only be executed at a DB2 command prompt because it is a utility, not a SQL statement.

    My thought is if I could create a script that would open a telnet session, I could issue the command from there and then move on in my process. So basically, I'm looking for something similar to the ftp command where you specify the commands in a file and then point to the file using the -s parameter...

    ftp [-s: filename] [hostname]
    where -s: filename specifies a text file containing ftp commands; the commands automatically run after ftp starts.

    Is this possible to create a script that controls a telnet session?

    Or is there some other way to get statistics updated in DB2?

    TIA -- Brian
    You can do a RUNSTATS command from a client, wouldn't it be easier to do that?

    What language is your DTS package in?
    --
    Jonathan Petruk
    DB2 Database Consultant

Posting Permissions

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