Advanced Syntax Options
Expand the topics below to learn more:
When entering codes (such as vet codes or event codes) in the command line to generate a report, you must use the code's numeric value, not its alphabetical name.
For example: Enter EC=5 in your command line for BRED events. Why? Because "EC" is the abbreviation for event codes, and 5 is the event code for BRED events. You would NOT enter EC=BRED or just BRED.
This syntax holds true for all types of DC305 codes (i.e., reproduction codes, breeding codes, etc.).
One way to include two different groups of animals in the same report is to group your item parameters within parentheses. This type of syntax is commonly called an OR condition, since you are requesting "this or that" data. For example, you can request data from one pen or another pen:
SHOW ID PEN LACT MILK FOR DIM>100 (PEN=1 MILK>60) (PEN=4 MILK<50)
The first part of this command produces a list in which all the animals are at least 100 days in milk. However, the OR conditions—those parts of the command in parentheses—specify which pens those animals must be in and how much milk they had to produce.
You can also combine different types of data with OR conditions. For instance, if you want to create a list of animals for potential culling, you could identify animals according to the following criteria:
- Open more than 150 days and not pregnant , or...
- Bred more than three times, or...
- Milking less than 40 pounds and least 100 days in milk
In this case, your report command might look like this:
SHOW ID LACT DOPN DUE TBRD MILK FOR LACT>1 (DIM>150 CDAT=0) (TBRD>3) (MILK<40 DIM>100)
- OR conditions must be placed within paired parentheses.
- FOR conditions used in the command must be placed before the OR condition.
- OR conditions are limited to three per command, with no more than three inclusions per condition. In the example in the above section, the first OR condition contains two inclusions (DOPN>150 DUE=0), the second has one inclusion (TBRD>3), and the third has two inclusions (MILK<40 DIM>100).
- OR statements cannot be embedded within other OR statements. For instance, this is not allowed:
((DCC<215 (FCM<45) (SCC>1000))
- OR conditions can be used with the ENTER command for automatic or batch entries. See Reports to learn more about batch entries.
In addition to the operators already mentioned, you can use the hyphen character (-) to specify ranges for your reports. For example:
- PEN=1-4 returns all animals in pens 1 through 4.
- MILK=50-60 returns all milking from 50 to 60 pounds.
Ranges can also be used in reverse order to exclude particular animals from your report:
- PEN=4-2 returns all animals NOT in pens 2, 3, and 4.
- MILK=90-70 returns animals milking less than 70 pounds or more than 90 pounds.
When entering dates for a report, it's recommended that periods (.) be used as separators, as in:
5.17.21
Alternatively, the system can also recognize the slash symbol in dates (5/17/21) .
Command substitution is a powerful tool for creating partial commands that can be modified at the time of entry, allowing you to change the type and range of data returned by the command. When you use command substitutions, the system will prompt you for one or more values when you enter the command.
To use command substitution, enter a percent sign (%) in the command line followed by a "prompt word." For example, if you enter...
LIST ID RPRO PEN MILK BY %SORTKEY
...the system will prompt for the BY method, which we're calling SORTKEY.
Then you simply enter the item you want to use in the command. In the case above, MILK is used, so the results are presented BY current milk production.
Command substitutions can be combined in numerous ways. Sometimes you might want to limit results to certain pens or to certain SCC levels. You might also want to add additional items to a command. The example below shows how you might prompt to add an additional item to your results and limit the results to a chosen level of SCC:
LIST ID PEN SCC %WHAT_ELSE FOR SCC>%MIN_SCC
In this case, the system will first ask you for "what else" you want to show in your results (DIM, MILK, RPRO, etc.) and will then ask you for the minimum SCC level to show in the results.
You can also use substitutions to enter command strings to your commands. So if you want to see results for a certain pen, you could answer the above "what else" prompt with the following to limit the results to pen 4: FOR PEN=4
Consider using command substitutions to create menus that prompt for the variables you use most often. That way, you can cut down on the number of menu commands you need. For instance, you can create menu options using command substitutions such as "Animals open more than X days" or "Animals between DIM x and y" to use these options more flexibly. See Reports to learn more.