---
title: Run Report from Command Line
slug: help/en-us/dairycomp/reports-run-command
docTags: 
createdAt: 2026-01-26T11:43:18.152Z
---

The DairyComp command line allows you to enter simple commands (such as ALTER or BREDSUM) or saved, predefined command abbrevations (such as `COWSDUE` or `COW2DRY`) to launch tools. However, you can also enter command strings to run reports. In this case, the command line syntax is a bit more complex. It can be confusing if you don't recognize what the different parts of the command string represent.

For example, when you see the command below, would you know what each part represents and what you will see in the report after you run it?

****<font color="#6b7280">      </font>****<font color="#6b7280"> </font>****<font color="#6b7280">**=4** **&gt;90**  </font>

If you're not quite sure, then the tutorial below is for you! Once you begin to understand the basic command line syntax, you can craft reports that meet your exact needs.

:::::ExpandableHeading{isOpen="true"}
## Tutorial: Create a report in the command line

Let's get started! Open up DairyComp and then follow the steps below to create a simple report, customize the list, and then sort the results:

1. Let's start by entering a report command. In the command line, type: <font color="#6b7280">  </font>
   and press **Enter**.
   Congratulations, you have created a simple report! It shows (SHOW) the ID numbers (ID) and milk weights (MILK) for all animals in your cowfile:

   ::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/8HX6Vw6QMEacRBxBhNOf6_show-milk-id-report.png" size="32" width="1015" height="586" position="flex-start" darkWidth="1015" darkHeight="586" showCaption="false"}

   :::ExpandableHeading{isOpen="true"}
   ### Understanding the difference between SHOW and LIST

   SHOW and LIST are both commonly used commands in DairyComp that are used to create reports. The important difference between them is that SHOW displays the report on the screen, while LIST sends the report directly to the printer. If printing is disabled, SHOW and LIST behave in exactly the same way.
   :::
2. Now suppose you decide you also want to see their lactation number. Press the **Escape** (ESC) key to get back to the command line, and then press the up‑arrow on your keyboard to bring the last command back.
3. Then add the item LACT to your command, and press **Enter** to update your report: <font color="#6b7280">   </font>
   Now your report has the lactation numbers in it as well:

   ::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/gpTyzsRE7rier0OcutfCR_show-milk-id-lact-report.png" size="32" width="837" height="706" position="flex-start" darkWidth="837" darkHeight="706" showCaption="false"}

   ::::ExpandableHeading{isOpen="true"}
   ### How did we know to use LACT for lactation number? Hint: Use the F1 key.

   :::hint{type="success"}
   **TIP:&#x20;**&#x49;f you’re not sure what command you need to enter for a specific item, you can press`F1` to view a pick list. From there, you can double-click on an item to add it to the command line:

   ::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/JIS3h_XqMxZRp2MJDLRup_f1-search-item.png" size="30" width="1188" height="857" darkWidth="1188" darkHeight="857" position="flex-start" showCaption="false"}
   :::
   ::::
4. At this point, note that your report includes quite a long list. This is because it contains all of the animals in your cowfile. Suppose you only want to show animals in a certain pen, say for instance, in pen 4.
   That’s easy — just add PEN FOR PEN=4 to the end of your command. The first instance of the word PEN  tells the system to actually show the pen number. The word FOR in a command tells the report that you want to customize (i.e., filter) your results down to specific conditions— in this case, to show only IDs that are in pen 4.
   Type the following command and press **Enter** to update your report: <font color="#6b7280">    </font>**PEN** <font color="#6b7280"> </font>**PEN**<font color="#6b7280">**=4** </font>**PEN**&#x20;

   :::hint{type="info"}
   **TIP:&#x20;**&#x52;emember you can click in the command line and press the up‑arrow on your keyboard to display the last command you entered.
   :::

:::Paragraph{indent="1"}
The updated report still shows the animal IDs, milk weights, and lactation numbers, but now it only shows them for the animals in pen 4. Note that the total number of results at the bottom of the page has changed:
:::

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/IuB8mJcpb0l_wjVAxco3D_show-milk-id-lact-pen4-report.png" size="32" width="1267" height="679" position="flex-start" darkWidth="1267" darkHeight="679" showCaption="false" indent="2"}

5. You can customize your list further if you want. For instance, maybe you only want to include pen 4 animals that are milking over 90 pounds. That’s easy too; just add another condition to your command. In this case, you would add MILK>90: <font color="#6b7280">    </font>**PEN** <font color="#6b7280">  </font>**PEN**<font color="#6b7280">**=4**</font> <font color="#EAB308">**&gt;90**</font>

   ::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/xPAoQc3Ynw45UJMZRCruz_show-milk-id-lact-pen4-milk90-report.png" size="32" width="1010" height="600" position="flex-start" darkWidth="1010" darkHeight="600" showCaption="false"}
6. The last thing you might want to do is sort your list to help bring some order to it. This is easy as well. The word `BY` means sort *low to high* and DOWNBY sorts *high to low*. So to sort your list from highest to lowest milk weight, just add DOWNBYMILK to the end of your command: <font color="#6b7280">    </font>**PEN**<font color="#6b7280">  </font>**PEN**<font color="#6b7280">**=4** **&gt;90**</font> <font color="#EAB308"> </font>

   ::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/wfT7qn3c2oOEoiOfbX8N4_show-milk-id-lact-pen4-milk90-sort.png" size="32" width="872" height="601" position="flex-start" darkWidth="872" darkHeight="601" showCaption="false"}

:::hint{type="success"}
**TIP:&#x20;**&#x4E;ote that the last command above is the same one you saw before starting the tutorial. It should make much more sense now!
:::

There are many ways you can customize this simple report to meet your needs, but understanding the options above is the basis for all DairyComp report commands.
:::::

If you want to delve deeper into other command line options, see [Command Line](docId\:u_NbRVeQbF6NzSP1bc9E0).



