Welcome to the rabbit hole of the most confusing and feature rich area of Pxplus.
The documentation is at best a glossy magazine page for the functionality and permutations of ways that these concepts can be strung together. BBx template functionality is almost entirely undocumented. I keep a note document of around 20 different undocumented examples of how IOLs and templates can be used with arrays, fixed strings, and records.
Dimming a Composite:
Dim Var$:compiled iol [iol=, iol(), cpl("iolist ...")]
Listing a Composite: ? LST(IOL(var$))
Dimming a BBx style template
Dim Var$: text template
Listing a Composite: ? XFA(Var$)
Below are a few date parsing routines, one of which I contributed to the list a while back.
! Parse Fixed String to numbers with BBx style Template (dim again using xfa(Dt$) in Pxplus to use with read record)
1 DIM Dt$:"Y:N(4),M:N(2),D:N(2)"
! Parse Fixed String to numbers with Dynamic IOL
1 DIM Dt$:CPL("IOLIST Y:[NUM(4)],M:[NUM(2)],D:[NUM(2)]")
! Parse Fixed String to numbers with using Documentation.
1 IOL.dt: IOLIST Y:[NUM(4)],M:[NUM(2)],D:[NUM(2)]
2 DIM Dt$:iol=iol.dt
5 ? DayOfWeek