Command Line
DairyComp 305 allows you to look up data, enter information, and edit settings either through menu selections or through the command line. As shown in the example below, the command line is located toward the top of the window, below the menu and toolbar. You can press the Escape key (ESC) at any time to go straight to the command prompt, or you can click inside of the command line field and start typing a command.
The command line is commonly used to run reports, so we will use a report command to illustrate command structure. A DC305 report command is made up of the 5 parts defined below.
Review the information below for help creating your report command:
-
Command Word: Start by typing a command word. Click here to learn more!
The command word tells the system what kind of report you want to run. The following commands are typical for report commands:
LIST/SHOW
COUNT/SUM/PCT
GRAPH/EGRAPH
BREDSUM
EVENTS
PLOT
ECON
GUIDE
-
Items: Type the items you want to include in your report. Items define the columns of data you want to see in your report. Click here to learn more!
Follow these guidelines when including items in your command:
- Always include the ID item on reports that need to list animals.
- Insert a space between each item.
TIP: When typing a command, you can press F1 on your keyboard to see a list of all available items you can use to build your command.Show me some examples!
In the command example above, the items are ID, PEN, LACT, DIM, DCC, and MILK:
LIST ID PEN LACT DIM DCC MILK FOR LACT>0 DCC>220 DDAT=0 BY PEN \B2
This tells the report to include columns for the animal ID, pen number (PEN), lactation number (LACT), days in milk (DIM), days carried calf (DCC), and last test day milk (MILK).
Here are a few examples of items you can use:
Item
Description
ID
The animal's ID number.
PEN
The animal's current PEN number.
LACT
The animal's current lactation number.
DIM
The animal's current days in milk.
MILK
Pounds of milk the animal last produced.
RPRO
The animal's current reproductive code.
DCC
How many days the animal has carried its calf.
DSLH
How many days since the animal's last heat.
TIP: Remember that you can press F1 to view all available items. The list above only shows several examples. -
Conditions: (Optional) Type any conditions you want to include in your report. Conditions limit your report to specific data. Click here to learn more!
One of the most commonly used condition is the FOR condition. To use it, insert the word FOR and follow it with instructions that customize (i.e., filter) your report results, such as FOR PEN=4.
Show me some examples!
In the command example above, the condition includes the word FOR, followed by 3 different conditions to customize the report results — one for lactation number (LACT), one for days carried calf (DCC), and one for dry date (DDAT):
LIST ID PEN LACT DIM DCC MILK FOR LACT>0 DCC>220 DDAT=0 BY PEN \B2
Adding these conditions to your command will narrow your report down to the following results:
- LACT>0 tells the report to include only animals with a lactation number of 1 or higher.
- DCC>220 tells the report to include only animals who have carried their calf for more than 220 days.
- DDAT=0 tells the report to include only animals that are currently milking (i.e., a fresh date exists, but DDAT=0 means no dry date exists).
When entering a condition, you can choose from the following operators:
=
Equal to
>
Greater than
>=
Greater than or equal to
<
Less than
<=
Less than or equal to
<>
Not equal to
-
Sort: (Optional) Type any sort words (BY and DOWNBY) and criteria to sort how your report results are listed. Click here to learn more!
The sort options are simple. You can use either BY or DOWNBY:
- Use BY to sort lowest to highest.
- Use DOWNBY to sort highest to lowest.
Show me some examples!
The command example above includes the sort command BY, followed by the column that will be sorted (PEN):
LIST ID PEN LACT DIM DCC MILK FOR LACT>0 DCC>220 DDAT=0 BY PEN \B2
This tells the report to sort the list by the PEN column. It puts the lowest pen number at the top and the highest pen number at the bottom. If you used DOWNBY PEN instead, it would sort the highest pen number at the top and the lowest pen number at the bottom.
-
Switches: (Optional) Insert switches at the end of your command to define special tasks and shortcuts. Switches can do a lot for the “look” of reports and the data that is in them. Click here to learn more!
When including a switch in your command, observe these guidelines:
- Precede the list of switches with a backslash ( \ ). This is not the slash on the question mark ( ? ) key; it is typically located above the Enter key.
- You can include a series of switches together by listing them all after the backslash with no space between them (\B2A).
-
Use the Switch Manager to see all the available switches for all commands. Click Command? at the left side of the command line or navigate to the Help menu to open the Switch Manager, then browse the list of commands and switches.
For a comprehensive list of commands and switches you can download, see Command Line Quick Reference Sheets.
- Switches work differently for each of the commands listed above.
- Switches are typically only a single letter or number.
- Switches are not required; rather, they are available to help you customize your reports.
Show me some examples!
In the command example above, the switches \B and \2 need to be included, so they are combined as \B2 at the end of the command:
LIST ID PEN LACT DIM DCC MILK FOR LACT>0 DCC>220 DDAT=0 BY PEN \B2
Adding these switches to your command customizes the results as follows:
- The backslash \ indicates that one or more switches are included.
- B tells the report to include both live and dead animals.
- 2 tells the report to double‑space the results so that it's easier to read.
Some of the most common switches for the LIST and SHOW commands are shown below. Note that other commands have different switches.
\2
double space
\A
averages
\B
both live and dead
\C
compress print
\D
dead animals
\E
eject after each sort
\I
print descriptions
\K
prompts for cows to list
\Ln
limit number printed on report
\P
print in columns
\Pn
number of columns to use
\Q
prints only total and average no individual info
\T
print totals
\U
print an underline at end of list
\Un
print underline
For a comprehensive list of commands and switches you can download, see Command Line Quick Reference Sheets.
See the topics below to learn more: