What difference does it make? You gain nothing by choosing a random worker except for complicating the process.
Regards, Richard Schuh > -----Original Message----- > From: CMSTSO Pipelines Discussion List > [mailto:cms-pipeli...@vm.marist.edu] On Behalf Of Bob Cronin > Sent: Tuesday, January 04, 2011 2:07 PM > To: CMS-PIPELINES@VM.MARIST.EDU > Subject: Pick a record at random? > > I need to decide which of a set of worker userids to give a > spool file to. I want to pick the one with the fewest total > spool files. If there are multiple users with the same > (lowest) number, I want to choose one at random (for load > balancing purposes). I already have code that does the > queries and outputs records with the total number of spool > files right justified in columns 1-10 (padded with leading > zeros) and the name of the userid in columns 12-19. For example: > > 0000000002 xagentu2 > 0000000157 xagentu3 > 0000000010 xagentu8 > 0000000002 xagentu5 > 0000000007 xagentu4 > 0000009996 xagentu6 > 0000009999 xagentu7 > 0000000002 xagentu > > From those I need to (somehow) choose those with the fewest: > > 0000000002 xagentu2 > 0000000002 xagentu5 > 0000000002 xagentu > > From those, I want to pick one at random and then give the > new spool file to the named user (i.e. I want the output of > the pipe to be the userid to use). > > I could load them into a stem and use the Rexx Random() > function, I suppose, but was curious if there's a PipeThink > way to do it. > -- > bc >