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 > Upgrding from DB2v7 to DB2v8 & parsing

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-04-06, 08:11
mr620 mr620 is offline
Registered User
 
Join Date: Sep 2003
Posts: 3
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
Reply With Quote
  #2 (permalink)  
Old 04-04-06, 10:11
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Can you give an example, please ?

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 04-04-06, 12:56
mr620 mr620 is offline
Registered User
 
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.
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