Monday, 9 December 2013

Testing Jockeys and Trainers

To test for jockeys and/or trainers you use the respective variables from the Horse Data drop down, namely H:JOCKEY and H:TRAINER.

If you know the exact jockey names you want you can test for it as follows:

Alltrim(H:JOCKEY)$"N Rawiller,T Berry,J Bowman"

Note the Alltrim() function is used to trim trailing spaces from the jockey name to make for easier comparisons (otherwise you would have to add spaces to the jockey names to make then exactly 16 characters long - this is the length they are stored in the data files).

If you use Race TAB Live to update jockey names then they will end up in upper case in which case the rule will have to be modified as follows:

Upper(Alltrim(H:JOCKEY))$"N RAWILLER, T BERRY,J BOWMAN"

Keep in mind it only takes the initials to be slightly different for the above test to fall over so if you are concerned about the TAB sometimes using different initials then you will need to test for both variations. Alternatively you could just test for surnames as follows:

"RAWILLER"$Upper(H:JOCKEY).OR."BERRY"$Upper(H:JOCKEY).OR."BOWMAN"$Upper(H:JOCKEY)

The only problem with the above is that is will pick both "N Rawiller" and "B Rawiller" so testing for all possible name variations as mentioned earlier is the best approach.

All the above examples work the same way for trainers using the H:TRAINER variable although there is no need to use the Upper function to convert names to upper case.

Here's an example of a test for trainers using their exact names:

Alltrim(H:TRAINER)$"Peter Snowden,C J Waller,P G Moody"

Note the Alltrim() function is used to trim trailing spaces from the trainer name to make for easier comparisons (otherwise you would have to add spaces to the trainer names to make then exactly 25 characters long - this is the length they are stored in the data files).

Note that some trainers are listed with full first names and others with just initials. And some have one initial and others two initials. The only good news is that whatever name a trainer has in the form it usually does not change - so just make sure you check the exact spelling in the form and use it accordingly in your tests.

If you just wanted to test for surnames then you could use the following:

"Snowden"$H:TRAINER.OR."Waller"$H:TRAINER.OR."Moody"$H:TRAINER

Now we will take a quick look at jockey and trainer combinations. For example the following will test for N Rawiller as the jockey and C J Waller as the trainer:

Alltrim(H:JOCKEY)=="N Rawiller".AND.Alltrim(H:TRAINER)=="C J Waller"

Note you could remove the .AND. and place the jockey and trainer parts of the above rule on two separate lines as two rules.

Finally you may want to select horses where the jockey this time around is the same as the jockey for the last start. The following rule will test for this:

H:JOCKEY==F:JOCKEY

Note the above should be run in conjunction with a rule to ensure first starters are eliminated as testing for last start data when there is none can lead to first starters being included as selections when they shouldn't be.