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 > I need to force application one bye one as script in Solaries

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-14-07, 14:21
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
I need to force application one bye one as script in Solaries

In Solaries and DB2 environment

I need to use in script to force application one by one in a loop

can you please help me out guys


Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 08-14-07, 17:37
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Something like this?
Code:
db2 list applications | awk 'NR>4 {print "db2 force application(" $3 ")";}' | sh
Not tested.
Reply With Quote
  #3 (permalink)  
Old 08-15-07, 09:30
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
It's working great and thank you
Reply With Quote
  #4 (permalink)  
Old 08-16-07, 10:43
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
db2 "force application(302)"
db2 "force application()"

How can Trip the bottom line of that script above
Reply With Quote
  #5 (permalink)  
Old 08-16-07, 11:05
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
By thw way Thanks N_I,

I chnaged minorchnage

db2 list applications | awk 'NR>4 {print "db2 \"force application(" $3 ")\"";}'

But I need to trim extra line in the bottom from given bellow

db2 "force application(315)"
db2 "force application(314)"
db2 "force application(312)"
db2 "force application()"
Reply With Quote
  #6 (permalink)  
Old 08-16-07, 11:59
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
please some body can help me
Reply With Quote
  #7 (permalink)  
Old 08-16-07, 12:55
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
try awk 'NR>4 && $3 {print "db2 \"force application(" $3 ")\"";}'
Reply With Quote
  #8 (permalink)  
Old 08-16-07, 13:32
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
thanks Once again
Reply With Quote
  #9 (permalink)  
Old 08-16-07, 13:37
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
db2 list applications | awk 'NR>4 && $3 {print "db2 \"force application(" $3 ")\"";}'

I am getting syntax error
Reply With Quote
  #10 (permalink)  
Old 08-16-07, 13:56
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
awk: syntax error near line 1
awk: bailing out near line 1
Reply With Quote
  #11 (permalink)  
Old 08-16-07, 14:54
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
That must be something about your awk implementation; my gawk works fine. Try reading the manual.
Reply With Quote
  #12 (permalink)  
Old 08-17-07, 04:11
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
awk and gawk are not the same application - it can work differently. I always use gawk where possible.
Reply With Quote
  #13 (permalink)  
Old 11-09-07, 11:37
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
it si working in AIX environment


db2 list applications | awk 'NR>4 && $3 {print "db2 \"force application(" $3 ")\"";}'
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