diff --git a/edosl0util/cli.py b/edosl0util/cli.py
index 3321d50027220cf19524dd6cbb53b97e24ed4809..eff03b90cd61cc3df92605145256b4eb3e991466 100644
--- a/edosl0util/cli.py
+++ b/edosl0util/cli.py
@@ -174,7 +174,7 @@ def cmd_rdr2l0():
 
     if args.ancillary:
         for apid in (0, 8, 11):
-            inputs = glob.glob('*.anc{:d}.pkts'.format(apid))
+            inputs = sorted(glob.glob('*.anc{:d}.pkts'.format(apid)))
             product = '{:04d}AAAAAAAAAAAAA'.format(apid)
             pdsname = pdsfilename(product)
             LOG.info("merging apid %d to %s", apid, pdsname)
@@ -185,7 +185,7 @@ def cmd_rdr2l0():
     if args.science:
         if file_type not in science_products:
             parser.exit(1, '%s is not a supported science file type\n' % file_type)
-        inputs = glob.glob('*.science.pkts')
+        inputs = sorted(glob.glob('*.science.pkts'))
         product = science_products[file_type]
         pdsname = pdsfilename(product)
         LOG.info("merging %s to %s", product, pdsname)