Use %DD2DSN to Pass DSN from JCL to a Process

In this example, IBM® Connect:Direct® uses the DSN specified on the allocated FROMDD statement in the JCL and a randomly generated six- digit number to copy to a data set with a unique name.

TEST  PROCESS  SNODE=S_NODE                -
               &RAN = %PRAND               -
               &DSN = %DD2DSN(FROMDD)
STEP  COPY  FROM  (DSN=&DSN) TO (XXX.T&RAN)