PK.LABPKEY
A^prefix,
@OPEN.LAB,
@PATS,
END;

OPEN.LAB
@admdir,
O(&,@misdict),
O(:,@admdata),
@labdir,
O(*,@labdata),
O(\,@labdict),
@pkdir

PATS
/ARGV[1]^DT,
2^nr,
DO{nr</ARGC 1,
   /ARGV[nr]^ACT,
   :AAAI[ACT]^aa,
   @PTH,
   nr+1^nr}

PTH
""^Q,
DO{@NEXT.SPEC IF{'/CONF[.results.path.nostatus][*SPS[sps]|2] @SEND}}

NEXT.SPEC
>(*SPSP[aa,Q],sps)^Q

SEND
IF{*SPS[sps]|3<DT;
"<Document>"^!,
"<InstanceMnemonic>"_prefix_sps_"</InstanceMnemonic>"^!,
"append x to key because t0 may be empty",
"<Key>"_"x"_*SPS[sps]A|10_"</Key>"^!,
"<AccountNumberDarnit>"_:AA[aa]|0_"</AccountNumberDarnit>"^!,
"<PersonMnemonic>"_:AA[aa]|3_"</PersonMnemonic>"^!,
"<EventEndDateTime>"_%Z.date.in.magic(*SPS[sps]|13)^QQ,
QQ_%Z.time.out(*SPS[sps]|13)_"</EventEndDateTime>"^!,
"<EventSetMnemonic>AP</EventSetMnemonic>"^!,
"</Document>"^!}
