Try the following by moving the second 'by' out of the first one.
for each xshd_det no-lock where ...... use-index xshd_shipdate,
each ad_mstr no-lock where....... use-index ad_addr,
each pt_mstr no-lock where..... use-index pt_part,
each ih_hist no-lock where ...... use-index ih_nbr,
each...