Mike, no LOAD is required or desired. ATTACH will bring the module into
storage, create the necessary control blocks, and begin execution under
control of a sub task TCB.
The attached module needs to be found in the normal search order, job
pack library, step library, system library, etc.
As for sample code, I typically do most coding in C, so here's a sample
in C:
static int
attach(CTHDTASK *task)
{
   unsigned   work[16]   = {0};
   /* attach our subtask driver module.
   ** the task->tcb is created here if the attach was a success.
   */
   __asm__(
       "LA\t1,0(,%2)\n\t"
       "ATTACH EP=CTHREAD,ECB=(%3),DPMOD=-1,SF=(E,(%4))\n\t"
       "ST\t1,%0\n\t"
       "ST\t15,%1"
       : "=m"(task->tcb), "=m"(task->rc)
       : "r"(task), "r"(&task->termecb), "r"(work) );
   return task->rc;
}
Hopefully you get the basic idea. I'm sure others here can provide
sample code in pure assembler.
--Mike Rayborn
Post by Mike Stramba ***@gmail.com [H390-MVS]1) Is a LOAD macro required first for the "attach target" ?
2) If #1, would the target be named in a STEPLIB statement ?
I'm looking for example code, the only thing I've found so far is
"MODREP" in CBT #316
Mike