You can use a Sorter transformation in a dynamic mapping. You can configure dynamic ports in the transformation and reference the generated ports.
You can reference a dynamic port or a generated port in the Sorter transformation. However, if the generated port does not exist at run time, the mapping fails.
If you use a dynamic port as a sort key, the Data Integration service considers all the generated ports in the dynamic port and the generated port order.
You can parameterize the sort keys. Use a sort list parameter for the sort key.