Welcome, guest | Sign In | My Account | Store | Cart

Show installed MQ Queues.

Tcl, 74 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
###
### Show installed MQ Queues.
###

proc get_MQQueue {} {

    global AdminConfig
    global AdminControl
    global AdminApp

    set MQQueueIDs [$AdminConfig getid /MQQueue:/]

    set s1 "\nThe currently defined queues are:\n"
    puts   [ format "%-5s %s"  " " $s1 ] 

    foreach MQQueueID $MQQueueIDs {

         set name [ $AdminConfig showAttribute $MQQueueID name ]

         puts [ format "%-20s %s" " " $name ] 

    }

    set s1 "\nThe queue details are:\n"
    
    puts   [ format "%-5s %s"  " " $s1 ] 

    foreach MQQueueID $MQQueueIDs {

         set name [ $AdminConfig showAttribute $MQQueueID name ]

         puts [ format "\n%-20s %s" " " $name ] 

	 set i 0

	 while { $i <= [ string length $name ] } {

	     append underLine * 

	     incr i

         }

         puts [ format "%-20s %s\n" " " $underLine ] 

	 unset underLine

         set attrsList [ $AdminConfig showall $MQQueueID ]


	 #flatten the list

         set attrsList [ join $attrsList ]

	 array set iArray $attrsList 

	 #sort the indices 

	 set listOfNames [ lsort [ array names iArray ] ]

	 #puts $listOfNames

	 foreach element $listOfNames {

	     puts [ format "%-5s %-20s %s" " " $element $iArray($element) ] 

	 } 


    }

}

get_MQQueue
Created by Patrick Finnegan on Tue, 18 Oct 2005 (MIT)
Tcl recipes (162)
Patrick Finnegan's recipes (56)

Required Modules

  • (none specified)

Other Information and Tasks