Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    3

    Unanswered: Upgrding from DB2v7 to DB2v8 & parsing

    Hello,
    We are preparing to upgrade our db from UDB v7 to v8. We run on in an AIX environment, performing our work via ksh shells. Within these shells we perform the usual db2 sql commands (insert, delete, update, commit etc.).

    As part of this process we monitor/check results by piping text into a log which we then parse using awk/sed/grep. The results we get determine our subsequent course of action.

    In testing under v8, we've found that, for awk at least, our technique produces a multi line return. Where under v7 we scanned along a single line extracting what we needed, we've had to perform a scan on multiple lines to extract our data.

    Has anyone ecountered a similar problem and/or does anyone know if there is some parm I can give to DB2 to tell it to return output in a single line format?
    Your thoughts are appreciated.

    mr620

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Can you give an example, please ?

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Sep 2003
    Posts
    3

    Example

    Yes.

    we call a stored proc:

    db2 CALL "get_ctl_id ('${COALITION}', '${SCRIPT_NM}', '${SCRIPT_KEY}', 0)" >${TMP_FILE}

    which returns info and redirects into the TMP_FILE

    TMP_FILE used to come out on one line.
    Coalition is vfj CTL ID is 1014.
    We'd then parse this one line for the vfj and 1014 codes.

    Under v8 it comes out on multiple lines. TMP_FILE now looks like
    Coalition is vfj
    CTL ID is 1014

    We can of course parse the multiple lines, but thought it might be nice if we could get the DB2v8 system to give the result of the SP back on one line.

Posting Permissions

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